summaryrefslogblamecommitdiffstats
path: root/.bin/ag-audio
blob: c39fd61a95cc04e9f17b9f3468da01eb3a4da52a (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
	pactl get-source-mute @DEFAULT_SOURCE@ | grep no >/dev/null 2>&1
	echo "${?}" > /sys/class/leds/platform::micmute/brightness
}

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

__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

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