summaryrefslogtreecommitdiff
path: root/.config/eww/scripts
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-02-22 14:01:49 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-02-22 14:02:20 +0100
commit4dd5ad747ac6f8f8002a511c38d11516241d95a8 (patch)
treeb90de39a66c5b2b1cddb28e22bd064e63e6b22c5 /.config/eww/scripts
parent8163f5d0cde2c1f2795ff9a416281d578c56b9af (diff)
eww: Better support multimonitor setups
Diffstat (limited to '.config/eww/scripts')
-rwxr-xr-x.config/eww/scripts/active-workspace-listener22
1 files changed, 10 insertions, 12 deletions
diff --git a/.config/eww/scripts/active-workspace-listener b/.config/eww/scripts/active-workspace-listener
index 359a0f2..3f57ec5 100755
--- a/.config/eww/scripts/active-workspace-listener
+++ b/.config/eww/scripts/active-workspace-listener
@@ -2,15 +2,13 @@
readonly IPC=/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock
-hyprctl -j activeworkspace | jq -r '.name'
-socat -u UNIX-CONNECT:"$IPC" - | while read -r line
-do
- case "$line" in
- 'workspace>>'*)
- echo "${line#*'>>'}"
- ;;
- 'moveworkspace>>'*)
- hyprctl -j activewindow | jq -r .workspace.name
- ;;
- esac
-done
+{
+ hyprctl -j monitors
+ socat -u UNIX-CONNECT:"$IPC" - | while read -r _
+ do
+ case "${_%>>*}" in
+ workspace|moveworkspace)
+ hyprctl -j monitors
+ esac
+ done
+} | jq -cr '[.[] | .activeWorkspace.name]'