#!/bin/bash


currentport=$(pacmd list-sinks | grep -Po "active port:.*")

if [[ -n "$button" ]]
then
	if [[ "$currentport" == "active port: <analog-output-lineout>" ]]
	then
		pacmd set-sink-port "alsa_output.pci-0000_0b_00.3.analog-stereo" "analog-output-headphones"
		echo "head"
	else
		pacmd set-sink-port "alsa_output.pci-0000_0b_00.3.analog-stereo" "analog-output-lineout"
		echo "line"
	fi
	pkill -RTMIN+10 i3blocks
else
	if [[ "$currentport" == "active port: <analog-output-lineout>" ]]
	then
		echo "line"
	else
		echo "head"
	fi
fi
