summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-06-11 22:19:29 +0200
committerThomas Voss <thomas.voss@humanwave.nl> 2024-06-12 18:49:56 +0200
commitc3e4bf8bced931102e93b5487b0c00d200864624 (patch)
tree1761a0cbdd3a203ab1bef6319714077247112720
parentcdbfcc8044db6789676ec9a2f8901814a6eecbcf (diff)
eww: Fixs because they broke JQ
-rwxr-xr-x.config/eww/scripts/active-workspace-listener20
-rwxr-xr-x.config/eww/scripts/workspace-list-listener14
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