I want to achieve the following behavior for my audio outputs:
- if HDMI is connected use it as audio output device
- else if headphones are connected use them as output device
- else use built-in speakers
I already used this answer https://askubuntu.com/a/1207638/664571 to set HDMI as default audio output on system boot. Now I have the problem that whenever headphones are connected the audio output switches to them. So, headphones have higher priority than HDMI.
Is there any way to change the priority in the described way?