Results 1 to 9 of 9

Thread: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

  1. #1
    Join Date
    Nov 2011
    Posts
    68

    Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

    Hey guys I have come across a interesting piece of information for you all which I think would be very much useful for you all. So here is a glance for you all have a look at it. you can perform the following functions sleep / standby / hibernate / suspend with the help of command line only. I have tested the following commands in Ubuntu 8.04 using my Toshiba laptop. You can also give a try for the same and do let me know if that would be useful for you or not.

    For the sleep mode you can enter the following code

    Code:
    pmi action suspend
    for hibernate you can look out for the following code

    Code:
    pmi action hibernate
    Now if you are interested in Gnome session first then you can use the following command before pmi.

    Code:
    gnome-screensaver-command –lock
    With the help of these buttons you can create a button (launcher) on a Gnome panel . isn’t it a great idea. hope you all will like this method.

  2. #2
    Join Date
    May 2011
    Posts
    398

    Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

    You haven’t mentioned anything about the suspend and the resume state. Frankly speaking I am new to this pmi. I don’t know how is this pmi action implemented? Till now I was using ‘sudo /etc/acpi/sleep.sh’ and I faced several issues such as wireless was not getting connected when I resumed, the system does sometimes ignore the hdd parameters script. Anyways I will give a try for the commands that you have given, hopefully pmi will be able to give me a much better result than the sudo, that’s what I am expecting.

  3. #3
    Join Date
    Jul 2011
    Posts
    322

    Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

    See if you are using gnome then the proper solution should be

    Code:
    gnome-power-cmd suspend
    or you can use

    Code:
    gnome-power-cmd hibernate

  4. #4
    Join Date
    Sep 2011
    Posts
    105

    Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

    Quote Originally Posted by Python$ View Post
    Hey guys I have come across a interesting piece of information for you all which I think would be very much useful for you all. So here is a glance for you all have a look at it. you can perform the following functions sleep / standby / hibernate / suspend with the help of command line only. I have tested the following commands in Ubuntu 8.04 using my Toshiba laptop. You can also give a try for the same and do let me know if that would be useful for you or not.

    For the sleep mode you can enter the following code

    Code:
    pmi action suspend
    for hibernate you can look out for the following code

    Code:
    pmi action hibernate
    Now if you are interested in Gnome session first then you can use the following command before pmi.

    Code:
    gnome-screensaver-command –lock
    With the help of these buttons you can create a button (launcher) on a Gnome panel . isn’t it a great idea. hope you all will like this method.
    Quote Originally Posted by Jessalyn View Post
    See if you are using gnome then the proper solution should be

    Code:
    gnome-power-cmd suspend
    or you can use

    Code:
    gnome-power-cmd hibernate
    Hey sorry to interrupt you all but I have tried with the following commands seems suspend operation is not working properly. Buttons on the GUI for suspend do work well but I will have to run some script in order to invoke some actions for the suspend. So I am just wondering what would be the script for the suspend button/? Well for once I tried running the same script as given above just replacing the words with suspend but it did not work for me, so what do you all have to say about this? Can you please reply to me on this.

  5. #5
    Join Date
    Nov 2011
    Posts
    68

    Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

    Quote Originally Posted by silvery View Post
    Hey sorry to interrupt you all but I have tried with the following commands seems suspend operation is not working properly. Buttons on the GUI for suspend do work well but I will have to run some script in order to invoke some actions for the suspend. So I am just wondering what would be the script for the suspend button/? Well for once I tried running the same script as given above just replacing the words with suspend but it did not work for me, so what do you all have to say about this? Can you please reply to me on this.
    I just want to know how does the suspend button behave can you tell me some of the commands or the output that you get when you click on those buttons? That’s what I want to know.

  6. #6
    Join Date
    Sep 2011
    Posts
    105

    Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

    Quote Originally Posted by Python$ View Post
    I just want to know how does the suspend button behave can you tell me some of the commands or the output that you get when you click on those buttons? That’s what I want to know.
    Well on typing pmi action suspend the message that I get is "The program 'pmi' is currently not installed. You can install it by typing:
    sudo apt-get install powermanagement-interface".

    So that’s the message that I get. Now recently I got to know that built-in Suspend in Keyboard Shortcuts does not work as well. what to do can you tell me?

  7. #7
    Join Date
    Nov 2011
    Posts
    68

    Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

    Quote Originally Posted by silvery View Post
    Well on typing pmi action suspend the message that I get is "The program 'pmi' is currently not installed. You can install it by typing:
    sudo apt-get install powermanagement-interface".

    So that’s the message that I get. Now recently I got to know that built-in Suspend in Keyboard Shortcuts does not work as well. what to do can you tell me?
    Hey you can try out this one

    Code:
    sudo apt-get install pmi
    after that you can use

    Code:
    sudo pmi action suspend
    now as far as keyboard shortcut is concerned then you can bind the following command
    Code:
    ‘gksu pmi action suspend’
    to a keyboard shortcut, it might ask for the root password.

  8. #8
    Join Date
    Sep 2011
    Posts
    105

    Exclamation Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

    Quote Originally Posted by Python$ View Post
    Hey you can try out this one

    Code:
    sudo apt-get install pmi
    after that you can use

    Code:
    sudo pmi action suspend
    now as far as keyboard shortcut is concerned then you can bind the following command
    Code:
    ‘gksu pmi action suspend’
    to a keyboard shortcut, it might ask for the root password.
    I don’t understand how can suspend button ask for a password. Well suspend is a basic operation that is a part of the system, plus in some machines they are automatically set to suspend state. so I think it should not ask for any kind of password at all, what do you all say why should I set a password for such type of actions?

  9. #9
    Join Date
    May 2011
    Posts
    397

    Re: Performing sleep / standby / hibernate / suspend operations from command line in Linux Ubuntu

    Hey dude just take a chill pill here is the following command for not entering the password.

    Code:
    sudo apt-get install powermanagement-interface
    Now after that you can run

    Code:
    sudo visudo
    now enter your username in that command line and add it

    Code:
    yourusername ALL=NOPASSWD: /usr/sbin/pmi
    save it. now you will not be able to give any password for that particular command. I hope that’s helpful for you.

Similar Threads

  1. Replies: 1
    Last Post: 29-04-2013, 05:43 PM
  2. Replies: 2
    Last Post: 30-05-2012, 01:14 PM
  3. Suspend, Hibernate unable to work in ubuntu 10.04
    By Bellare in forum Operating Systems
    Replies: 9
    Last Post: 31-03-2012, 01:10 AM
  4. Difference between Sleep or Standby and Hibernate
    By sara in forum Operating Systems
    Replies: 3
    Last Post: 22-05-2009, 10:47 PM
  5. Improved Windows operations in Ubuntu (Linux)
    By aneesh in forum Operating Systems
    Replies: 1
    Last Post: 24-12-2008, 08:47 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,289,933.81147 seconds with 17 queries