#!/bin/bash

fuck(){
cunt="$@"
ar=()
lol=""
for i in $(seq 1 ${#cunt})
do
	if [ "${cunt:i-1:1}" = '\n' ] ||  [ "${cunt:i-1:1}" = " " ] || [ $i -eq ${#cunt} ] 
	then

		if [ $i -eq ${#cunt} ]	
		then
			
			lol=$lol${cunt:$i-1:1}	
		fi
		ar[${#ar[@]}]=$lol'\n';
		lol=""
	else

		lol=$lol${cunt:$i-1:1}	
	fi
done


}

#IFS=' '
inp=$(pactl list sinks| grep Name | sed 's/\tName: //g')
outputDevices=()
fuck $inp 
outputApps=$(pactl list sink-inputs | grep Sink | sed 's/Sink Input # //g')
choice=$(echo -e ${ar[*]} | dmenu -p "Which output ya dick ?")
choice=$(echo $choice | sed 's/ //g')
pactl set-default-sink $choice



for i in ${outputApps[*]}
do 
	
	pactl move-sink-input $i  $choice
done

