fix: Partially revert script changes
This commit is contained in:
parent
12f080999f
commit
55f70cfb07
2 changed files with 16 additions and 25 deletions
|
@ -1,17 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# REF: https://github.com/Mango0x45/dotfiles/blob/c3e4bf8/.config/eww/scripts/active-workspace-listener
|
# REF: https://github.com/Mango0x45/dotfiles/blob/d62026673b0b833f27b85f8a551cb646ae2bd751/.config/eww/scripts/active-workspace-listener
|
||||||
|
|
||||||
readonly IPC="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
|
readonly IPC="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
|
||||||
|
|
||||||
report() {
|
hyprctl -j activeworkspace | jq -r '.name'
|
||||||
hyprctl -j monitors | jq -cr '[.[] | .activeWorkspace.id % 10]'
|
socat -u UNIX-CONNECT:"$IPC" - | sed -n 's/^workspace>>//p'
|
||||||
}
|
|
||||||
|
|
||||||
report
|
|
||||||
socat -u UNIX-CONNECT:"$IPC" - | while read -r _
|
|
||||||
do
|
|
||||||
case "${_%>>*}" in
|
|
||||||
workspace|moveworkspace)
|
|
||||||
report
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
|
@ -1,21 +1,22 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# REF: https://github.com/Mango0x45/dotfiles/blob/c3e4bf8/.config/eww/scripts/workspace-list-listener
|
# REF: https://github.com/Mango0x45/dotfiles/blob/d620266/.config/eww/scripts/workspace-list-listener
|
||||||
|
|
||||||
readonly IPC="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
|
readonly IPC="$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
|
||||||
|
|
||||||
hyprctl -j workspaces | jq -cr '
|
ws="`hyprctl -j workspaces | jq -r 'sort_by(.id) | .[] | .name'`"
|
||||||
[.[].id]
|
jo -a $ws
|
||||||
| group_by(. / 10 | floor)
|
|
||||||
| [.[] | map(. % 10)]
|
|
||||||
'
|
|
||||||
|
|
||||||
socat -u UNIX-CONNECT:"$IPC" - \
|
socat -u UNIX-CONNECT:"$IPC" - \
|
||||||
| stdbuf -oL grep -E '^(create|destroy)workspace>>' \
|
| stdbuf -oL grep -E '^(create|destroy)workspace>>' \
|
||||||
| while read -r _
|
| while IFS='>>' read -r e _ n
|
||||||
do
|
do
|
||||||
hyprctl -j workspaces | jq -cr '
|
case "$e" in
|
||||||
[.[].id]
|
c*)
|
||||||
| group_by(. / 10 | floor)
|
ws="`printf '%s\n%s\n' "$ws" $n | sort -n`"
|
||||||
| [.[] | map(. % 10) | sort_by(.)]
|
;;
|
||||||
'
|
d*)
|
||||||
|
ws="`echo "$ws" | grep -v "^$n$"`"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
jo -a $ws
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue