dotfiles-remastered/.config/eww/modules/workspace/get-active-workspace.sh

11 lines
427 B
Bash
Raw Normal View History

2023-11-26 23:34:43 +00:00
#!/bin/bash
hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id'
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | sed -u -n -e '/^workspace>>/ s/^workspace>>//p' -e '/^focusedmon>>/ s/^focusedmon>>//p'
#socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
# stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'