#!/usr/bin/env bash MONITOR=$1 if [ -z "$MONITOR" ]; then echo "Usage: $0 " exit 1 fi KANJI='["一","二","三","四","五","六","七","八","九"]' ICONS='["\\ue0ee","\\ue0ef","\\ue0f0","\\ue0f1","\\ue0f2","\\ue0f3","\\ue0f4","\\ue0f5","\\ue0f6"]' spaces () { WORKSPACE_WINDOWS=$(hyprctl workspaces -j | jq "[.[] | select(.monitorID == $MONITOR)] | map({ key: (.id | tostring), value: .windows }) | from_entries") seq 1 9 | jq --argjson windows "${WORKSPACE_WINDOWS}" --argjson kanji "${ICONS}" --slurp -Mc 'map({id: ., name: ($kanji[. - 1]), windows: ($windows[. | tostring]//0)})' } spaces socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do spaces done