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

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

3 Answers 3

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

This link shows how to enable a defaulted disabled Ubuntu 12.04 hibernate option.

share|improve this answer
Welcome to Super User. Link-only answers are discouraged here, because the linked-to page might go away (and Super User will never go away!). Please edit your answer to include the steps from the referenced page. –  Scott Jun 10 '13 at 18:49

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.