diff options
author | zachir <zachir@librem.one> | 2022-08-11 22:06:56 -0500 |
---|---|---|
committer | zachir <zachir@librem.one> | 2022-08-11 22:06:56 -0500 |
commit | 624309426bb13528c2a904180aec334cfdecbf4c (patch) | |
tree | adfa6afe2142b2939a3aaa89ad814f1a3afa91c5 | |
parent | 0a7f34d9fe5afcfcfa5c18e11cb32314b1927313 (diff) | |
parent | 95f08340df933784005b329b7e703096123916f0 (diff) |
merge volsv
-rwxr-xr-x | volsv | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -12,6 +12,7 @@ sndiosv () { "mic" | "-m") sndioctl input.mute=! ;; "getv" | "-v") printf "%s%%" `sndioctl output.level | rev | cut -d'.' -f1 | rev | cut -c 1,2` ;; "getm" | "-g") sndioctl output.mute | cut -d'=' -f2 | sed 's/1/[off]/;s/0/[on]/' ;; + "getvm" | "-vg") printf "%s%s%%" `sndioctl output.mute | cut -d'=' -f2 | sed 's/1/[off]/;s/0/[on]/'` `sndioctl output.level | rev | cut -d'.' -f1 | rev | cut -c 1,2` ;; *) printerror "$1" ;; esac } @@ -24,6 +25,7 @@ pulsesv () { "mic" | "-m") pamixer --source 1 -t ;; "getv" | "-v") printf "%s%%\n" "$(pamixer --get-volume)" ;; "getm" | "-g") pamixer --get-mute | sed 's/[Ff]alse/\[on\]/;s/[Tt]rue/\[off\]/' ;; + "getvm" | "-vg") printf "%s%s%%\n" `pamixer --get-mute | sed 's/[Ff]alse/\[on\]/;s/[Tt]rue/\[off\]/'` "$(pamixer --get-volume)" ;; *) printerror "$1" ;; esac } @@ -38,6 +40,7 @@ alsasv () { "mic" | "-m") amixer sset Capture toggle ;; "getv" | "-v") amixer sget Master | grep '\[[0-9]*\%\]' | sed "s/ /\n/g" | grep '%' | sed 's/\[//;s/\]//g' ;; "getm" | "-g") amixer sget Master | grep '\[o[fn]' | cut -d' ' -f8 | head -1 ;; + "getvm" | "-vg") printf "%s%s" `amixer sget Master | grep '\[o[fn]' | cut -d' ' -f8 | head -1` `amixer sget Master | grep '\[[0-9]*\%\]' | sed "s/ /\n/g" | grep '%' | sed 's/\[//;s/\]//g'` ;; *) printerror "$1" ;; esac elif [ -z `amixer -D $DEVICE controls` ]; then @@ -48,6 +51,7 @@ alsasv () { "mic" | "-m") amixer sset Capture toggle ;; "getv" | "-v") amixer sget Master | grep '\[[0-9]*\%\]' | sed "s/ /\n/g" | grep '%' | sed 's/\[//;s/\]//g' ;; "getm" | "-g") amixer sget Master | grep '\[o[fn]' | cut -d' ' -f8 | head -1 ;; + "getvm" | "-vg") printf "%s%s" `amixer sget Master | grep '\[o[fn]' | cut -d' ' -f8 | head -1` `amixer sget Master | grep '\[[0-9]*\%\]' | sed "s/ /\n/g" | grep '%' | sed 's/\[//;s/\]//g'` ;; *) printerror "$1" ;; esac else @@ -58,6 +62,7 @@ alsasv () { "toggle" | "-t") amixer -D "$DEVICE" sset "$MIXER" toggle ;; "getv" | "-v") amixer -D "$DEVICE" sget "$MIXER" | grep '\[[0-9]*\%\]' | sed "s/ /\n/g" | grep '%' | sed 's/\[//;s/\]//g' | head -1;; "getm" | "-g") amixer -D "$DEVICE" sget "$MIXER" | grep '\[o[fn]' | cut -d' ' -f9 | head -1 ;; + "getvm" | "-vg") printf "%s%s" `amixer -D "$DEVICE" sget "$MIXER" | grep '\[o[fn]' | cut -d' ' -f9 | head -1` `amixer -D "$DEVICE" sget "$MIXER" | grep '\[[0-9]*\%\]' | sed "s/ /\n/g" | grep '%' | sed 's/\[//;s/\]//g' | head -1` ;; *) printerror "$1" ;; esac fi @@ -86,6 +91,6 @@ for i in $@; do else alsasv $i fi - pgrep -x dwmblocks >/dev/null && pkill -RTMIN+10 dwmblocks + pgrep -x dwmblocks >/dev/null && sigdwmb volume #pgrep -x dwmbar >/dev/null && dwmbar-signal volume done |