Add notify-on-volume script for dunst volume notifications

This commit is contained in:
2021-10-19 22:14:46 +03:00
parent eda5f226f3
commit a0eed7adfa
3 changed files with 23 additions and 2 deletions

17
bin/notify-on-volume Executable file
View File

@@ -0,0 +1,17 @@
#! /bin/bash
msgId="991049"
volume=$(pamixer --get-volume)
mute=$(pamixer --get-mute)
if [[ $volume == 0 || "$mute" == "true" ]]; then
# Show the sound muted notification
dunstify -a "notify-on-volume" -u low -i audio-volume-muted -r "$msgId" "Volume muted"
else
# Show the volume notification
dunstify -a "notify-on-volume" -u low -i audio-volume-high -r "$msgId" \
-h int:value:"$volume" "Volume: ${volume}%"
fi
canberra-gtk-play -i audio-volume-change -d "notify-on-volume"