diff options
author | Justine Smithies <justine@smithies.me.uk> | 2024-05-10 19:49:57 +0100 |
---|---|---|
committer | Justine Smithies <justine@smithies.me.uk> | 2024-05-10 19:49:57 +0100 |
commit | ccb081f4f40f71e5db09be082e69af9e25e84e41 (patch) | |
tree | 629268600e4eaad968886fc29f6dc012a68a210d /.config/eww/scripts/bar-toggle.sh | |
parent | fb3afe0023747f7f7f8f85dfa0a38baf61cbfb71 (diff) |
Updates for using eww as the bar for sway
Diffstat (limited to '.config/eww/scripts/bar-toggle.sh')
-rwxr-xr-x | .config/eww/scripts/bar-toggle.sh | 9 |
1 files changed, 5 insertions, 4 deletions
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 |