summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2021-08-18 19:26:52 -0500
committerzachir <zachir@librem.one>2021-08-18 19:26:52 -0500
commita9a6a910ca2a50ac36b35503af53e461d28962d7 (patch)
treeaed2911645ffd352b426a8c3c5c739d09f17ed0d
parent65b9133de8371312c956ab5bc4484d033c56ebab (diff)
Remove volsv (managed separately)
-rwxr-xr-xvolsv91
1 files changed, 0 insertions, 91 deletions
diff --git a/volsv b/volsv
deleted file mode 100755
index 7699982..0000000
--- a/volsv
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh
-# print error message
-printerror () {
- echo "$1 is not a recognized command or flag"
-}
-# if sndio
-sndiosv () {
- case "$1" in
- "up" | "-i") sndioctl output.level=+0.05 ;;
- "down" | "-d") sndioctl output.level=-0.05 ;;
- "toggle" | "-t") sndioctl output.mute=! ;;
- "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]/' ;;
- *) printerror "$1" ;;
- esac
-}
-# if pulseaudio
-pulsesv () {
- case "$1" in
- "up" | "-i") pamixer -i 5 ;;
- "down" | "-d") pamixer -d 5 ;;
- "toggle" | "-t") pamixer -t ;;
- "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\]/' ;;
- *) printerror "$1" ;;
- esac
-}
-# if alsa
-alsasv () {
- DEVICE=`pgrep -x bluealsa >/dev/null && echo -n "bluealsa"`
- if [ -z "$DEVICE" ]; then
- case "$1" in
- "up" | "-i") amixer sset Master 5%+ ;;
- "down" | "-d") amixer sset Master 5%- ;;
- "toggle" | "-t") amixer sset Master toggle ;;
- "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 ;;
- *) printerror "$1" ;;
- esac
- elif [ -z `amixer -D $DEVICE controls` ]; then
- case "$1" in
- "up" | "-i") amixer sset Master 5%+ ;;
- "down" | "-d") amixer sset Master 5%- ;;
- "toggle" | "-t") amixer sset Master toggle ;;
- "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 ;;
- *) printerror "$1" ;;
- esac
- else
- MIXER=`amixer -D $DEVICE | grep 'A2DP' | cut -d"'" -f2`
- case "$1" in
- "up" | "-i") amixer -D "$DEVICE" sset "$MIXER" 5%+ ;;
- "down" | "-d") amixer -D "$DEVICE" sset "$MIXER" 5%- ;;
- "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 ;;
- *) printerror "$1" ;;
- esac
- fi
-}
-#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.\n\n"\
-"Volsv is a script designed to control the volume of a *NIX machine. The commands/flags are as follows:
-increase volume: 'up' or '-i'
-decrease volume: 'down' or '-d'
-toggle volume mute: 'toggle' or '-t'
-toggle mic mute: 'mic' or '-m'
-get volume level: 'getv' or '-v'
-get mute state: 'getm' or '-g'" && exit
-
-for i in $@; do
- if pgrep -x pulseaudio >/dev/null; then
- pulsesv $i
- elif pgrep -x pipewire >/dev/null; then
- pulsesv $i
- elif pgrep -x sndiod >/dev/null; then
- sndiosv $i
- else
- alsasv $i
- fi
- pgrep -x dwmblocks >/dev/null && pkill -RTMIN+13 dwmblocks
- #pgrep -x dwmbar >/dev/null && dwmbar-signal volume
-done