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.

34 lines
989 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. if [ "$IDENTIFIER" = "unicode" ]; then
  9. if [ "$VOL" = "muted" ] || [ "$VOL" -eq 0 ]; then
  10. printf "[🔇]\n"
  11. elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then
  12. printf "[🔈 %s%%]\n" "$VOL"
  13. elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then
  14. printf "[🔉 %s%%]\n" "$VOL"
  15. else
  16. printf "[🔊 %s%%]\n" "$VOL"
  17. fi
  18. else
  19. if [ "$VOL" = "muted" ] || [ "$VOL" -eq 0 ]; then
  20. printf "[MUTE]\n"
  21. elif [ "$VOL" -gt 0 ] && [ "$VOL" -le 33 ]; then
  22. printf "[VOL %s%%]\n" "$VOL"
  23. elif [ "$VOL" -gt 33 ] && [ "$VOL" -le 66 ]; then
  24. printf "[VOL %s%%]\n" "$VOL"
  25. else
  26. printf "[VOL %s%%]\n" "$VOL"
  27. fi
  28. fi
  29. }
  30. dwm_pulse