I recently managed to acquire an EEE 901 netbook. I like it very much, and of course I installed Ubuntu on it (having briefly experimented with Crunch Bang Linux). Hibernation was disabled by default. This is how I solved that little problem:

Enabling hibernation at the system level.

First, i followed this guide. Condensed, it says:

1. See if hibernation works. UseAlt+F2 to open the “run” dialog, and then type “gksudo pm-hibernate”. Press enter, type in your password and press enter again. The system should now go into hibernation mode. Try to restart it. If all seems well, proceed to step 2 below. You’ll need to make sure to have a swap partition (or file) as large as your amount of RAM for any of this to work, by the way.

2. Call up the “run” dialog again. This time, type “gksu gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla”. Add these lines:

[Enable Hibernate]
 Identity=unix-user:*
 Action=org.freedesktop.upower.hibernate
 ResultActive=yes

Save and exit. Possibly use Alt+F2 and “restart” to restart the Gnome shell.

Now, you should be able to select hibernation in power options etc. It has been enabled at the system level. But still there is no menu option!

Getting a graphical “hibernation” option

I began by installing the “alternative status menu” extension. According to its description, it should have given me a “Hibernate” option. Alas, it did not. Seems like newer versions of the extension needs a bit of prodding. YMMV.

I poked around a bit, and found out that the extension actually had some hidden options, not accessible through either gconf-editor, dconf-editor or any other means besides manual editing.

Open a terminal window using Ctrl+Alt+T, for instance.

Go to the directory where the settings are (split into three lines for readability:

cd ~/.local/share/gnome-shell/extensions/
cd ./alternative-status-menu@gnome-shell-extensions.gcampax.github.com/
cd ./schemas/

Open up the settings file:

gksudo gedit ./org.gnome.shell.extensions.alternative-status-menu.gschema.xml

Find this part:

<key type="b" name="allow-hibernate">
 <default>false</default>
 <summary>Enable hibernating</summary>
 <description>Control the visibility of the Hibernate menu item</description>
</key>

Change “false” to “true”. Save the file, then exit.

And now, because someone decided it shouldn’t be that easy, the schema needs to be “compiled”. Type:

glib-compile-schemas ./

And press enter. Use Alt+F2 to run the “restart” command. This should reload the Gnome shell.

Now, hopefully, there should be a “hibernate” command in your status menu…

13 thoughts on “Enabling hibernation in Ubuntu 12.10 with Gnome Shell

  1. Thanks for this!

    But

    gksudo gedit ./org.gnome.shell-extensions.alternative-status-menu.gschema.xml

    should be

    gksudo gedit ./org.gnome.shell.extensions.alternative-status-menu.gschema.xml

  2. Hello, thanks for explaining how to do this.
    However, at the last step, compiling, I got this message:
    Error on line 2 char 1: Element not allowed at the top level. This entire file has been ignored.
    Any ideas?
    Cheers

  3. great. work me for ubuntu 12.10. for ubuntu 12.04 for first step it appear, but in 12.10 I had to operate whole page 🙂

  4. Thank you very much, this works very well. only problem i have is that i was not able to get the “Hibernate” option in the drop down Alternative status menu, However… I used Tweak tool (Which was installed already) so that, when you press the power button the computer goes to Hibernate. so it’s all good, No worries….

    Thanks alot for your help, I found it strange, i was a bit late as i refused to update from Ubuntu 10.10 so i found it strange that Gnome had no Hibernate option. well Gnome 3 that is.

  5. Awesome! I’ve spent weeks trying to figure this out!

    Quite why it couldn’t be enabled by default I don’t know…

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.