infrastructure/hosts/neodymium/home/wayland/eww/scripts/get-workspaces

18 lines
544 B
Plaintext
Raw Normal View History

#!/bin/bash
2023-06-10 18:36:41 +00:00
EMPTY=$(seq 1 10 | jaq -nRc '[inputs | (. | tostring)] | {(.[]): 0}')
# 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})'
}
# print workspaces infos
spaces
2023-06-10 18:36:41 +00:00
# print info on workspace changes
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