infrastructure/home/wayland/eww/config/scripts/get-workspaces

16 lines
570 B
Plaintext
Raw Normal View History

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}) | sort_by(.id | tonumber)'
}
# print workspaces infos
spaces
2023-06-10 18:36:41 +00:00
# print info on workspace changes
socat -u UNIX-CONNECT:/$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
spaces
2023-06-10 18:36:41 +00:00
done