-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvolume_change
executable file
·52 lines (44 loc) · 1 KB
/
volume_change
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# Detects whether Headphones are plugged in and changes the volume accordingly.
if [[ $(grep -c "Pin-ctls: 0x00" "/proc/asound/card0/codec#0") == 1 ]] ; then
case "$1" in
up5)
amixer set Master 5%+
;;
down5)
amixer set Master 5%-
;;
up1)
amixer set Master 1%+
;;
down1)
amixer set Master 1%-
;;
toggle)
amixer set Master toggle
;;
max)
amixer set Master 100%
esac
else
case "$1" in
up5)
amixer set Headphone 5%+
;;
down5)
amixer set Headphone 5%-
;;
up1)
amixer set Headphone 1%+
;;
down1)
amixer set Headphone 1%-
;;
toggle)
amixer set Headphone toggle
;;
max)
amixer set Headphone 100%
esac
fi
kill -36 $(pidof dwmblocks)