clean up pamixer-notify
This commit is contained in:
parent
836ac89559
commit
46c3964aee
|
@ -1,16 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Arbitrary but unique message tag
|
||||
msgTag="volume"
|
||||
|
||||
# Change the volume using alsa(might differ if you use pulseaudio)
|
||||
pamixer "$@" >/dev/null
|
||||
|
||||
# Query amixer for the current volume and whether or not the speaker is muted
|
||||
msgTag="volume" # Arbitrary but unique message tag
|
||||
volume="$(pamixer --get-volume)"
|
||||
|
||||
mute="$(pamixer --get-mute)"
|
||||
[ "$volume" -gt "100" ] && highlight="#ff768e" || highlight="#7aa2f7"
|
||||
|
||||
[ "$volume" -gt "100" ] &&
|
||||
highlight="#ff768e" ||
|
||||
highlight="#7aa2f7"
|
||||
|
||||
if [ "$mute" = "true" ]; then
|
||||
icon="audio-volume-muted"
|
||||
|
@ -27,5 +25,4 @@ notify-send -a "changeVolume" -i "$icon" -u low "Volume: ${volume}%" \
|
|||
-h int:value:$volume \
|
||||
-h string:hlcolor:$highlight
|
||||
|
||||
# Play the volume changed sound
|
||||
canberra-gtk-play -i audio-volume-change -d "changeVolume"
|
||||
|
|
Loading…
Reference in New Issue