You are not logged in.

#1 2021-06-27 15:12:35

DJArch
Member
Registered: 2021-06-23
Posts: 19

[SOLVED] My laptop is not ignoring lid closing

I would want my laptop to keep running even if I close the lid. I want to be able to start a long C++ simulation, close the lid and pack my laptop. After a while, when I get home, I want to open my laptop and keep working (the simulation should have kept running while I had my laptop closed).

I followed the instructions here (https://wiki.archlinux.org/title/Power_management) under "Power management with systemd"

I modified

/etc/systemd/logind.conf 

Specifically the:

#HandleLidSwitch
#HandleLidSwitchExternalPower

Now my file looks like this:

[me@frankenstein ~]$ cat /etc/systemd/logind.conf 
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the logind.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/logind.conf' to display the full config.
#
# See logind.conf(5) for details.

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

Finally, to apply the changes, I did:

[me@frankenstein ~]$ systemctl kill -s HUP systemd-logind

I would expect my laptop to ignore the lid closing completely. But if I have a Youtube video playing, and then I close the lid, the video stops.

Did I miss anything?

Thanks.

Last edited by DJArch (2021-06-27 15:21:46)

Offline

#2 2021-06-27 15:15:25

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] My laptop is not ignoring lid closing

You have to uncomment the line for it to have any effect.

Offline

#3 2021-06-27 15:20:56

DJArch
Member
Registered: 2021-06-23
Posts: 19

Re: [SOLVED] My laptop is not ignoring lid closing

Scimmia wrote:

You have to uncomment the line for it to have any effect.

Well, that was embarrasing. Thanks.

Problem solved.

Just a quick follow-up question:

Then how did the computer know to "suspend" when the lid closes if the original

#HandleLidSwitch=suspend

was commented?

Thanks again,

Offline

#4 2021-06-27 15:25:23

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: [SOLVED] My laptop is not ignoring lid closing

It's the default behavior

Offline

#5 2021-06-27 16:01:42

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,693

Re: [SOLVED] My laptop is not ignoring lid closing

As for running a long simulation while it is closed, great.  But, if it requires a lot of processing resources, make sure it can breath;  you may not want to stuff it in a backpack lest it cook itself.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB