nixos-config/home-manager/wayland/eww/scripts/get-active-workspace

5 lines
262 B
Bash
Executable file

#!/usr/bin/env bash
hyprctl monitors -j | jaq '.[] | select(.focused) | .activeWorkspace.id'
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'