aboutsummaryrefslogtreecommitdiff
path: root/.config/eww
diff options
context:
space:
mode:
Diffstat (limited to '.config/eww')
-rwxr-xr-x.config/eww/scripts/bar-toggle.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/.config/eww/scripts/bar-toggle.sh b/.config/eww/scripts/bar-toggle.sh
index 74b1819..8656687 100755
--- a/.config/eww/scripts/bar-toggle.sh
+++ b/.config/eww/scripts/bar-toggle.sh
@@ -1,9 +1,11 @@
#!/bin/bash
-monitors=$(swaymsg -t get_outputs -r | jq -r -c '.[] | .name' | wc -l)
+monitors=$(river-bedload -print outputs | jq -r -c '.[] | .name' | wc -l | xargs)
for ((i = 0 ; i < $monitors ; i++)); do
echo $i
- active_monitor=$(swaymsg -t get_outputs | jq 'map(.focused)|to_entries|.[]|select(.value)|.key')
+ active_monitor=$(river-bedload -print outputs | jq 'map(.focused)|to_entries|.[]|select(.value)|.key')
+ # Flip value e.g 0 to 1
+ ((active_monitor ^= 1))
bar=$(eww active-windows | grep "bar$i")
if [ "$active_monitor" == "$i" ] && [ "$bar" == "bar$i: bar$i" ]; then
eww close bar$i