nixos-config/home-manager/wayland/eww/scripts/get-workspaces
Kiana Sheibani af0e27630f
refactor: use systemd services instead of start script
This is probably what I should've done from the beginning, but I didn't
really know how `systemd` worked when I started writing this config.
2024-10-15 03:30:13 -04:00

13 lines
441 B
Bash
Executable file

#!/usr/bin/env bash
workspaces() {
hyprctl workspaces -j | jaq -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