diff options
author | zachir <zachir@librem.one> | 2022-10-09 01:25:20 -0500 |
---|---|---|
committer | zachir <zachir@librem.one> | 2022-10-09 01:25:20 -0500 |
commit | 91e4799fedf9dbff384003b8c2eaea039cb57327 (patch) | |
tree | f7b017919dbce7a69ac28e3388371ad1fc8ca6d9 /volume |
initialize repo
Diffstat (limited to 'volume')
-rwxr-xr-x | volume | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -0,0 +1,23 @@ +#!/sbin/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 "[%s]" "$vol" |