Tips and tricks
Using dunstify as volume/brightness level indicator You can use the replace id feature to implement a simple volume or brightness indicator notification like in this picture [2].
To realize that volume indicator place the following script somewhere on your PATH.
#!/bin/bash
# changeVolume
# Arbitrary but unique message id
msgId="991049"
# Change the volume using alsa(might differ if you use pulseaudio)
amixer -c 0 set Master "$@" > /dev/null
# Query amixer for the current volume and whether or not the speaker is muted
volume="$(amixer -c 0 get Master | tail -1 | awk '{print $4}' | sed 's/[^0-9]*//g')"
mute="$(amixer -c 0 get Master | tail -1 | awk '{print $6}' | sed 's/[^a-z]*//g')"
if [[ $volume == 0 || "$mute" == "off" ]]; then
# Show the sound muted notification
dunstify -a "changeVolume" -u low -i audio-volume-muted -r "$msgId" "Volume muted"
else
# Show the volume notification
dunstify -a "changeVolume" -u low -i audio-volume-high -r "$msgId" \
"Volume: ${volume}%" "$(getProgressString 10 "<b> </b>" " " $volume)"
fi
# Play the volume changed sound
canberra-gtk-play -i audio-volume-change -d "changeVolume"
getProgressString needs
to be some function assembling the progressbar like string. This script uses [3].
Now simply bind changeVolume 2dB+ unmute
etc. to some hotkey and you are done. You might also want to make dunst ignore these type of notifications in its history. See #Modifying.