2024-10-21 11:14:08 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-11-05 14:09:13 +01:00
|
|
|
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
|
2024-10-21 11:14:08 +02:00
|
|
|
done
|