#!/bin/bash

changevol() {
	howmuch=$1
	for i in $(pacmd list-sinks | grep index | sed -e 's/.*index: \(.*\)/\1/g')
	do
		pacmd set-sink-volume $i  ${howmuch}%
	done
	for i in $(pacmd list-sink-inputs | grep index | sed -e 's/.*index: \(.*\)/\1/g')
	do
		pactl set-sink-input-volume $i  ${howmuch}%
	done
}

case $1 in
	plus)
		changevol +$2
		;;
	minus)
		changevol -$2
		;;
	mute)
		mute
		;;
	*)
		echo "i do nort understand"
esac
