summaryrefslogblamecommitdiffstats
path: root/.bin/ag-audio
blob: 31b0fc3817f21ea632eb5cb98a0961d56a873aa8 (plain) (tree)
1
2
3
4
5
6
7
8


              
                                                         


              
                                                         


                
                                                     


            
                                                 





































                                 





                                                                
                     
#!/bin/sh

__increase() {
	pactl set-sink-volume @DEFAULT_SINK@ "+${1:-10}%"
}

__decrease() {
	pactl set-sink-volume @DEFAULT_SINK@ "-${1:-10}%"
}

__mic_toggle() {
	pactl set-source-mute @DEFAULT_SOURCE@ toggle
}

__toggle() {
	pactl set-sink-mute @DEFAULT_SINK@ toggle
}

__next() {
	cmus-remote -n
}

__prev() {
	cmus-remote -r
}

__play() {
	cmus-remote -u
}

case "${1}" in
	i*)
		__increase "${2}"
		;;
	d*)
		__decrease "${2}"
		;;
	mic-t*)
		__mic_toggle
		;;
	t*)
		__toggle
		;;
	n*)
		__next
		;;
	pr*)
		__prev
		;;
	pl*)
		__play
		;;
esac

pactl get-source-mute @DEFAULT_SOURCE@ | grep no >/dev/null 2>&1
echo "${?}" > /sys/class/leds/platform::micmute/brightness

pactl get-sink-mute @DEFAULT_SINK@ | grep no >/dev/null 2>&1
echo "${?}" > /sys/class/leds/platform::mute/brightness

ag-status &>/dev/null
remember that computers suck.