Last active
April 3, 2022 23:37
-
-
Save razouck/8ce2cb9a465bb42a9804b25c78ecf75e to your computer and use it in GitHub Desktop.
Change the volume with Dunst.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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