2023-09-04 17:36:18 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# ***This script was made by Clay Gomera (Drake)***
|
|
|
|
# - Description: A dwmblocks script to print the volume level
|
|
|
|
# - Dependencies: dwm, dwmblocks, pamixer
|
|
|
|
|
|
|
|
# if the volume is muted, just print and exit
|
2023-06-24 21:25:21 +00:00
|
|
|
[ "$(pamixer --get-mute)" = true ] && echo " " && exit
|
2023-09-04 17:36:18 +00:00
|
|
|
vol="$(pamixer --get-volume)" # if not, this variable will store the current volume level
|
2023-05-26 06:32:03 +00:00
|
|
|
if [ "$vol" -gt "50" ]; then
|
|
|
|
icon=""
|
|
|
|
elif [ "$vol" -gt "10" ]; then
|
|
|
|
icon=""
|
|
|
|
elif [ "$vol" -gt "0" ]; then
|
|
|
|
icon=""
|
|
|
|
else
|
2023-09-04 17:36:18 +00:00
|
|
|
echo " " && exit # just in case if pamixer or the audio isn't available
|
2023-05-26 06:32:03 +00:00
|
|
|
fi
|
2023-09-04 17:36:18 +00:00
|
|
|
echo -e " $icon $vol% " # print the volume icon and level
|