GNOME Shell doesn't have an option to hibernate in the session menu. I checked the GNOME Shell Cheat Sheet but hibernate is not mentioned there.
How can I hibernate my machine from within a GNOME Shell session?
GNOME Shell doesn't have an option to hibernate in the session menu. I checked the GNOME Shell Cheat Sheet but hibernate is not mentioned there.
How can I hibernate my machine from within a GNOME Shell session?
Just install this GNOME Shell extension by sliding the slider. Your user menu should now show a few new extra options: Hibernate, and Power Off...
Hibernate
option on my system (Ubuntu GNOME 3.8).
Commented
Jun 10, 2013 at 22:10
dv3500ea In your link to GNOME Shell Cheat Sheet you got the answer:
The Power Off... menu entry is hidden by default. You can make it visible by pressing the Alt key in the user menu.
Just hold ALT
sudo apt-get install pm-utils
Alt+F2
sudo pm-hibernate
I don't think it is possible to manually hibernate in GNOME Shell (I could be wrong). There is an extension that adds extra options for power management, but having not had sucess installing extensions myself, I cannot tell you for sure how to install it.
For now, you can hit alt + f2 and type pmi action hibernate
or gnome-power-cmd hibernate
(10.10 and lower only), then press enter. This will not give you any options, so only do this if you are sure you won't want to cancel.
If you want to make this easier, you could create a script with (using zenity to provide options) and place this in ~/bin
. You could then create a keyboard binding for the script, so when you press (for example) alt+super+h your system would hibernate.
gnome-power-cmd
is no longer available in 11.04, Refer:answers.launchpad.net/ubuntu/+source/gnome-power-manager/…; alternative is : gshutdown
gshutdown.tuxfamily.org/en/index.php.
powermanagement-interface
package. Unfortunately I get an error when I use it: Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Hal was not provided by any .service files
.
On Ubuntu Gnome 14.04, Gnome 3.12, the following works (13 June 2014), but I have only set it up to work with pushing the power button and closing the lid (so no GUI button to push).
Credit goes here, to the commentators, too.
Instead of making a new file .../polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
, sudo edit the existing
/var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla
and activate hibernation there, by changing ResultActive=no
to ResultActive=yes
, to obtain the following sections:
[Disable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
[Disable hibernate by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=yes
This allows the machine to hibernate.
To activate it on lid closure, sudo edit
/etc/systemd/logind.conf
and change HandleLidSwitch=suspend
to #HandleLidSwitch=hibernate
.
Before doing this, I searched dconf editor for entries with hibernate
and changed everything from suspend
to hibernate
(my machine cannot resume from suspend
...) I'm not sure which entry made it work, but the power button also hibernates my machine now.
There's a bit more required for this in 12.10. (Skip this answer if you're using 12.04 or earlier.) By default, alternative status menu no longer displays the Hibernate option. The easiest way to fix this is to install the extension, newly added to the Ubuntu repositories, and then use gsettings to change the default:
sudo apt-get install gnome-shell-extensions
gsettings set org.gnome.shell.extensions.alternative-status-menu allow-hibernate true
Then enable the extension in Tweak Tool and restart the shell (alt+f2 and enter r).
DO NOT install the extension from extensions.gnome.org.
No such schema 'org.gnome.shell.extensions.alternative-status-menu'
You need to install "gnome-shell-extensions-alternative-status-menu" package if you are using gnome-shell testing ppa. This will enable hibernation option as well as power off options in the status menu.
For me installing the extension
sudo apt-get install gnome-shell-extensions
gsettings set org.gnome.shell.extensions.alternative-status-menu allow-hibernate true
(as mentioned above) AND editing this file
gksu gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
and inserting
[Enable Hibernate]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
helped (see here).
I found a new extension which adds a new button for hibernation. It works fine with touch screens and convertibles because it is a separate button. There is on drawback though: it does not (currently) work from the lockscreen.
It was easy to find in Ubuntu 17.10, I just had to search for hibernate and select the corresponding result of the section for software results. Hibernate and Gnome extensions were already set up, if you have problems with these I suggest you look for the corresponding Q&A here at this site.
Also you can still configure the power button to hibernate your computer instead of shutting it down (settings > power options), if that is what you want.
/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
(see askubuntu.com/a/1064114/674319)
as of 2013-10-24, using Ubuntu-Gnome 13.10, the following allowed me to use hibernation in the power settings, as well as hibernate using the physical power button:
sudo -i # because the following should be ran as root
gsettings set org.gnome.shell.extensions.alternative-status-menu allow-hibernate true
cat > /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla <<EOF
[Enable Hibernate]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
EOF
For GNOME, on any distro, you can add a hibernate button by simply installing the extension System Action - Hibernate .
And done!