I'm using Ubuntu for an HTPC and I wanted to kill a bunch of processes like the browser when the TV is turned off. This is because I have limited bandwidth and want to avoid chance of streaming content while TV is off, wasting bandwidth.
My solution was to have a cron task run every minute checking for off state. But I'm don't know how to detect HDMI disconnect/TV off.
I've been using this fix: HDMI Audio stops after TV turned off for HDMI sound fix when TV turns off. So I could modify the code such that when ELD_valid switches from 1 to 0, it's time to kill stuff. But I believe it's monitoring sound status over HDMI? Also it seems like a bug fix, so my script would work as long as bug is present?
xrandr looked promising but you have to run it as user connected to a display. So I couldn't test what output it gives when TV is off from an ssh connection.
HDMI CEC codes seemed like another solution but you have to buy an adapter and my TV doesn't support CEC.
Any suggestions? Thanks.
P.S. I'm using ATI catalyst drivers. I'd be happy with ATI specific solution.