From ccb081f4f40f71e5db09be082e69af9e25e84e41 Mon Sep 17 00:00:00 2001 From: Justine Smithies Date: Fri, 10 May 2024 19:49:57 +0100 Subject: Updates for using eww as the bar for sway --- .config/eww/scripts/bar-toggle.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to '.config/eww/scripts/bar-toggle.sh') diff --git a/.config/eww/scripts/bar-toggle.sh b/.config/eww/scripts/bar-toggle.sh index aedc8fd..74b1819 100755 --- a/.config/eww/scripts/bar-toggle.sh +++ b/.config/eww/scripts/bar-toggle.sh @@ -1,8 +1,9 @@ #!/bin/bash -monitors=$(hyprctl monitors -j | jq '.[] | .id') -for i in ${monitors}; -do - active_monitor=$(hyprctl -j activeworkspace | grep 'monitorID' | tr -dc '0-9\n') +monitors=$(swaymsg -t get_outputs -r | jq -r -c '.[] | .name' | wc -l) + +for ((i = 0 ; i < $monitors ; i++)); do + echo $i + active_monitor=$(swaymsg -t get_outputs | jq 'map(.focused)|to_entries|.[]|select(.value)|.key') 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