You are not logged in.

#1 2023-01-07 03:03:45

hendry
Member
From: Singapore
Registered: 2009-09-08
Posts: 157
Website

Only suspend when lid closed when on battery

❯ grep -v ^# /etc/systemd/logind.conf
[Login]
HandleLidSwitchExternalPower=ignore



However my LENOVO_MT_21CF_BU_Think_FM_ThinkPad T14 Gen 3 now fails to suspend when off power. ?

Am I missing something? I'm very confused by "Note: systemd cannot handle AC and Battery ACPI events, so if you use Laptop Mode Tools or other similar tools acpid is still required." upon https://wiki.archlinux.org/title/Power_management

Does that mean systemd is unaware of when I'm powered or not?

Offline

#2 2023-01-08 04:18:29

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: Only suspend when lid closed when on battery

hendry wrote:
HandleLidSwitchExternalPower=ignore

However my LENOVO_MT_21CF_BU_Think_FM_ThinkPad T14 Gen 3 now fails to suspend when off power. ?

Do you mean (1) that triggering suspend using some other means no longer works e.g. using the sleep button or telling systemd directly? or (2) that suspend is no longer triggered when you close the lid? (2) is expected - you just told systemd to ignore lid closing, so it will take no action when you close the lid. (1) would not be expected.

hendry wrote:

Am I missing something? I'm very confused by "Note: systemd cannot handle AC and Battery ACPI events, so if you use Laptop Mode Tools or other similar tools acpid is still required." upon https://wiki.archlinux.org/title/Power_management

Does that mean systemd is unaware of when I'm powered or not?

I don't know if systemd is unaware of this, but it offers only monolithic configuration. For each of the events, you can tell it what to do, but you can't tell it to do one thing if you're on AC and a different thing if you're not. At least, you cannot do so by any straightforward means. (You might be able to override one or more of the targets to use a custom script which responded differently in the two cases, but I don't know whether that would be a good idea.) If you want different responses to the same triggers you need to use a more specialised tool.

Last edited by cfr (2023-01-08 04:20:06)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2023-01-08 06:00:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Only suspend when lid closed when on battery

cfr wrote:

... you can't tell it to do one thing if you're on AC and a different thing if you're not.

Yes, you can.  That's precisely what these settings in logind are for.  But these only apply if some other process does not have an inhibitor lock on them.  Hendry, is this in a graphical session?  Which one?  Can you test without any DM/DE running (just in a console)?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2023-01-08 21:54:37

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,131

Re: Only suspend when lid closed when on battery

Trilby wrote:

Yes, you can.  That's precisely what these settings in logind are for.  But these only apply if some other process does not have an inhibitor lock on them.  Hendry, is this in a graphical session?  Which one?  Can you test without any DM/DE running (just in a console)?

Sorry, I was thinking of something else.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB