2

I recently got a new laptop and set it up to dual boot Ubuntu 20.04 and Windows. I keybound sudo systemctl hibernate to ctrl-shift-f1 and added that command to the sudoer's file. I also added the UUID of the swap partition to GRUB. This works fine when I am logged in to my account, as I can hibernate and it restores properly.

I like to hibernate my Ubuntu so I don't lose my work when I need to boot in to Windows. Unfortunately, sometimes I boot in to Ubuntu again by accident. When this happens, I need to log back in to my account to hibernate again, which is annoying.

Is there a way to make my hibernate hotkey (or any hotkey) work everywhere, including other accounts and the lock screen?

I tried adding the hotkey as root by opening settings as root and adding the hotkey there, but that didn't do anything.

EDIT: By the way, my laptop doesn't have a sleep button or hibernate button, so I have to use a keyboard shortcut.

Zarquan
  • 143

0 Answers0