diff options
author | Justine Smithies <justine@smithies.me.uk> | 2024-06-09 20:08:25 +0100 |
---|---|---|
committer | Justine Smithies <justine@smithies.me.uk> | 2024-06-09 20:08:25 +0100 |
commit | 2e4cf318fdea3b3fe28f27a2392b19591bc955d8 (patch) | |
tree | c6f976154c1559de6dd06df5d30a55630ca758d6 /.config/eww | |
parent | 611910dc4e36177ae8910d4df76dee8af2066451 (diff) |
Make sure it works with just 1 monitor
Diffstat (limited to '.config/eww')
-rwxr-xr-x | .config/eww/scripts/bar-toggle.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/.config/eww/scripts/bar-toggle.sh b/.config/eww/scripts/bar-toggle.sh index 8656687..ea7e6b0 100755 --- a/.config/eww/scripts/bar-toggle.sh +++ b/.config/eww/scripts/bar-toggle.sh @@ -6,6 +6,9 @@ for ((i = 0 ; i < $monitors ; i++)); do active_monitor=$(river-bedload -print outputs | jq 'map(.focused)|to_entries|.[]|select(.value)|.key') # Flip value e.g 0 to 1 ((active_monitor ^= 1)) + if [ "$monitors" == "1" ]; then + ((active_monitor ^= 1)) + fi bar=$(eww active-windows | grep "bar$i") if [ "$active_monitor" == "$i" ] && [ "$bar" == "bar$i: bar$i" ]; then eww close bar$i |