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

5 years ago
  1. #!/bin/sh
  2. # A dwm_bar function to show the master volume of ALSA
  3. # Joe Standring <jstandring@pm.me>
  4. # GNU GPLv3
  5. # Dependencies: alsa-utils
  6. dwm_alsa () {
  7. VOL=$(amixer get Master | tail -n1 | sed -r "s/.*\[(.*)%\].*/\1/")
  8. if [ $VOL -eq 0 ]; then
  9. printf "[\U1F507 $VOL]\n"
  10. elif [ $VOL -gt 0 ] && [ $VOL -le 33 ]; then
  11. printf "[\U1F508 $VOL]\n"
  12. elif [ $VOL -gt 33 ] && [ $VOL -le 66 ]; then
  13. printf "[\U1F509 $VOL]\n"
  14. else
  15. printf "[\U1F50A $VOL]\n"
  16. fi
  17. }
  18. dwm_alsa