Do global toggles and include border_size

This commit is contained in:
David Heinemeier Hansson
2026-02-25 20:33:43 +01:00
parent 1609fd74ed
commit 53f026292d
+9 -6
View File
@@ -1,12 +1,15 @@
#!/bin/bash
# Toggles the window gaps on the active workspace between no gaps and the default 10/5/2.
# Toggles the window gaps globally between no gaps and the default 10/5/2.
workspace_id=$(hyprctl activeworkspace -j | jq -r .id)
gaps=$(hyprctl workspacerules -j | jq -r ".[] | select(.workspaceString==\"$workspace_id\") | .gapsOut[0] // 0")
gaps=$(hyprctl getoption general:gaps_out -j | jq -r '.custom' | awk '{print $1}')
if [[ $gaps == "0" ]]; then
hyprctl keyword "workspace $workspace_id, gapsout:10, gapsin:5, bordersize:2"
else \
hyprctl keyword "workspace $workspace_id, gapsout:0, gapsin:0, bordersize:0"
hyprctl keyword general:gaps_out 10
hyprctl keyword general:gaps_in 5
hyprctl keyword general:border_size 2
else
hyprctl keyword general:gaps_out 0
hyprctl keyword general:gaps_in 0
hyprctl keyword general:border_size 0
fi