I had originally considered charging the phone from the TV's USB port, but that resulted in some nasty noise from the TV when displaying the N900's output; some sort of interference with the audio line for some reason. Then I remembered that about 5 years ago I had acquired an energy saving plug that was being given away by a newspaper in conjunction with a power company; it's designed to kill power to peripherals (monitor, printer etc for PB, DVD player or similar for TV) when the main device powers down. With the N900 charging from that, a script detecting charger state could toggle not only TV-Out, but also bluetooth and until I come up with a reason for it to be online all the time, wi-fi. .
SCRIPT * * com.nokia.bme.signal charger_connected
#!/bin/sh #Check if TV out is attached: video_cable=$(lshal | grep 'line-out.*video-out') if [[ "$video_cable" != "" ]]; then #Switch to "Today Screen" of desktop gconftool-2 -s /apps/osso/hildon-desktop/views/current -t int 1 #Fire up Bluetooth run-standalone.sh dbus-send --system --type=method_call --dest=org.bluez $(dbus-send --system --print-reply --dest=org.bluez / org.bluez.Manager.DefaultAdapter | awk -F'"' '/at/ {print $2}') org.bluez.Adapter.SetProperty string:Powered variant:boolean:true fi