Yesterday 6:06pm

Short answer: GNOME has no built-in setting for this. Debian 13 (GNOME 48) deliberately omits power actions like hibernate from the lock screen, so you need two things: working hibernation at the system level, plus an extension that survives the lock screen.

1️⃣ Make hibernation actually work first

GNOME (and any extension button) only works if systemd-logind answers CanHibernate=yes:

bash
busctl call org.freedesktop.login1 /org/freedesktop/login1 \
  org.freedesktop.login1.Manager CanHibernate
sudo systemctl hibernate   # test directly

If that fails, set up swap and the resume path:

  • Swap at least as large as your RAM (partition, or swapfile + resume_offset for btrfs/tmpfs setups).
  • Add the resume parameter in /etc/default/grub:
    text
    GRUB_CMDLINE_LINUX_DEFAULT="quiet resume=UUID=<swap-uuid>"
    then sudo update-grub (and sudo update-initramfs -u if needed).
  • Reboot and re-test systemctl hibernate.

2️⃣ Get the button on the lock screen

No existing extension does exactly "Hibernate on the lock screen" out of the box:

  • Hibernate Status Button ( EGO,  GitHub) adds Hibernate (+Alt for hybrid sleep) to the top-right system menu and supports GNOME 48, but it only runs in the user session, so it disappears when locked.
  • Shutdown Options on Lock Screen ( GitHub, not on EGO) adds Suspend/Restart/Power Off buttons to the lock screen itself (it declares "session-modes": ["user", "unlock-dialog"] and calls systemd-logind directly), but it doesn't include Hibernate.

So the practical routes are:

  1. System menu only: install Hibernate Status Button and use hibernate from the top-right Quick Settings menu before locking. Easiest, no coding.
  2. True lock-screen button: fork one of the two extensions and make a small edit:
    • add "unlock-dialog" to the session-modes array in Hibernate Status Button's metadata.json, or
    • add a Hibernate action (a logind Hibernate call, same pattern as its Suspend) to the blurayne extension.

Either way, step 1 is mandatory: if CanHibernate is no, the button will do nothing or be hidden. Note the lock screen buttons call logind without a password, which is exactly why GNOME keeps them off by default, so the confirmation step in these extensions is worth keeping.

Yesterday 6:06pm

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Vibe can make mistakes. Check answers. Learn more