Skip to content

Instantly share code, notes, and snippets.

@razouck
Last active April 3, 2022 23:37
Show Gist options
  • 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