When I plug in my TV via HDMI, the sound still outputs to the laptop speakers, and I have to go into settings to switch the output. When I unplug the HDMI connection, there is no sound output and when I go into settings, the output selection is blank and I have to select the built in speakers manually.
Is there a way to have the sound output switch automatically when I plug in and disconnect an HDMI device?
If you don’t want to change things system-wide (which requires super-user), you can have a script running as your own user that will react to device changes. I wrote one myself: auto_configure_upon_usb_device_change.py. I’ve been using it for years, across even distros. Regardless of how its called, it reacts to both USB, Bluetooth and display changes.