Hardware Power Button Function: Sleep
#1
Star 
I wanted to change the button on the front of the box to sleep instead of shutdown. There appears to be no hook into the hardware button inside XBMC (why this thread didn't solve my problem). Took some poking around and it was really easy via SSH to change how Ubuntu/XBMC Live handles the button.

To change the hardware power button function in Ubuntu/XBMC Live when not using a window manager:

1. SSH to the box
2. Backup the button script:
Code:
sudo cp /etc/acpi/powerbtn.sh /etc/acpi/powerbtn.sh.BAK
3. Edit the button script:
Code:
sudo pico /etc/acpi/powerbtn.sh
4. Modify the last line with a "#" in front, and add the following line so it appears as this:
Code:
# If all else failed, just initiate a plain shutdown.
#/sbin/shutdown -h now "Power button pressed"
/etc/acpi/sleep.sh

My box uses 5watts in sleep, and 5watts when powered off Oo And on top of that it takes almost 2 minutes to cold boot off flash drive, sleep is way better.
Reply

Logout Mark Read Team Forum Stats Members Help
Hardware Power Button Function: Sleep0