refactor: Move eww scripts inside eww config dir
This commit is contained in:
parent
ab4d9a9e81
commit
1aef655bc2
5 changed files with 44 additions and 3 deletions
|
@ -3,13 +3,13 @@
|
||||||
|
|
||||||
;; Listeners
|
;; Listeners
|
||||||
(deflisten active-workspace
|
(deflisten active-workspace
|
||||||
`stdbuf -oL $HOME/.local/bin/scripts/eww-hyprland-active-workspace-listener`)
|
`stdbuf -oL ./scripts/workspace-active-listener`)
|
||||||
|
|
||||||
(deflisten workspace-list :initial '[1]'
|
(deflisten workspace-list :initial '[1]'
|
||||||
`stdbuf -oL $HOME/.local/bin/scripts/eww-hyprland-workspace-list-listener`)
|
`stdbuf -oL ./scripts/workspace-list-listener`)
|
||||||
|
|
||||||
(deflisten datetime
|
(deflisten datetime
|
||||||
`stdbuf -oL $HOME/.local/bin/scripts/eww-datetime-listener`)
|
`stdbuf -oL ./scripts/datetime-listener`)
|
||||||
|
|
||||||
;; Windows
|
;; Windows
|
||||||
(defwindow bar
|
(defwindow bar
|
||||||
|
|
8
.config/eww/scripts/datetime-listener
Executable file
8
.config/eww/scripts/datetime-listener
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
while :
|
||||||
|
do
|
||||||
|
date +"full='%a, %d %b %Y • %H:%M %Z' date='%Y-%m-%d'" \
|
||||||
|
| xargs jo
|
||||||
|
date +%s.%N | dc -e "? d 1 + 1 / r - p" | xargs sleep
|
||||||
|
done
|
4
.config/eww/scripts/hyprland-getsocket
Executable file
4
.config/eww/scripts/hyprland-getsocket
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
tmp=/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock
|
||||||
|
[ -f $tmp ] && echo $tmp || echo $XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock
|
7
.config/eww/scripts/workspace-active-listener
Executable file
7
.config/eww/scripts/workspace-active-listener
Executable file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# REF: https://github.com/Mango0x45/dotfiles/blob/d62026673b0b833f27b85f8a551cb646ae2bd751/.config/eww/scripts/active-workspace-listener
|
||||||
|
|
||||||
|
readonly IPC=$(./scripts/hyprland-getsocket)
|
||||||
|
|
||||||
|
hyprctl -j activeworkspace | jq -r '.name'
|
||||||
|
socat -u UNIX-CONNECT:"$IPC" - | sed -n 's/^workspace>>//p'
|
22
.config/eww/scripts/workspace-list-listener
Executable file
22
.config/eww/scripts/workspace-list-listener
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# REF: https://github.com/Mango0x45/dotfiles/blob/d620266/.config/eww/scripts/workspace-list-listener
|
||||||
|
|
||||||
|
readonly IPC=$(./scripts/hyprland-getsocket)
|
||||||
|
|
||||||
|
ws="`hyprctl -j workspaces | jq -r 'sort_by(.id) | .[] | .name'`"
|
||||||
|
jo -a $ws
|
||||||
|
|
||||||
|
socat -u UNIX-CONNECT:"$IPC" - \
|
||||||
|
| stdbuf -oL grep -E '^(create|destroy)workspace>>' \
|
||||||
|
| while IFS='>>' read -r e _ n
|
||||||
|
do
|
||||||
|
case "$e" in
|
||||||
|
c*)
|
||||||
|
ws="`printf '%s\n%s\n' "$ws" $n | sort -n`"
|
||||||
|
;;
|
||||||
|
d*)
|
||||||
|
ws="`echo "$ws" | grep -v "^$n$"`"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
jo -a $ws
|
||||||
|
done
|
Loading…
Add table
Add a link
Reference in a new issue