2023-05-28 21:48:36 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-06-10 18:36:41 +00:00
|
|
|
EMPTY=$(seq 1 10 | jaq -nRc '[inputs | (. | tostring)] | {(.[]): 0}')
|
|
|
|
|
2023-05-28 21:48:36 +00:00
|
|
|
# function to get workspaces infos and their window count
|
|
|
|
spaces (){
|
2023-06-10 18:36:41 +00:00
|
|
|
ACTIVES=$(hyprctl workspaces -j | jaq -c 'map({key: .id | tostring, value: .windows}) | from_entries')
|
|
|
|
echo $EMPTY $ACTIVES | jaq -src 'add | to_entries | map({id: (.key | tostring), windows: .value})'
|
2023-05-28 21:48:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# print workspaces infos
|
|
|
|
spaces
|
|
|
|
|
2023-06-10 18:36:41 +00:00
|
|
|
# print info on workspace changes
|
2023-05-28 21:48:36 +00:00
|
|
|
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
|
|
|
|
spaces
|
2023-06-10 18:36:41 +00:00
|
|
|
done
|