aboutsummaryrefslogtreecommitdiff
path: root/.config/eww/scripts/bar-toggle.sh
blob: 2b55ff07c49eff9f79cbd867636cff6ad74eb9ec (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 windows | grep "*bar$i")
	if [ "$active_monitor" == "$i" ] && [ "$bar" == "*bar$i" ]; then
		eww close bar$i
	elif [ "$active_monitor" == "$i" ]; then
		eww open bar$i
	fi
done