How to assign a shortcut key to send my system into hibernation?

I want to assign a shortcut key for the Hibernate functionality. I have Fn + F11 for hibernation in Windows, but it's not working on Ubuntu. It's getting in sleep mode instead.

I've also tired changing the keyboard shortcut option as Ctrl + H with command pm-hibernate, but still it didn't work. I referred this Ubuntu Forums Thread but couldn't find any solution for this.

Any solution please?

1

2 Answers

If you need to setup hibernation shortcut sequence, you go to Ubuntu System settings (Ctrl+Alt+T and then typing gnome-control-center) and then choosing keyboard settings.

Settings

Under that, you will see a tab that says "shortcuts", and there will be an option to set a custom command :

set custom command

Then you will need to put the command you want to hibernate your computer.

1

Firstly, Hibernate will need to be enabled. Go into console and type

sudo gedit /var/lib/polkit-1/localauthority/50-local.d/hibernate.pkla

In the new gedit window, copy-paste this in:

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

Save and close the file, reboot the computer, and then you have it available as a menu option. Assuming you're on a laptop, the fn + F11 shortcut should work afterwards as well, if this is a default option that came with the laptop (i.e. printed on the keyboard, etc.).

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like