#!/bin/dash spaces (){ hyprctl workspaces -j | jq -c 'map({id: .id, windows: .windows, monitor: .monitorID}) | sort_by(.id)' } current (){ hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id' } title (){ hyprctl activewindow -j | jq --raw-output .title } status (){ echo "{\"spaces\": $(spaces), \"current\": \"$(current)\", \"title\": \"$(title)\"}" } status socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do status done