For few weeks I had a strange problem with power management on my laptop. It is quite old Asus, really nicely supported by Linux community, so it was almost impossible to be any low-level problem. The problem was that, when I had lid of the laptop closed, system was always suspending, ignoring Plasma power management settings. This was really annoying, especially when I was leaving some background task and of course closing the lid to save power on turned off screen and then few minutes later realizing that the computer slept just after leaving it. Unfortunately I had not much time to investigate what was the reason.
Until today. It seems that systemd just started managing another part of my computer – power management. And was kind enough to ignore the fact that desktop environment is already managing it and set up its own configuration files. The effect was that it was intercepting lid close event and suspend the computer anyway.
So, if you encountered similar problem, then below are the details of what should be changed to turn that feature off.
/etc/systemd/logind.confwith your favorite editor as root.
- Add following lines to
HandlePowerKey=ignore HandleSuspendKey=suspend HandleHibernateKey=hibernate HandleLidSwitch=ignore
- Save and restart logind with:
systemctl restart systemd-logind.service
Now you should have gotten rid of systemd’s attempt to be the everything you need on Linux box (at least this time).