aboutsummaryrefslogtreecommitdiff
path: root/.config/eww/scripts/bar-toggle.sh
diff options
context:
space:
mode:
Diffstat (limited to '.config/eww/scripts/bar-toggle.sh')
-rwxr-xr-x.config/eww/scripts/bar-toggle.sh9
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