Suspend-then-hibernate works using command line, but not lid close action

I am using Manjaro on i3wm, kernel 5.4.44-1. My /etc/systemd/sleep.conf looks like this:

[Sleep]
 #AllowSuspend=yes
 #AllowHibernation=yes
 #AllowSuspendThenHibernate=yes
 #AllowHybridSleep=yes
 #SuspendMode=Suspend
 #SuspendState=disk
 #SuspendState=mem standby freeze
 #HibernateMode=suspend #platform shutdown
 #HibernateState=disk
 #HybridSleepMode=suspend platform shutdown
 #HybridSleepState=disk
 HibernateDelaySec=10

I set the delay to be 10 sec to test. Then, my /etc/systemd/logind.conf looks like this:

[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=suspend-then-hibernate
#HandleLidSwitchExternalPower=suspend-then-hibernate
#HandleLidSwitchDocked=suspend-then-hibernate
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
~

On terminal, if I do: systemctl suspend-then-hibernate then upon lid closes, the system suspends then after 10 seconds, it hibernates. I am on a Thinkpad T480s so this can be seen easily with the LED on the lid: if suspend then LED flash on and then off; if hibernate then LED is off completely.

Unfortunately, if I close the lid without doing systemctl suspend-then-hibernate, then the system does enter suspend, but it never enter hibernate.

I'd like to point out that :

  • resume from suspend/hibernate works fine.
  • the system is unable to do suspend-then-hibernate (upon lid closes not using systemctl command, it suspends but never goes to hibernate) on both battery mode and AC mode.
  • I also made sure to do systemctl restart systemd-logind.service and then reboot to test again. No luck

Could anyone please give me some pointers? Thanks

It is the power management software that deals with the lid switch. I think xfce4-power-manager is used mainly????? But not an i3 user anymore.

Yes on i3, power manager is managed by xfce4-power-manager as defaults.

So I found the solution here on the arch forum:

https://bbs.archlinux.org/viewtopic.php?id=248616

The idea is to ln -s the hibernate service like this:

ln -s /usr/lib/systemd/system/systemd-suspend-then-hibernate.service /etc/systemd/system/systemd-suspend.service

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by