How to create a keyboard shortcut to launch hibernate?

On a KDE Plasma desktop (Sparky Linux), I use the hibernate feature often enough that I’d like to create a shortcut for it. I’ve tried doing that from the system settings, but nothing I’ve tried actually works. Apparently hibernate isn’t an application nor is it a command. I don’t know what it is.

Does anyone here know if it’s simply not possible to do that, or I simply haven’t figured out how to do it yet. I’d like to end up with something like META+L that locks the screen, only I want it to start a hibernation instead. Any help with this appreciated!

The Hibernate key combination should be settable in Shortcuts system settings for Power Management

1 Like

Solved: Using the systemctl hibernate command makes it easy to set a shortcut to do this. Now, when I retire for the night I can just press ALT+H to hibernate the machine.

2 Likes

Thanks for your response. That might work as well, but I’d already figured out the systemctl hibernate command before I read your answer.

1 Like

Only to have the full bunch of functions
Another option is:

  • systemctl suspend
  • systemctl suspend-then-hibernate
    More details you can find at the man systemctl
2 Likes

Thanks for your suggestions. I’ll look through the man page to see what else might be useful.

When I added a systemctl hibernate shortcut to several of my computers, I also added a systemctl reboot command macro to my bashrcAdditions files there.

They’re using Sparky Linux, which is otherwise excellent, but it doesn’t natively support the reboot command, and I do use that frequently. Now it’s like most other distros in that respect (including Neon).

1 Like