2

Is there any way to make my PC hibernate when I press the power button? Obviously when I press this button somewhere some signal is sent. Can it be intercepted to enable my PC to hibernate?

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
  • 3
    Searching for "power button" on this site yielded this helpful answer that includes the needed pointer to acpid which is also explained here where you find references to for example pm-utils which might also help. – sr_ Oct 25 '11 at 08:34
  • @sr_: Does this daemon come with all linux distros, or do I have to install it by myself? – MD Sayem Ahmed Oct 25 '11 at 08:50
  • 1
    I guess it's really common among Linux distributions. What's yours? Look at ps aux | grep acpid, it might already be running. – sr_ Oct 25 '11 at 08:51
  • 2
    Assuming you use acpid and pm-utils, this can easily be adjusted to your needs. – sr_ Oct 25 '11 at 09:01
  • @sr_: acpid is a (the?) correct way to handle this kind of events, so I guess you can write one of your comments as an answer :-) – njsg Feb 14 '12 at 19:49

1 Answers1

2

You probably (could) use acpid (check via ps aux | grep acpid). Then have a look at this article in the ArchWiki explaining how to use pm-utils to extend acpid to easily achieve whatever effect you'd like when some hardware button is pressed.

If, however, you use GNOME, there other (also GUI) ways, see this comprehensive thread on askubuntu.com

sr_
  • 15,384