How to add Hibernate to the Power Wingpanel in elementary OS

Hibernate in Freya
Hibernate in Freya

Elementary OS Freya has the Hibernate mode enabled by default settings, but you can only assign the power button in settings to do the action when pressed. There is no hibernate option in the Power menu that pops-up  when you click on power icon on top right corner of the elementary desktop.

Hibernate in Freya
Hibernate in Freya

Before doing anything, you may want to first check if your elementary has the hibernate option enabled. Go to ‘System Settings’ and click ‘Power’ icon. You should see Hibernate option there.

Power Options
Power Options

SWAP Partition and Hibernate

Next, make sure Hibernate is compatible with you PC. Launch terminal and run the following command:

sudo pm-hibernate

After your PC turns off, switch it back on and check if your open applications re-open? If hibernate doesn’t work, check if your swap partition is at least as large as your available RAM. Linux recommends twice as size of RAM for its SWAP partition. For example if your PC has 8 GB of RAM, then you should be having at least 16 GB of SWAP partition. To check the SWAP partition size, open Terminal and type the fdisk command.

sudo fdisk -l
fdisk - Check SWAP size
fdisk – Check SWAP size

Enable Hibernate to the Power Wingpanel

Hibernate in Power Wingpanel of elementary OS
Hibernate in Power Wingpanel of elementary OS

Open Terminal and type the following commands one-at-a-time:

sudo touch /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
sudo scratch-text-editor /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
Enable Hibernation Menu
Enable Hibernation Menu

Add the following to the text editor that opens after the above commands:

[Re-enable hibernate by default]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
[Re-enable hibernate by default for login1]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate
ResultActive=yes
[Re-enable hibernate for multiple users by default in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate-multiple-sessions
ResultActive=yes

Log off and login again and you will see the Hibernate option in the Power drop down menu.

Hi there! I’m Kiran Kumar, founder of FOSSLinux.com. I’m an avid Linux lover, and enjoys hands-on with new promising distros. Currently, I’m using Linux Mint as a daily driver and run several other distros such as Fedora, Solus, Ubuntu, Debian, and some new ones on my test PC and virtual machines. I have a day job as an Engineer, and this website is one of my favorite past time activities especially during Winter ;). When I’m not writing for FOSSLinux, I’m seen biking and hiking on scenic trails. Hope you enjoy using this website as much as I do writing for it. Feedback from readers is something that inspires me to do more, and spread my love for Linux. If you find time, drop me an email or feedback from ‘Contact’ page. Or simply leave a comment below if you found this article useful. Have a good day!

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz