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

18 lines
415 B
Plaintext
Raw Normal View History

2022-07-04 21:36:33 +02:00
#!/bin/sh
# Prints the current volume or ﱝ if muted.
2022-08-16 00:01:38 +02:00
[ "$(pamixer --get-mute)" = true ] && echo "ﱝ" && 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=""
2022-08-10 08:25:55 +02:00
elif [ "$vol" -eq "0" ]; then
icon=""
2022-07-04 21:36:33 +02:00
else
2022-12-02 11:50:49 +01:00
printf "\033[11m\033[10m " && exit
2022-07-04 21:36:33 +02:00
fi
2022-09-17 16:46:33 +02:00
printf "\033[11m%s\033[10m %s\n" "$icon" "$vol"