diff options
Diffstat (limited to '.local/bin/notify-volume')
-rwxr-xr-x | .local/bin/notify-volume | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/.local/bin/notify-volume b/.local/bin/notify-volume new file mode 100755 index 0000000..4c9b753 --- /dev/null +++ b/.local/bin/notify-volume @@ -0,0 +1,16 @@ +#!/bin/sh + +set -eu + +AUDIO_SINK="@DEFAULT_AUDIO_SINK@" + +volume=$(wpctl get-volume "$AUDIO_SINK") +case "$volume" in *MUTED*) muted=1; volume=${volume% \[MUTED\]} ;; *) muted=0 ;; esac +volume=${volume#Volume: } +volume=${volume%.*}${volume#*.} +volume=${volume#0} +volume=${volume#0} +display="$volume%" +[ "$muted" -eq 1 ] && display="$display (Muted)" + +notify-send -c osd -h int:value:"$volume" -h string:x-dunst-stack-tag:"$0_$AUDIO_SINK" "Volume" "$display" |