From a9d96a06d92f6499a81c6e09112496bb751fcd89 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Sun, 7 Jul 2024 13:19:20 -0400 Subject: [PATCH] hyprland: Migrate gaps script from bash to fish Makes the code base more consistent when everything is written in one shell language. --- home/hyprland.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/home/hyprland.nix b/home/hyprland.nix index 07023dd3..f96e7ad6 100644 --- a/home/hyprland.nix +++ b/home/hyprland.nix @@ -12,7 +12,7 @@ let raiseVolumeScript = "hypr/raise-volume.fish"; lowerVolumeScript = "hypr/lower-volume.fish"; muteScript = "hypr/mute.fish"; - gapsScript = "hypr/gaps.sh"; + gapsScript = "hypr/gaps.fish"; randomBackgroundScript = "hypr/random-bg.fish"; swapBackgroundScript = "hypr/swap-bg.fish"; setBackgroundScript = "hypr/set-bg.fish"; @@ -290,12 +290,13 @@ in xdg.configFile.${gapsScript} = { executable = true; - text = /* bash */ '' - #!/usr/bin/env bash - hyprctl keyword general:gaps_out $((10 - $(hyprctl getoption general:gaps_out -j | jq -r ".custom" | choose 1))) - hyprctl keyword general:gaps_in $((5 - $(hyprctl getoption general:gaps_in -j | jq -r ".custom" | choose 1))) - hyprctl keyword general:border_size $((2 - $(hyprctl getoption general:border_size -j | jq -r ".int"))) - hyprctl keyword decoration:rounding $((8 - $(hyprctl getoption decoration:rounding -j | jq -r ".int"))) + text = /* fish */ '' + #!/usr/bin/env fish + + hyprctl keyword general:gaps_out $(math 10 - $(hyprctl getoption general:gaps_out -j | jq -r ".custom" | choose 1)) + hyprctl keyword general:gaps_in $(math 5 - $(hyprctl getoption general:gaps_in -j | jq -r ".custom" | choose 1)) + hyprctl keyword general:border_size $(math 2 - $(hyprctl getoption general:border_size -j | jq -r ".int")) + hyprctl keyword decoration:rounding $(math 8 - $(hyprctl getoption decoration:rounding -j | jq -r ".int")) ''; };