tweak: switch from jaq to jq

`jaq` is not really better than `jq`, and it's more useful to have
the more popular version in my environment.
This commit is contained in:
Kiana Sheibani 2025-03-07 21:07:59 -05:00
parent 0275dcacdd
commit 264fc1406d
Signed by: toki
GPG key ID: 6CB106C25E86A9F7
5 changed files with 8 additions and 8 deletions

View file

@ -25,7 +25,7 @@ in {
in [ in [
# Shell # Shell
socat socat
jaq jq
tldr tldr
ripgrep ripgrep
unzip unzip

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
hyprctl activewindow -j | jaq -c . hyprctl activewindow -j | jq -c .
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
stdbuf -o0 grep -ose '^activewindow>>' | while read -r line; do stdbuf -o0 grep -ose '^activewindow>>' | while read -r line; do
hyprctl activewindow -j | jaq -c . hyprctl activewindow -j | jq -c .
done done

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
hyprctl monitors -j | jaq '.[] | select(.focused) | .activeWorkspace.id' hyprctl monitors -j | jq '.[] | select(.focused) | .activeWorkspace.id'
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}' stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'

View file

@ -1,9 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
workspaces() { workspaces() {
hyprctl workspaces -j | jaq -c 'map({key: .id | tostring, value: .windows}) | from_entries hyprctl workspaces -j | jq -c 'map({key: .id | tostring, value: .windows}) | from_entries
| . as $windows | [range(1;11) | {id: tostring, windows: $windows[tostring] // 0, | . as $windows | [range(1;11) | {id: tostring, windows: ($windows[tostring] // 0),
previous: $windows[.-1|tostring] // 0, next: $windows[.+1|tostring] // 0}]' previous: ($windows[.-1|tostring] // 0), next: ($windows[.+1|tostring] // 0)}]'
} }
workspaces workspaces

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
notify-send "$1" "$2" -c multimedia -a "$3" \ notify-send "$1" "$2" -c multimedia -a "$3" \
$(makoctl list | jaq -r 'first(.data[][]|select(.category.data=="multimedia")|.id.data|["-r",.])[]') \ $(makoctl list | jq -r 'first(.data[][]|select(.category.data=="multimedia")|.id.data|["-r",.])[]') \
-h "INT:value:$4" -h "INT:value:$4"