Do global toggles and include border_size
This commit is contained in:
@@ -1,12 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/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 getoption general:gaps_out -j | jq -r '.custom' | awk '{print $1}')
|
||||||
gaps=$(hyprctl workspacerules -j | jq -r ".[] | select(.workspaceString==\"$workspace_id\") | .gapsOut[0] // 0")
|
|
||||||
|
|
||||||
if [[ $gaps == "0" ]]; then
|
if [[ $gaps == "0" ]]; then
|
||||||
hyprctl keyword "workspace $workspace_id, gapsout:10, gapsin:5, bordersize:2"
|
hyprctl keyword general:gaps_out 10
|
||||||
else \
|
hyprctl keyword general:gaps_in 5
|
||||||
hyprctl keyword "workspace $workspace_id, gapsout:0, gapsin:0, bordersize:0"
|
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
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user