Created
May 24, 2021 09:58
-
-
Save sakhmatd/eb838d329e786f8790257a3465f7f235 to your computer and use it in GitHub Desktop.
Use pamixer and dunst to create a volume indicator for DE-less setups
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 | |
# dunstMixer | |
msgId="3378423" | |
pamixer "$@" > /dev/null | |
volume="$(pamixer --get-volume)" | |
mute="$(pamixer --get-mute)" | |
if [[ $volume == 0 || "$mute" == "true" ]]; then | |
dunstify -a "changeVolume" -u low -i audio-volume-muted -r "$msgId" "Volume muted" | |
else | |
dunstify -a "changeVolume" -u low -i audio-volume-high -r "$msgId" \ | |
-h int:value:"$volume" "Volume: ${volume}%" | |
fi | |
canberra-gtk-play -i audio-volume-change -d "changeVolume" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment