Configuration file for dwm-bar on macbook air
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

21 lines
517 B

#!/bin/sh
# A dwm_bar function to show the master volume of ALSA
# Joe Standring <jstandring@pm.me>
# GNU GPLv3
# Dependencies: alsa-utils
dwm_alsa () {
VOL=$(amixer get Master | tail -n1 | sed -r "s/.*\[(.*)%\].*/\1/")
if [ $VOL -eq 0 ]; then
printf "[\U1F507 $VOL]\n"
elif [ $VOL -gt 0 ] && [ $VOL -le 33 ]; then
printf "[\U1F508 $VOL]\n"
elif [ $VOL -gt 33 ] && [ $VOL -le 66 ]; then
printf "[\U1F509 $VOL]\n"
else
printf "[\U1F50A $VOL]\n"
fi
}
dwm_alsa