Score:2

Creating global hotkey -- Hibernate from Lock Screen

cn flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.