neodotfiles/user/.config/awesome/ui/widgets/volume

15 lines
337 B
Text
Raw Normal View History

#!/bin/bash
2022-07-01 06:06:16 +00:00
# Prints the current volume or 🔇 if muted.
2022-12-05 01:49:49 +00:00
[ $(pamixer --get-mute) = true ] && echo " " && exit
2022-07-01 06:06:16 +00:00
vol="$(pamixer --get-volume)"
2022-10-27 16:23:56 +00:00
if [ "$vol" -gt "50" ]; then
2022-09-12 23:22:46 +00:00
icon=""
2022-10-27 16:23:56 +00:00
elif [ "$vol" -gt "10" ]; then
2022-09-12 23:22:46 +00:00
icon=""
2022-07-01 06:06:16 +00:00
elif [ "$vol" -gt "0" ]; then
2022-10-27 16:23:56 +00:00
icon=""
2022-07-01 06:06:16 +00:00
else
2022-12-05 01:49:49 +00:00
echo "  " && exit
2022-07-01 06:06:16 +00:00
fi
2022-11-30 17:31:15 +00:00
echo -e "$icon $vol%"