How can I keep my laptop display off in clamshell mode on NixOS with KDE?

September 23, 2026 2 answers
Asked by after-school-project
I'm running NixOS with KDE Plasma, Plasma Login Manager, and a ThinkPad X1 Carbon connected to an external monitor. I want the built-in display to remain off whenever the lid is closed, while continuing to use the external monitor. At the moment, the external display works initially, but after a few minutes the laptop panel turns back on. I can see it light up by slightly lifting the lid. I tried configuring systemd-logind to ignore lid events and rebooted, but it didn't solve the problem. I'm also using the Lenovo ThinkPad hardware module. What configuration should I use to keep the system in clamshell mode?

Answers

_tadpole_count
There are two separate parts here: logind decides what to do with the lid switch, while KDE can still react to the lid event later. Configure all three `HandleLidSwitch` settings using the capitalized names, then set KDEโ€™s lid-close action to โ€œDo nothing.โ€ That should prevent the internal panel from being re-enabled while the external monitor remains active.
Reply to this answer
~later perhaps
Use the exact systemd-logind option names with capital letters. On NixOS, try setting the lid actions like this: `services.logind.settings.Login = { HandleLidSwitch = "ignore"; HandleLidSwitchExternalPower = "ignore"; HandleLidSwitchDocked = "ignore"; LidSwitchIgnoreInhibited = "no"; };` The lowercase versions may not be recognized. Also check KDEโ€™s Power Management settings and make sure closing the lid is set to do nothing, since KDE can apply its own policy after logind handles the initial event.

svg2.path: This is especially worth checking under Wayland, where KDEโ€™s power-management service may override what logind initially did. Disable any KDE action associated with closing the lid and then restart the relevant session or reboot.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions