diff options
author | zachir <zachir@librem.one> | 2021-01-31 21:44:39 -0600 |
---|---|---|
committer | zachir <zachir@librem.one> | 2021-01-31 21:44:39 -0600 |
commit | 92658f4726ad66ee5b7fde010bfb7750c530d0f3 (patch) | |
tree | 129e11b8b69a291e6e0a680e8c6ba922675ca876 | |
parent | 2037d63138cbd9f4d2ab9d361efb2d8d66d72c14 (diff) |
Update volsv script
-rw-r--r--[-rwxr-xr-x] | volsv | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -1,4 +1,8 @@ #!/bin/sh +# print error message +printerror () { + echo "$1 is not a recognized command or flag" +} # if pulseaudio pulsesv () { case "$1" in @@ -6,6 +10,8 @@ pulsesv () { "down" | "-d") pamixer -d 5 ;; "toggle" | "-t") pamixer -t ;; "mic" | "-m") pamixer --source 1 -t ;; + "getm" | "-g") ;; + *) printerror "$1" ;; esac } # if alsa @@ -14,7 +20,19 @@ alsasv () { "up" | "-i") amixer sset Master 5%+ ;; "down" | "-d") amixer sset Master 5%- ;; "toggle" | "-t") amixer sset Master toggle ;; + "getm" | "-g") ;; + *) printerror "$1" ;; esac } -# check which it is -[ ! -z $(pgrep pulseaudio) ] && pulsesv $1 || alsasv $1 ; pkill -RTMIN+10 dwmblocks +#Search input for +echo "$@" | grep -q ' *-h *' && echo \ +"Volsv is Free software. You can use it for any purpose, but I make no guerantee about its usability or fitness "\ +"for any particular purpose. You are also free to redistribute, modify, and distribute your modifications to "\ +"volsv. Volsv is distributed under the BSD 3-Clause license to ensure full license compatibility with GNU, "\ +"Linux, and BSD operating systems. A copy of this license is included in the repository." && exit + +for i in $@; do + pgrep -x pulseaudio >/dev/null && pulsesv $1 || alsasv $1 + pgrep -x dwmblocks >/dev/null && pkill -RTMIN+10 dwmblocks + pgrep -x dwmbar >/dev/null && dwmbar-signal volume +done |