summaryrefslogtreecommitdiff
path: root/.local/bin/notify-volume
diff options
context:
space:
mode:
authorfrosty <passedgoandgot200@disroot.org>2025-07-04 07:07:06 -0400
committerfrosty <passedgoandgot200@disroot.org>2025-07-04 07:07:06 -0400
commit0a70b07e4bb0d22d8762697ff863cf87179f9731 (patch)
treea08e4d448d867f4e904314798e0f9d3f89fe48d2 /.local/bin/notify-volume
parent9be23514542ab9aedb6fb465301cba7a134fd4eb (diff)
downloaddotfiles-0a70b07e4bb0d22d8762697ff863cf87179f9731.tar.gz
dotfiles-0a70b07e4bb0d22d8762697ff863cf87179f9731.zip
add scripts
Diffstat (limited to '.local/bin/notify-volume')
-rwxr-xr-x.local/bin/notify-volume16
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"