Unable to run suspend-then-hibernate from GUI

Hello! on my EndeavourOS setup I have hibernation working as intended, and I can hibernate from the menu that pops up when the power button is pressed.

I then modified /etc/systemd/sleep.conf this way:


[Sleep]
#AllowSuspend=yes
#AllowHibernation=yes
AllowSuspendThenHibernate=yes
#AllowHybridSleep=yes
#SuspendState=mem standby freeze
#HibernateMode=platform shutdown
#MemorySleepMode=
HibernateDelaySec=10
#HibernateOnACPower=yes
#SuspendEstimationSec=60min

I can run systemctl suspend-then-hibernate in the terminal and it works fine. I’m trying to set up the pc to enter this mode from the GUI (pressing “suspend” in the popup with “shutdown”, “reboot etc, or when the laptop lid is closed. in the settings, under “power management”, I selected “standby, then hibernate” in the “when sleeping, enter” section. the description is however “switch to hibernation when battery runs low”, which is not what I want. I changed this setting in all the 3 categories of settings (AC power, battery, low battery).

However, closing the lid enters sleep but do not trigger hibernation. is this a bug, a missing feature or am I just missing something? thanks in advance!

having the same issue on kubuntu 24.04 (plasma 5).

i just have the GUI run a script for me that calls systemctl suspend-then-hibernate

on the previous LTS there was a check box to “hibernate after some time” that used to honor the HibernateDelaySec= setting, but now that box is gone on my system.

is the box still gone on yours, or has it come back?

The description describes the default setting of systemd, which is to use every possibility to make the system hibernate only once the battery runs low (on systems with battery), only falling back to a timer if configured in sleep.conf or when the computer absolutely doesn’t allow it.

PowerDevil, the KDE service managing automatic lid actions among other things, is supposed to call the D-Bus equivalent of systemctl suspend-then-hibernate if that’s what you’ve configured.

However, closing the lid enters sleep but do not trigger hibernation. is this a bug, a missing feature or am I just missing something? thanks in advance!

Sounds like bug. A known issue is that the manual “Sleep” action in the Application Launcher or in KRunner currently ignores the preferred Sleep action from Power Management settings. Lid action should respect it though.

I finally managed to make it sleep-then-hibernate by editing the file /etc/systemd/logind.conf appending these lines at the bottom:

HandleLidSwitch=suspend-then-hibernate
HandleLidSwitchExternalPower=suspend-then-hibernate
HandlePowerKey=suspend-then-hibernate

it works, but a checkbox in the settings would surely be more convenient