From 2e4cf318fdea3b3fe28f27a2392b19591bc955d8 Mon Sep 17 00:00:00 2001 From: Justine Smithies Date: Sun, 9 Jun 2024 20:08:25 +0100 Subject: Make sure it works with just 1 monitor --- .config/eww/scripts/bar-toggle.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to '.config') 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 -- cgit v1.2.3