#!/bin/sh readonly IPC="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" hyprctl -j workspaces | jq -cr ' [.[].id] | group_by(. / 10 | floor) | [.[] | map(. % 10)] ' socat -u UNIX-CONNECT:"$IPC" - \ | stdbuf -oL grep -E '^(create|destroy)workspace>>' \ | while read -r _ do hyprctl -j workspaces | jq -cr ' [.[].id] | group_by(. / 10 | floor) | [.[] | map(. % 10) | sort_by(.)] ' done