You are not logged in.

#1 2023-03-03 10:06:22

leminhman0312
Banned
Registered: 2020-07-12
Posts: 24

System uses action for HandleLidSwitch regardless if machine is plugge

.

Last edited by leminhman0312 (2024-09-22 15:36:46)

Offline

#2 2023-03-03 22:04:03

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,446

Re: System uses action for HandleLidSwitch regardless if machine is plugge

You have  left "#AllowHybridSleep=yes" as per default, which is a different target than "AllowSuspendThenHibernate=", and

systemd-sleep(8) for "HibernateDelaySec=10sec" wrote:

The amount of time the system spends in suspend mode before the system is automatically put into hibernate mode. Only used by systemd-suspend-then-hibernate.service(8).

Perhaps you need "AllowHybridSleep=no"?

Offline

#3 2023-03-04 07:05:27

leminhman0312
Banned
Registered: 2020-07-12
Posts: 24

Re: System uses action for HandleLidSwitch regardless if machine is plugge

.

Last edited by leminhman0312 (2024-09-22 15:37:05)

Offline

#4 2023-03-04 08:30:54

seth
Member
Registered: 2012-09-03
Posts: 57,030

Re: System uses action for HandleLidSwitch regardless if machine is plugge

If you set

HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore

and restart logind (or reboot), is the lid ignored on external power?
Cause if not, the state is simply not properly detected.

Sanity check: is there a parallel windows installation?

Offline

#5 2023-03-04 08:41:17

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,446

Re: System uses action for HandleLidSwitch regardless if machine is plugge

Ok. A couple questions: What's in the journal for the whole suspend-hibernate cycle after resume? How do you test changed settings (daemon-reload and logout/login)? What happens when you suspend manually from the terminal while docked, does it stay in suspend or hibernate as well?

Have a look at

systemd-inhibit --list

if there is something else handling the lid switch and hibernate key.

Offline

#6 2023-03-05 06:46:59

leminhman0312
Banned
Registered: 2020-07-12
Posts: 24

Re: System uses action for HandleLidSwitch regardless if machine is plugge

.

Last edited by leminhman0312 (2024-09-22 15:37:31)

Offline

#7 2023-03-05 06:50:11

leminhman0312
Banned
Registered: 2020-07-12
Posts: 24

Re: System uses action for HandleLidSwitch regardless if machine is plugge

.

Last edited by leminhman0312 (2024-09-22 15:37:53)

Offline

#8 2023-03-05 07:14:04

seth
Member
Registered: 2012-09-03
Posts: 57,030

Re: System uses action for HandleLidSwitch regardless if machine is plugge

xfce4-power-manager 1000 maxwell 1330 xfce4-power-man handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch xfce4-power-manager handles these events  block

Offline

#9 2023-03-05 11:04:13

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,446

Re: System uses action for HandleLidSwitch regardless if machine is plugge

Yes, that reads like there may be a clash between xfce4's power-manager and the logind.conf lid actions. https://wiki.archlinux.org/title/Xfce#L … gs_ignored describes the opposite and will help to test changing xfce's setting there.

Offline

#10 2023-03-06 11:27:28

leminhman0312
Banned
Registered: 2020-07-12
Posts: 24

Re: System uses action for HandleLidSwitch regardless if machine is plugge

.

Last edited by leminhman0312 (2024-09-22 15:38:40)

Offline

#11 2023-03-06 14:02:51

seth
Member
Registered: 2012-09-03
Posts: 57,030

Re: System uses action for HandleLidSwitch regardless if machine is plugge

Meanwhile, the xfce4-power-manager gets suspend and hibernate working every single time.

Then why is this thread?

I guess you mean the invocation of some screen locker when suspending?
https://wiki.archlinux.org/title/Power_ … stem-sleep
https://gist.github.com/AladW/de1c5676d93d05a5a0e1

Offline

#12 2023-03-07 10:23:12

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,446

Re: System uses action for HandleLidSwitch regardless if machine is plugge

I find it confusing that the systemd-inhibit lists xfce4-power-manager while you use i3wm, but ok. So, the main problem remained when toggling "xfce4-power-manager/logind-handle-lid-switch".

If you want to rely on systemd for power management, what I would do is troubleshoot the systemd sleep.conf/login.conf on the console, i.e. without any WM:
First, remove any hibernate actions and configure it only for suspend-resume (whether on AC or battery, lid closed or button pressed) and not worry about screen locking for that. Once the suspend works consistently everytime, start i3wm again and check it continues to suspend only on AC.
Once that works, look into the screen locking and, finally, how to enable hibernate-after-suspend on battery.
That will hopefully find the culprit in your sleep.conf

Offline

Board footer

Powered by FluxBB