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
  • 55,929
  • 26
  • 146
  • 227
  • 3
    Searching for "power button" on this site yielded [this helpful answer](http://unix.stackexchange.com/questions/18503/how-does-the-power-button-shut-the-computer-down-without-root-permission/18504#18504) that includes the needed pointer to `acpid` which is also explained [here](https://wiki.archlinux.org/index.php/Acpid) 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](https://wiki.archlinux.org/index.php/Acpid#Tips_.26_Tricks) 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,224
  • 49
  • 55