summaryrefslogtreecommitdiff
path: root/.config/eww/scripts/active-workspace-listener
blob: 108c08a2d76f4a31c8f6a2b2ba5340c93d95d9e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

readonly IPC="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"

report() {
	hyprctl -j monitors | jq -cr '[.[] | .activeWorkspace.id % 10]'
}

report
socat -u UNIX-CONNECT:"$IPC" - | while read -r _
do
	case "${_%>>*}" in
		workspace|moveworkspace)
			report
	esac
done