aboutsummaryrefslogtreecommitdiff
path: root/.config/eww/scripts/bar-toggle.sh
blob: aedc8fdeb819b662c511f0bdb2d6f26f21014d2e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/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')
	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