summaryrefslogtreecommitdiffstats
path: root/.local/bin/lmc
blob: 6d64b649f9e2e8a5107b5bb7e09fe155cba24fc9 (plain) (blame)
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
#!/bin/sh

NUM="${2:-5}"

# Uncomment the following line to use Pulseaudio.
# PULSE=true

if [ "$PULSE" ]; then
	toggle() { pulsemixer --toggle-mute ;}
	mute() { pulsemixer --mute ;}
	up() { pulsemixer --change-volume +"$NUM" ;}
	down() { pulsemixer --change-volume -"$NUM" ;}
	control() { pulsemixer ;}
else
	toggle() { amixer sset Master toggle ;}
	mute() { amixer sset Master mute ;}
	up() { amixer sset Master "$NUM"%+ ;}
	down() { amixer sset Master "$NUM"%- ;}
	control() { alsamixer ;}
fi

case "$1" in
	toggle) toggle ;;
	mute) mute ;;
	up) up ;;
	down) down ;;
	control) control ;;
esac

pkill -RTMIN+10 "${STATUSBAR:?}" &