Linux Shut down laptop when disconnected from power
#1
Hi,

I recently installed XBMCbuntu Release 11 and managed to get everything working thanks to this forum. The only question I have is if it would be possible to shutdown XBMCbuntu when my laptop is disconnected from it's charger, that would be very usefull since the power to the laptop is shut off the moment the TV is powered off. Does anyone have any ideas to do this in either XBMC itself or Ubuntu?

Thanks in advance
Reply
#2
It may not work with a laptop as they dont tent to have serial ports.

If you have a serial port on your TV, it may be marked RS232 or "Control" then you should be able to hook up your computer to it and send commands over the serial interface and control the TV. If your TV has a command that you can poll that can feedback its state on/off then you should be able to script something that will poll your TV every 5 mins asking if it is on or off.

If the TV is off or doesn't respond to the poll signal then you could initiate a shutdown.

At work we have room control systems that work in a similar way, except you press the shutdown button on the control pannel and it sends the power off command to all devices that are connected to the control system processor.

HTPC
XBMC v12 RC3 with myth TV backend || AMD Sempron 145 || 1gb DDR3 || ECS MCP61M-M3 Version 3 ( no core unlocker) || TBS6981 DVB-S2 tuner || ATI Radeon HD 5450 || 32gb Crucial SSD

NAS
IB-NAS4220-B HW revision 1.2 || 2x 1TB HDD RAID 1 || Open WRT firmware.
Reply
#3
Thanks for your reply warrmr, but i was thinking if it wouldn't possible to shutdown or hibernate my notebook the moment it get's disconnected from the A/C charger, it must be logged somewhere in linux if the battery stops charging or something.
Reply
#4
Code:
nick@envy ~ $ cat /proc/acpi/ac_adapter/AC/state
state:                   on-line
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply

Logout Mark Read Team Forum Stats Members Help
Shut down laptop when disconnected from power0