volume-notification.sh 481 B

12345678910111213141516
  1. #!/bin/sh
  2. volume="$(pactl get-sink-volume @DEFAULT_SINK@ | grep -Eo '[0-9]+%' | head -n 1)"
  3. volumenum="${volume%\%}"
  4. icon="audio-volume-medium"
  5. if [ "$volumenum" -gt 66 ]; then
  6. icon="audio-volume-high"
  7. elif [ "$volumenum" -le 33 ]; then
  8. icon="audio-volume-low"
  9. if [ "$volumenum" -eq 0 ]; then
  10. icon="audio-off"
  11. fi
  12. fi
  13. dunstify -i "$icon" -a "$1" -h string:x-dunst-stack-tag:PULSE_VOLUME "Pulseaudio" -h int:value:"$volume" "$volume"
  14. pw-play /usr/share/sounds/ITGC/notify.flac