Is it possible to setup auto-detection of HDMI?

Right now when I plug my HDTV into my laptop's HDMI input I have to run 'xrandr' for it to recognize the display and then manually switch the audio hardware selection.

Is there a way that Ubuntu can detect when the HDMI is plugged in and invoke a script that calls xrandr and switches the hardware and then does likewise when disconnected?


Solution 1:

It is possible, some Linux graphics drivers have HDMI hot-plug events, some require special options to be enabled for them to fire. Graphics driver developers though haven't been focusing much time on the functionality so I don't know if it will work for your brand of graphics card:

RadeonHD details: http://wiki.x.org/wiki/radeonhd