A while ago I came across (very likely on these boards) a solution to the issue of ignoring the laptop lid switch, that recommended the creation of an 80-lidswitch.conf
symlink in the /etc/systemd/logind.conf.d
that points to /dev/null
. That worked fine for a while, though my suspicion is that the boot-up troubles that I am currently experiencing with some of the latest CL releases may be caused by this “solution.” At any rate, just to be on the safe side and eliminate this as a potential cause, I am now looking for a different solution to the matter of disabling the lid switch. Is there anything else that would disable the lid switch (more specifically, disable the laptop’s going to sleep while the lid is closed)? What is the last word in terms of performing this feat? Is there a more elegant solution?
Hi Cristian,
I was trying to set this up on my laptops. Unlike you, I didn’t create an 80-lidswitch.conf
; instead, I did the following:
- Opened the logind configuration file with:
sudo nano /etc/systemd/logind.conf
- Inside the file, I added these lines:
[Login]
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
- Finally, I saved the file and ran:
sudo systemctl restart systemd-logind.service
What this means:
- HandleLidSwitch=suspend: If none of the other conditions apply (for example, if the laptop is running on battery and not docked), closing the lid will cause the system to suspend.
- HandleLidSwitchExternalPower=ignore: If the system detects that you are on AC power, the lid-closing event is ignored.
- HandleLidSwitchDocked=ignore: If the system detects that you are “docked” (connected to a docking station), the lid-closing event is ignored. This means that even if you are not on AC power, the laptop will not suspend when docked.
Hope this helps!
1 Like
Did you have a pre-existing logind.conf
file, or did you have to create it from scratch? I, myself, do not have one.
No, it wasn’t present for me either, so you just need to save and close it. Finally, delete the old file you created to avoid conflicts.
1 Like