From 92658f4726ad66ee5b7fde010bfb7750c530d0f3 Mon Sep 17 00:00:00 2001 From: zachir Date: Sun, 31 Jan 2021 21:44:39 -0600 Subject: Update volsv script --- volsv | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) mode change 100755 => 100644 volsv (limited to 'volsv') diff --git a/volsv b/volsv old mode 100755 new mode 100644 index 9e62a7c..16e3ce2 --- a/volsv +++ b/volsv @@ -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 -- cgit v1.2.3