summaryrefslogtreecommitdiff
path: root/.config/eww
diff options
context:
space:
mode:
Diffstat (limited to '.config/eww')
-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