summaryrefslogtreecommitdiff
path: root/volsv
diff options
context:
space:
mode:
Diffstat (limited to 'volsv')
-rwxr-xr-xvolsv21
1 files changed, 21 insertions, 0 deletions
diff --git a/volsv b/volsv
new file mode 100755
index 0000000..2732a1c
--- /dev/null
+++ b/volsv
@@ -0,0 +1,21 @@
+#!/bin/sh
+# 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 ;;
+ 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 ;;
+ "mic" | "-m") amixer set Capture toggle ;;
+ esac
+}
+# check which it is
+[ ! -z "$(pgrep pulseaudio)" ] && pulsesv $1 || alsasv $1 ; pkill -RTMIN+10 dwmblocks ; touch /tmp/volsv.tmp