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

15 lines
503 B
Bash
Executable file

#!/bin/bash
# function to get workspaces infos and their window count
spaces (){
WORKSPACE_WINDOWS=$(hyprctl workspaces -j | jq 'map({key: .id | tostring, value: .windows}) | from_entries')
seq 1 10 | jq --argjson windows "${WORKSPACE_WINDOWS}" --slurp -Mc 'map(tostring) | map({id: ., windows: ($windows[.]//0)})'
}
# print workspaces infos
spaces
# print info on workspace changes
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
spaces
done