From f6cce8f1ae6361117e8689001dc0344e0d3b9b77 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 11 Jun 2024 22:19:29 +0200 Subject: eww: Fixs because they broke JQ --- .config/eww/scripts/active-workspace-listener | 20 +++++++++++--------- .config/eww/scripts/workspace-list-listener | 14 ++++++++------ 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.config/eww/scripts/active-workspace-listener b/.config/eww/scripts/active-workspace-listener index f8704b8..108c08a 100755 --- a/.config/eww/scripts/active-workspace-listener +++ b/.config/eww/scripts/active-workspace-listener @@ -2,13 +2,15 @@ readonly IPC="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock" -{ - hyprctl -j monitors - socat -u UNIX-CONNECT:"$IPC" - | while read -r _ - do - case "${_%>>*}" in +report() { + hyprctl -j monitors | jq -cr '[.[] | .activeWorkspace.id % 10]' +} + +report +socat -u UNIX-CONNECT:"$IPC" - | while read -r _ +do + case "${_%>>*}" in workspace|moveworkspace) - hyprctl -j monitors - esac - done -} | jq -cr '[.[] | .activeWorkspace.id % 10]' + report + esac +done diff --git a/.config/eww/scripts/workspace-list-listener b/.config/eww/scripts/workspace-list-listener index c7ff7fb..6dc3e4b 100755 --- a/.config/eww/scripts/workspace-list-listener +++ b/.config/eww/scripts/workspace-list-listener @@ -10,9 +10,11 @@ hyprctl -j workspaces | jq -cr ' socat -u UNIX-CONNECT:"$IPC" - \ | stdbuf -oL grep -E '^(create|destroy)workspace>>' \ - | while read -r _; do hyprctl -j workspaces; done \ - | jq -cr ' - [.[].id] - | group_by(. / 10 | floor) - | [.[] | map(. % 10) | sort_by(.)] - ' + | while read -r _ + do + hyprctl -j workspaces | jq -cr ' + [.[].id] + | group_by(. / 10 | floor) + | [.[] | map(. % 10) | sort_by(.)] + ' + done -- cgit v1.2.3