-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvol
executable file
·36 lines (34 loc) · 815 Bytes
/
vol
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
#!/bin/sh -e
if [ -x /bin/pamixer ]; then
if [ "$1" = "-s" ] || [ "$1" = "s" ]; then
shift
set -- --set-volume "$@"
fi
exec pamixer "$@"
fi
ALSA_DEVICE=${ALSA_DEVICE:-"SoftVol Playback Device"}
if [ "$2" = "--default-source" ]; then
ALSA_DEVICE=Capture
shift
fi
case $1 in
-i|i)
amixer --quiet set "$ALSA_DEVICE" "${2:-1}+"
;;
-d|d)
amixer --quiet set "$ALSA_DEVICE" "${2:-1}-"
;;
-s|s)
amixer --quiet set "$ALSA_DEVICE" "${2:-1}"
;;
-m|m)
amixer --quiet set "$ALSA_DEVICE" mute
;;
-u|u)
amixer --quiet set "$ALSA_DEVICE" unmute
;;
-t|t)
amixer --quiet set "$ALSA_DEVICE" toggle
;;
esac
notify-send -c SOUND -r "$ALSA_DEVICE" "$(amixer get "$ALSA_DEVICE")"