From 45ce4594aaae8a7e1ba1cc509293b5d04aede1c0 Mon Sep 17 00:00:00 2001 From: funman300 Date: Mon, 11 May 2026 11:18:22 -0700 Subject: [PATCH] volume: add notification wrapper script Co-Authored-By: Claude Sonnet 4.6 --- install.sh | 1 + scripts/volume.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100755 scripts/volume.sh diff --git a/install.sh b/install.sh index 5ac96bf..4bcf791 100755 --- a/install.sh +++ b/install.sh @@ -59,6 +59,7 @@ ln -sf "$(pwd)/scripts/power-profile.sh" ~/.local/bin/power-profile ln -sf "$(pwd)/scripts/fan-profile.sh" ~/.local/bin/fan-profile ln -sf "$(pwd)/scripts/waybar-restart.sh" ~/.local/bin/waybar-restart ln -sf "$(pwd)/scripts/screenshot.sh" ~/.local/bin/screenshot +ln -sf "$(pwd)/scripts/volume.sh" ~/.local/bin/volume echo "==> Enabling systemd user services" mkdir -p ~/.config/systemd/user diff --git a/scripts/volume.sh b/scripts/volume.sh new file mode 100755 index 0000000..8e4d9c7 --- /dev/null +++ b/scripts/volume.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +case "${1:-}" in + up) pamixer -i 5 ;; + down) pamixer -d 5 ;; + mute) pamixer -t ;; + *) echo "usage: $0 up|down|mute" >&2; exit 1 ;; +esac + +if [ "$(pamixer --get-mute)" = "true" ]; then + notify-send -h string:x-canonical-private-synchronous:volume \ + -h int:value:0 \ + -t 1500 \ + "Muted" +else + LEVEL=$(pamixer --get-volume) + notify-send -h string:x-canonical-private-synchronous:volume \ + -h int:value:"$LEVEL" \ + -t 1500 \ + "Volume: ${LEVEL}%" +fi