#!/bin/bash # Execute the initial command and capture the output sink_output=$(pacmd list-sinks | awk '/\*/ {getline; print $2}') # Check the output and set the default sink accordingly if [ "$sink_output" == "" ]; then pacmd set-default-sink 0 echo "Default sink set to 0" elif [ "$sink_output" == "" ]; then pacmd set-default-sink 1 echo "Default sink set to 1" else echo "Unknown sink output: $sink_output" fi