1
0
Fork 0
dotfiles/.local/bin/statusbar/sb-volume

21 lines
450 B
Plaintext
Raw Normal View History

2022-07-04 21:36:33 +02:00
#!/bin/sh
big="\033[11m"
reset="\033[0m"
2022-07-04 21:36:33 +02:00
# Prints the current volume or ﱝ if muted.
2023-04-12 11:37:10 +02:00
[ "$(pamixer --get-mute)" = true ] && echo "\e[11mﱝ\e[10m" && exit
2022-07-04 21:36:33 +02:00
vol="$(pamixer --get-volume)"
if [ "$vol" -gt "70" ]; then
2022-08-07 12:54:35 +02:00
icon=""
2022-07-04 21:36:33 +02:00
elif [ "$vol" -gt "30" ]; then
2022-08-07 12:54:35 +02:00
icon=""
2022-07-04 21:36:33 +02:00
elif [ "$vol" -gt "0" ]; then
2022-08-07 12:54:35 +02:00
icon=""
2023-02-07 17:19:53 +01:00
elif [ "$vol" -eq "0" ]; then
icon=""
2022-07-04 21:36:33 +02:00
else
printf "%b%b " "\e[11m" "\e[0m" && exit
2022-07-04 21:36:33 +02:00
fi
printf "%b" "$big$icon$reset $vol\n"