Another copy of my dotfiles. Because I don't completely trust GitHub.
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.

29 lines
615 B

  1. #!/bin/bash
  2. # pacontrol.sh
  3. #
  4. # This script changes the volume of the current audio source based on a set interval
  5. usage() {
  6. echo "Usage: pacontrol.sh [up|down|toggle-mute]"
  7. }
  8. vol_interval=10
  9. sinks=$(pactl list short sinks | cut -c 1)
  10. latest_sink=${sinks[*]: -1}
  11. case $1 in
  12. "up")
  13. pactl set-sink-mute $latest_sink 0
  14. pactl set-sink-volume $latest_sink +$vol_interval%
  15. ;;
  16. "down")
  17. pactl set-sink-volume $latest_sink -$vol_interval%
  18. ;;
  19. "toggle-mute")
  20. pactl set-sink-mute $latest_sink toggle
  21. ;;
  22. *) usage ;;
  23. esac
  24. kill -48 $(pidof dwmblocks)