Browse Source

alsamixer for vol

Cullum Smith 2 years ago
parent
commit
12300d291e
1 changed files with 20 additions and 7 deletions
  1. 20
    7
      bin/bin/vol

+ 20
- 7
bin/bin/vol View File

@@ -1,18 +1,29 @@
1 1
 #!/bin/sh
2 2
 
3 3
 usage() {
4
-  >&2 echo "usage: $(basename $0) up|down|mute"
4
+  >&2 echo "usage: $(basename $0) up|down|mute|micmute"
5 5
   exit 1
6 6
 }
7 7
 
8 8
 case "$(uname)" in
9 9
   Linux)
10
-    case "$1" in
11
-      up)   pactl set-sink-volume @DEFAULT_SINK@ +5%    ;;
12
-      down) pactl set-sink-volume @DEFAULT_SINK@ -5%    ;;
13
-      mute) pactl set-sink-mute   @DEFAULT_SINK@ toggle ;;
14
-      *)    usage
15
-    esac ;;
10
+    if pgrep pusleaudio > /dev/null ; then
11
+      case "$1" in
12
+        up)      pactl set-sink-volume @DEFAULT_SINK@ +5%    ;;
13
+        down)    pactl set-sink-volume @DEFAULT_SINK@ -5%    ;;
14
+        mute)    pactl set-sink-mute   @DEFAULT_SINK@ toggle ;;
15
+        *) usage
16
+      esac 
17
+    else
18
+      case "$1" in
19
+        up)      amixer set Master 5%+     ;;
20
+        down)    amixer set Master 5%-     ;;
21
+        mute)    amixer set Master toggle  ;;
22
+        micmute) amixer set Capture toggle ;;
23
+        *) usage
24
+      esac
25
+    fi
26
+  ;;
16 27
   OpenBSD)
17 28
     case "$1" in
18 29
       up)   mixerctl outputs.master=+12         ;;
@@ -23,3 +34,5 @@ case "$(uname)" in
23 34
   *)
24 35
     >&2 echo "don't know how to change volume on $(uname)"
25 36
 esac
37
+
38
+pkill -SIGUSR1 i3status

Loading…
Cancel
Save