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.

37 lines
1012 B

  1. #!/bin/sh
  2. # A dwm_bar function to show the master volume of PulseAudio
  3. # Joe Standring <git@joestandring.com>
  4. # GNU GPLv3
  5. # Dependencies: pamixer
  6. dwm_pulse () {
  7. VOL=$(pamixer --get-volume-human | tr -d '%')
  8. printf "%s" "$SEP1"
  9. if [ "$IDENTIFIER" = "unicode" ]; then
  10. if [ "$VOL" = "muted" ] || [ "$VOL" -eq 0 ]; then
  11. printf "🔇"
  12. elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then
  13. printf "🔈 %s%%" "$VOL"
  14. elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then
  15. printf "🔉 %s%%" "$VOL"
  16. else
  17. printf "🔊 %s%%" "$VOL"
  18. fi
  19. else
  20. if [ "$VOL" = "muted" ] || [ "$VOL" -eq 0 ]; then
  21. printf "MUTE"
  22. elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then
  23. printf "VOL %s%%" "$VOL"
  24. elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then
  25. printf "VOL %s%%" "$VOL"
  26. else
  27. printf "VOL %s%%" "$VOL"
  28. fi
  29. fi
  30. printf "%s\n" "$SEP2"
  31. }
  32. dwm_pulse