nixos-config/home-manager/wayland/eww/scripts/get-workspaces
Kiana Sheibani 264fc1406d
tweak: switch from jaq to jq
`jaq` is not really better than `jq`, and it's more useful to have
the more popular version in my environment.
2025-03-07 21:28:04 -05:00

12 lines
446 B
Bash
Executable file

#!/usr/bin/env bash
workspaces() {
hyprctl workspaces -j | jq -c 'map({key: .id | tostring, value: .windows}) | from_entries
| . as $windows | [range(1;11) | {id: tostring, windows: ($windows[tostring] // 0),
previous: ($windows[.-1|tostring] // 0), next: ($windows[.+1|tostring] // 0)}]'
}
workspaces
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
workspaces
done