Skip to content

Instantly share code, notes, and snippets.

@razouck
Last active April 3, 2022 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save razouck/8ce2cb9a465bb42a9804b25c78ecf75e to your computer and use it in GitHub Desktop.
Save razouck/8ce2cb9a465bb42a9804b25c78ecf75e to your computer and use it in GitHub Desktop.
Change the volume with Dunst.
#!/bin/bash
notify() {
if [ $1 -gt 60 ]
then
icon="🔊"
elif [ $1 -gt 30 ]
then
icon="🔉"
elif [ $1 -gt 0 ]
then
icon="🔈"
else
icon="🔇"
fi
dunstify -t 500 -h string:x-dunst-stack-tag:volume "$icon Volume: ${1}%"
}
case $1 in
mute )
pamixer -m
notify 0
exit
;;
up ) option='-i' ;;
down ) option='-d' ;;
esac
pamixer -u
pamixer $option 5
notify `pamixer --get-volume`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment