How to automatically switch sound output to Bluetooth headphones?

Might not be your final goal, but as a workaround, you could use a little app called Sound Switcher Indicator.

Sound Switcher Indicator is a sound input/output selector Ubuntu AppIndicator. It allows switching the current sound input and output (source and sink) as well as the specific output port with just two clicks.

Install Sound Switcher Indicator in Ubuntu

Sound Switcher Indicator is currently available in a PPA for Ubuntu users. Add the PPA and install it using the following command:

sudo apt-add-repository ppa:yktooo/ppa
sudo apt-get update
sudo apt-get install indicator-sound-switcher

Refered article: http://www.webupd8.org/2014/02/sound-switcher-ubuntu-indicator.html


This is also not fully automatic, but at least more convenient: If you are using gnome, this extension does its job quite well Sound Output Device Chooser