5

My Ubuntu 11.10 desktop has an option to suspend when inactive (under System Settings > Power) but no option to hibernate. How can I hibernate it after a period of inactivity?

2 Answers2

1

I'd imagine since its a desktop it sleeps instead of hibernates, it looks like laptop users have the opposite problem,

Sleep Instead of Hibernate When Idle

So for your case we would change the value for "sleep_type_ac" to hibernate when following the article. Hope this does the trick.

Simplified steps:

  1. Open a terminal, and run gconf-editor or a short cut to run programs hit Alt+f2 and type gconf-editor this will open up the configuration editor

  2. Find /apps/gnome-power-manager/actions/ by using the + icons and folders on the left sidebar, so first find "apps" then "gnome-power-manager" within the "apps" folder, and finally "actions" within that.

  3. Within "actions" look for sleep_type_battery and sleep_type_ac in the main window. Which in your case the value would be set to suspend double click suspend and change it to hibernate for which one you want to set to hibernate.

Mateo
  • 8,104
1

Since later versions of Ubuntu use dconf instead of gconf, Mateo's answer is out-of-date. To edit these same settings in dconf, do the following:

  1. First, run

     $ gsettings list-recursively org.gnome.settings-daemon.plugins.power | grep sleep-inactive
    

and take note of the different values: there is a timeout and type for each of A/C power and battery power. The type is one of 'suspend' or 'hibernate'. The timeout is the number of seconds of inactivity before suspending.

  1. In System Settings (gnome-control-center), choose power, and set the timeout to some unique value; I chose 2 hours (7200 seconds), since both battery-timeout and ac-timeout were set to disabled (0) previously.

  2. Now, run the command in step 1 again. Check which timeout changed. For my desktop computer it was the battery timeout, so pay close attention.

  3. Modify the "sleep" type which corresponds to the timeout you modified in step 2. Since step 2 modified the timeout for battery, I modified the sleep type for battery.

     $ gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'hibernate'
    
jpaugh
  • 552
  • Over four years later, these settings are still available in Ubuntu 20.04, but I was unable to understand the instructions before going through the process, again. Hopefully, my edits have clarified that. – jpaugh Jan 23 '22 at 19:34