From 9b19480228d8421c3987a634a602012c953a993e Mon Sep 17 00:00:00 2001 From: neodarz Date: Thu, 5 Sep 2019 07:48:16 +0200 Subject: Add some scripts --- dotfiles/scripts/switch_audio.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 dotfiles/scripts/switch_audio.sh (limited to 'dotfiles/scripts/switch_audio.sh') diff --git a/dotfiles/scripts/switch_audio.sh b/dotfiles/scripts/switch_audio.sh new file mode 100755 index 0000000..aff2543 --- /dev/null +++ b/dotfiles/scripts/switch_audio.sh @@ -0,0 +1,16 @@ +#/bin/sh + +# Usage : +# switch_audio.sh + +headphones="analog-output-headphones" +lineout="analog-output-lineout" +sinkport="$1" + +if [[ $(echo $(pacmd list | grep "active port") | cut -d" " -f3 | cut -d"<" -f2 | cut -d">" -f1) == $lineout ]] +then + pacmd set-sink-port $sinkport $headphones + elif [[ $(echo $(pacmd list | grep "active port") | cut -d" " -f3 | cut -d"<" -f2 | cut -d">" -f1) == $headphones ]] + then + pacmd set-sink-port $sinkport $lineout + fi -- cgit v1.2.1