Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there any way to make my PC hibernate when I press the power button? By power button I meant my CPU's power button. Obviously when I press this button somewhere some signal is sent which I don't know about since I am new to Linux. Can it be intercepted to enable my PC to hibernate?

share|improve this question
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 8:34
    
@sr_: Does this daemon come with all linux distros, or do I have to install it by myself? –  Sayem Ahmed Oct 25 '11 at 8: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 8:51
2  
Assuming you use acpid and pm-utils, this can easily be adjusted to your needs. –  sr_ Oct 25 '11 at 9: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
add comment

1 Answer

up vote 2 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

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.