Switch to eww for status bar

This commit is contained in:
Kiana Sheibani 2024-05-11 19:17:30 -04:00
parent f4c7c3e1e2
commit 106a9f4b38
15 changed files with 704 additions and 10 deletions

View 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

View 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

View 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

View 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}'

View 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

View 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) }}"}'

View 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 "{}" }'

View 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