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

22 lines
374 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-08-10 08:25:55 +02:00
echo "   " && exit
2022-07-04 21:36:33 +02:00
fi
2022-08-16 00:01:38 +02:00
echo "$icon $vol%"