blob: 5ce68481c7185cb1f81507339b59ee0df1b75926 (
plain)
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
|
#!/bin/sh
. "lib_common.sh"
. "lib_handle.sh"
help() {
cat << EOF
${0}: Change volume
options:
-i [Vol] Increase volume by Vol
-d [Vol] Decrease volume by Vol
-s [Vol] Set volume to Vol
-p Show the current volume
-t Toggle between mute and unmute
-h Print this message and exit
EOF
exit 0
}
volume_handle check_program
[ $# != 1 ] && [ $# != 2 ] && invalid_use
while getopts "i:d:s:pth" option; do
case "${option}" in
i) run --reload-status "volume_handle up ${OPTARG}" ;;
d) run --reload-status "volume_handle down ${OPTARG}" ;;
s) run --reload-status "volume_handle set ${OPTARG}" ;;
t) run --reload-status "volume_handle toggle" ;;
p) volume_handle get-current ;;
h) help ;;
*) invalid_use -h ;;
esac
done
invalid_use
|