diff options
author | ZachIR <zachir@librem.one> | 2025-08-09 08:45:39 -0500 |
---|---|---|
committer | ZachIR <zachir@librem.one> | 2025-08-09 08:45:39 -0500 |
commit | 722364ceebdbb709c8469249f6fd53037a5fe30b (patch) | |
tree | f8c8a099117c301e28ac4fe6f067eb34d895e642 /sb-volume | |
parent | 746ef9801cb5da6f29ddb11707aad3f414e3fde2 (diff) |
Diffstat (limited to 'sb-volume')
-rwxr-xr-x | sb-volume | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/sb-volume b/sb-volume new file mode 100755 index 0000000..03c9e0b --- /dev/null +++ b/sb-volume @@ -0,0 +1,23 @@ +#!/bin/sh + +case $BLOCK_BUTTON in + 1) + pgrep -x pipewire >/dev/null && MIXER="pulsemixer" || \ + pgrep -x pulseaudio >/dev/null && MIXER="pulsemixer" || \ + MIXER="alsamixer" + setsid -f $TERMINAL -e $MIXER + ;; + 2) notify-send "Volume module" "\- Shows volume, X if muted. +- Middle click to show this message. +- Right click to mute. +- Scroll to change." ;; + 3) volsv -t ;; + 4) volsv -i ;; + 5) volsv -d ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac +volstat="$(volsv -v)" +mutstat="$(volsv -g)" +echo "$mutstat" | grep -q "off" && printf "[X]" && exit +vol="$(echo "$volstat" | grep '[0-9]\+%' | sed "s,.* \([0-9]\+\)%.*,\1,;1q")" +printf "[%4s]" "$vol" |