-
Notifications
You must be signed in to change notification settings - Fork 9
/
myvol
35 lines (33 loc) · 859 Bytes
/
myvol
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
#! /bin/bash
#
# This script is for adjusting the volume in a finer granularity.
# You can map a hotkey with this script, eg. Shift + VolumeIncrement -> `myvol add`.
# Be sufe to install 'alsa-utils' from Ubuntu apt-get.
showInfo(){
echo "Aliases:"
echo " myvol get = amixer -D pulse sget Master"
echo " myvol set x = amixer -D pulse sset Master x%"
echo " myvol add = amixer -D pulse sset Master 2%+"
echo " myvol sub = amixer -D pulse sset Master 2%-"
}
if [ $# == 0 ]; then
showInfo
else
case $1 in
get)
amixer -D pulse sget Master
;;
set)
amixer -D pulse sset Master $2%
;;
add)
amixer -D pulse sset Master 2%+
;;
sub)
amixer -D pulse sset Master 2%-
;;
*)
showInfo
;;
esac
fi