How do I hibernate my PC when I press the power button











up vote
2
down vote

favorite
1












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?










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?
    – MD 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















up vote
2
down vote

favorite
1












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?










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?
    – MD 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













up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





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?










share|improve this question















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?







linux hibernate






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 24 at 20:35









Rui F Ribeiro

38.3k1476127




38.3k1476127










asked Oct 25 '11 at 8:19









MD Sayem Ahmed

1134




1134








  • 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?
    – MD 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














  • 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?
    – MD 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








3




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






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?
– MD Sayem Ahmed
Oct 25 '11 at 8:50




@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 8:50




1




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






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




2




Assuming you use acpid and pm-utils, this can easily be adjusted to your needs.
– sr_
Oct 25 '11 at 9:01




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




@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 Answer
1






active

oldest

votes

















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























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f23260%2fhow-do-i-hibernate-my-pc-when-i-press-the-power-button%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    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



























      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

























        up vote
        2
        down vote



        accepted







        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














        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














        share|improve this answer



        share|improve this answer








        edited Apr 13 '17 at 12:22









        Community

        1




        1










        answered Feb 15 '12 at 8:06









        sr_

        12.9k3142




        12.9k3142






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f23260%2fhow-do-i-hibernate-my-pc-when-i-press-the-power-button%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Morgemoulin

            Scott Moir

            Souastre