Switch to eww for status bar
This commit is contained in:
parent
f4c7c3e1e2
commit
106a9f4b38
15 changed files with 704 additions and 10 deletions
6
home-manager/wayland/eww/scripts/active-window
Executable file
6
home-manager/wayland/eww/scripts/active-window
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
hyprctl activewindow -j | jaq -c .
|
||||
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
|
||||
stdbuf -o0 grep -ose '^activewindow>>' | while read -r line; do
|
||||
hyprctl activewindow -j | jaq -c .
|
||||
done
|
||||
7
home-manager/wayland/eww/scripts/brightness
Executable file
7
home-manager/wayland/eww/scripts/brightness
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
brightnessctl -me | cut -d, -f4 | tr -d '%'
|
||||
device=$(brightnessctl -m | head -n 1 | cut -d, -f1)
|
||||
while true; do
|
||||
inotifywait /sys/class/backlight/"$device"/brightness &>/dev/null
|
||||
brightnessctl -me | cut -d, -f4 | tr -d '%'
|
||||
done
|
||||
29
home-manager/wayland/eww/scripts/change-active-workspace
Executable file
29
home-manager/wayland/eww/scripts/change-active-workspace
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
direction=$1
|
||||
current=$2
|
||||
|
||||
min=1
|
||||
max=10
|
||||
|
||||
function clamp {
|
||||
if test $1 -lt $min; then
|
||||
echo $min
|
||||
elif test $1 -gt $max; then
|
||||
echo $max
|
||||
else
|
||||
echo $1
|
||||
fi
|
||||
}
|
||||
|
||||
if test "$direction" = "down"
|
||||
then
|
||||
target=$(clamp $(($current+1)))
|
||||
echo "jumping to $target"
|
||||
hyprctl dispatch workspace $target
|
||||
elif test "$direction" = "up"
|
||||
then
|
||||
target=$(clamp $(($current-1)))
|
||||
echo "jumping to $target"
|
||||
hyprctl dispatch workspace $target
|
||||
fi
|
||||
4
home-manager/wayland/eww/scripts/get-active-workspace
Executable file
4
home-manager/wayland/eww/scripts/get-active-workspace
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
hyprctl monitors -j | jaq '.[] | select(.focused) | .activeWorkspace.id'
|
||||
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - |
|
||||
stdbuf -o0 awk -F '>>|,' -e '/^workspace>>/ {print $2}' -e '/^focusedmon>>/ {print $3}'
|
||||
12
home-manager/wayland/eww/scripts/get-workspaces
Executable file
12
home-manager/wayland/eww/scripts/get-workspaces
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
workspaces() {
|
||||
hyprctl workspaces -j | jaq -c 'map({key: .id | tostring, value: .windows}) | from_entries
|
||||
| . as $windows | [range(1;11) | {id: tostring, windows: $windows[tostring] // 0,
|
||||
previous: $windows[.-1|tostring] // 0, next: $windows[.+1|tostring] // 0 }]'
|
||||
}
|
||||
|
||||
workspaces
|
||||
socat -u UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | while read -r line; do
|
||||
workspaces
|
||||
done
|
||||
11
home-manager/wayland/eww/scripts/mpris-metadata
Executable file
11
home-manager/wayland/eww/scripts/mpris-metadata
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
playerctl metadata --follow --format \
|
||||
'{"playerName": "{{ playerName }}",'\
|
||||
'"status": "{{ status }}",'\
|
||||
'"artist": "{{ artist }}",'\
|
||||
'"title": "{{ title }}",'\
|
||||
'"album": "{{ album }}",'\
|
||||
'"position": "{{ position }}",'\
|
||||
'"position_d": "{{ duration(position) }}",'\
|
||||
'"duration": "{{ mpris:length }}",'\
|
||||
'"duration_d": "{{ duration(mpris:length) }}"}'
|
||||
8
home-manager/wayland/eww/scripts/network
Executable file
8
home-manager/wayland/eww/scripts/network
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
nmcli -t c show --active | awk -F ':' -e \
|
||||
'// { if ($3 == "'$1'") {
|
||||
print "{\"name\":\""$1"\",\"device\":\""$4"\"}";
|
||||
found = 1;
|
||||
exit;
|
||||
}}
|
||||
END { if (!found) print "{}" }'
|
||||
10
home-manager/wayland/eww/scripts/volume
Executable file
10
home-manager/wayland/eww/scripts/volume
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
volume() {
|
||||
echo '{"value":'$(pamixer --get-volume)',"muted":"'$(pamixer --get-mute)'"}'
|
||||
}
|
||||
|
||||
volume
|
||||
pw-mon -oa | stdbuf -o0 grep -os "changed:" | while read -r line; do
|
||||
volume
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue