clean up volume notification
This commit is contained in:
parent
225886e4b2
commit
888cd2481c
2 changed files with 12 additions and 8 deletions
|
@ -4,6 +4,7 @@
|
||||||
width = 370
|
width = 370
|
||||||
height = 370
|
height = 370
|
||||||
offset = 5x24
|
offset = 5x24
|
||||||
|
gap_size = 4
|
||||||
transparency = 10
|
transparency = 10
|
||||||
font = Monospace 12
|
font = Monospace 12
|
||||||
format = "<b>%s</b>\n%b"
|
format = "<b>%s</b>\n%b"
|
||||||
|
@ -15,11 +16,16 @@
|
||||||
markup = full
|
markup = full
|
||||||
icon_theme = Qogir-dark
|
icon_theme = Qogir-dark
|
||||||
icon_path = /usr/share/icons/Qogir-dark/16/panel/
|
icon_path = /usr/share/icons/Qogir-dark/16/panel/
|
||||||
|
dmenu = /usr/local/bin/dmenu -p dunst
|
||||||
|
mouse_left = context
|
||||||
|
middle = close_all
|
||||||
|
mouse_right = close_current
|
||||||
|
|
||||||
[urgency_low]
|
[urgency_low]
|
||||||
background = "#1a1b26"
|
background = "#1a1b26"
|
||||||
foreground = "#c0caf5"
|
foreground = "#c0caf5"
|
||||||
highlight = "#7aa2f7"
|
highlight = "#7aa2f7"
|
||||||
|
history_ignore = true
|
||||||
timeout = 3
|
timeout = 3
|
||||||
|
|
||||||
[urgency_normal]
|
[urgency_normal]
|
||||||
|
|
|
@ -9,11 +9,7 @@ pamixer "$@" >/dev/null
|
||||||
# Query amixer for the current volume and whether or not the speaker is muted
|
# Query amixer for the current volume and whether or not the speaker is muted
|
||||||
volume="$(pamixer --get-volume)"
|
volume="$(pamixer --get-volume)"
|
||||||
|
|
||||||
if [ "$volume" -gt "100" ]; then
|
[ "$volume" -gt "100" ] && highlight="#ff768e" || highlight="#7aa2f7"
|
||||||
urgency="critical"
|
|
||||||
else
|
|
||||||
urgency="low"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$volume" -gt "70" ]; then
|
if [ "$volume" -gt "70" ]; then
|
||||||
icon="audio-volume-high"
|
icon="audio-volume-high"
|
||||||
|
@ -25,10 +21,12 @@ fi
|
||||||
|
|
||||||
mute="$(pamixer --get-mute)"
|
mute="$(pamixer --get-mute)"
|
||||||
if [ "$volume" = 0 ] || [ "$mute" = "true" ]; then
|
if [ "$volume" = 0 ] || [ "$mute" = "true" ]; then
|
||||||
notify-send -a "changeVolume" -i "audio-volume-muted" -u $urgency -h string:x-dunst-stack-tag:$msgTag "Volume muted"
|
notify-send -a "changeVolume" -i "audio-volume-muted" -u low -h string:x-dunst-stack-tag:$msgTag "Volume muted"
|
||||||
else
|
else
|
||||||
notify-send -a "changeVolume" -i "$icon" -u $urgency -h string:x-dunst-stack-tag:$msgTag \
|
notify-send -a "changeVolume" -i "$icon" -u low "Volume: ${volume}%"\
|
||||||
-h int:value:"$volume" "Volume: ${volume}%"
|
-h string:x-dunst-stack-tag:$msgTag \
|
||||||
|
-h int:value:$volume \
|
||||||
|
-h string:hlcolor:$highlight
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Play the volume changed sound
|
# Play the volume changed sound
|
||||||
|
|
Loading…
Add table
Reference in a new issue