dotfiles/.config/eww/scripts/get-workspaces.sh
2024-11-05 14:09:13 +01:00

13 lines
511 B
Bash
Executable file

#!/usr/bin/env bash
min_workspaces=4
spaces (){
WORKSPACE_WINDOWS=$(hyprctl workspaces -j | jq 'map({key: .id | tostring, value: .windows}) | from_entries')
seq 1 "$(echo "$WORKSPACE_WINDOWS" | jq -r 'keys | .[] |= tonumber | .+['$min_workspaces'] | max')" | jq --argjson windows "${WORKSPACE_WINDOWS}" --slurp -Mc 'map(tostring) | map({id: ., windows: ($windows[.]//0)})'
}
spaces
socat -u "UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" - | while read -r; do
spaces
done