blob: 8656687e8e760077670d743bd2a20b6964a4227d (
plain) (
tree)
|
|
#!/bin/bash
monitors=$(river-bedload -print outputs | jq -r -c '.[] | .name' | wc -l | xargs)
for ((i = 0 ; i < $monitors ; i++)); do
echo $i
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
elif [ "$active_monitor" == "$i" ]; then
eww open bar$i
fi
done
|