My dotfiles
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.

30 lines
559 B

  1. #!/bin/sh
  2. # Prints the current volume or 🔇 if muted.
  3. case $BUTTON in
  4. 1) setsid -f st -e pulsemixer ;;
  5. 2) pamixer -t ;;
  6. 4) pamixer --allow-boost -i 1 ;;
  7. 5) pamixer --allow-boost -d 1 ;;
  8. 3) notify-send "📢 Volume module" "\- Shows volume 🔊, 🔇 if muted.
  9. - Middle click to mute.
  10. - Scroll to change." ;;
  11. 6) st -e nvim "$0" ;;
  12. esac
  13. [ $(pamixer --get-mute) = true ] && echo 🔇 && exit
  14. vol="$(pamixer --get-volume)"
  15. if [ "$vol" -gt "70" ]; then
  16. icon="🔊"
  17. elif [ "$vol" -lt "30" ]; then
  18. icon="🔈"
  19. else
  20. icon="🔉"
  21. fi
  22. echo "$icon$vol%"