summaryrefslogtreecommitdiff
path: root/volsv
diff options
context:
space:
mode:
Diffstat (limited to 'volsv')
-rwxr-xr-xvolsv38
1 files changed, 38 insertions, 0 deletions
diff --git a/volsv b/volsv
new file mode 100755
index 0000000..16e3ce2
--- /dev/null
+++ b/volsv
@@ -0,0 +1,38 @@
+#!/bin/sh
+# print error message
+printerror () {
+ echo "$1 is not a recognized command or flag"
+}
+# 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 ;;
+ "getm" | "-g") ;;
+ *) printerror "$1" ;;
+ esac
+}
+# if alsa
+alsasv () {
+ case "$1" in
+ "up" | "-i") amixer sset Master 5%+ ;;
+ "down" | "-d") amixer sset Master 5%- ;;
+ "toggle" | "-t") amixer sset Master toggle ;;
+ "getm" | "-g") ;;
+ *) printerror "$1" ;;
+ esac
+}
+#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