Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to setup LXDE (a linux desktop environment) to hibernate a PC after the power button on the computer is pressed?

share|improve this question

You can do that without LXDE (or any other) GUI support. Just run acpid, it does that by default. At least on my system.

share|improve this answer

Found an answer to this on the AskUbuntu StackExchange:

When you press the power button a ACPI event triggers the script at /etc/acpi/

You can edit that to just run shutdown -h now as the first thing so it looks like:

# /etc/acpi/
# Initiates a shutdown when the power putton has been
# pressed.

/sbin/shutdown -h now "Power button pressed"
exit 0
# leave the old code below (in case you want to revert!)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.