1
0
Fork 0
dotfiles/.local/bin/pamixer-notify

29 lines
688 B
Plaintext
Raw Normal View History

2023-02-07 17:19:53 +01:00
#!/bin/sh
2023-02-06 22:51:45 +01:00
2023-02-07 17:19:53 +01:00
pamixer "$@" >/dev/null
2023-02-06 22:51:45 +01:00
2023-03-28 18:46:48 +02:00
msgTag="volume" # Arbitrary but unique message tag
2023-02-06 22:51:45 +01:00
volume="$(pamixer --get-volume)"
2023-03-20 10:15:16 +01:00
mute="$(pamixer --get-mute)"
2023-03-28 18:46:48 +02:00
[ "$volume" -gt "100" ] &&
highlight="#ff768e" ||
highlight="#7aa2f7"
2023-02-06 22:51:45 +01:00
2023-03-20 10:15:16 +01:00
if [ "$mute" = "true" ]; then
icon="audio-volume-muted"
elif [ "$volume" -gt "70" ]; then
2023-02-06 22:51:45 +01:00
icon="audio-volume-high"
elif [ "$volume" -gt "30" ]; then
icon="audio-volume-medium"
2023-03-20 10:15:16 +01:00
elif [ "$volume" -ge "0" ]; then
2023-02-06 22:51:45 +01:00
icon="audio-volume-low"
fi
2023-03-20 10:15:16 +01:00
notify-send -a "changeVolume" -i "$icon" -u low "Volume: ${volume}%" \
-h string:x-dunst-stack-tag:$msgTag \
-h int:value:$volume \
-h string:hlcolor:$highlight
2023-02-06 22:51:45 +01:00
canberra-gtk-play -i audio-volume-change -d "changeVolume"