Created attachment 119747 [details] .config/powermanagementprofilesrc SUMMARY On the systems settings module, I set the laptop lid close action to "Suspend", and unchecked the box "Even when external monitor is connected". Powerdevil seems to ignore this setting and suspend the laptop whether an external monitor is plugged or not when I shut the lid. STEPS TO REPRODUCE 1. Plug in external monitor 2. Close lid OBSERVED RESULT System enters suspended state EXPECTED RESULT External monitor inhibits suspension. SOFTWARE/OS VERSIONS Operating System: NixOS 19.09pre177249 KDE Plasma Version: 5.15.3 KDE Frameworks Version: 5.57.0 Qt Version: 5.12.0 Kernel Version: 4.19.36 OS Type: 64-bit ADDITIONAL INFORMATION The issue appears to be a regression - before installing the last updates it worked just fine. Unfortunately I cannot rollback to the previous version easily to confirm this. $ systemd-inhibit Who: UPower (UID 0/root, PID 2754/upowerd) What: sleep Why: Pause device polling Mode: delay Who: PowerDevil (UID 1000/salazar, PID 2995/org_kde_powerde) What: handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch Why: KDE handles power events Mode: block Who: Screen Locker (UID 1000/salazar, PID 2917/ksmserver) What: sleep Why: Ensuring that the screen gets locked before going to sleep Mode: delay 3 inhibitors listed. $ busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager Docked b true $ xrandr | grep " connected" eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 174mm DP-1-2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 521mm x 293mm $ journalctl -f [...] Apr 30 15:47:51 hostname systemd-logind[2229]: Lid closed. Apr 30 15:47:51 hostname xsession[2806]: powerdevil: Suspend session triggered with QMap(("Explicit", QVariant(bool, true))("Type", QVariant(uint, 1))) Apr 30 15:47:51 hostname xsession[2806]: powerdevil: Suspend session triggered with QMap(("Explicit", QVariant(bool, true))("SkipFade", QVariant(bool, true))("Type", QVariant(uint, 1))) Apr 30 15:47:51 hostname xsession[2806]: powerdevil: Starting Login1 suspend job Apr 30 15:47:51 hostname xsession[2806]: lock called Apr 30 15:47:51 hostname xsession[2806]: powerdevil: Pausing all media players before suspending Apr 30 15:47:51 hostname xsession[2806]: bluedevil: About to suspend [...]
*** Bug 407093 has been marked as a duplicate of this bug. ***
Can you attach the output of kscreen-doctor -j please Does the battery monitor have a text along the lines of "Your laptop is configured not to suspend when an external monitor is connected"?
Created attachment 119754 [details] kscreen-doctor -j
The battery monitor does not show that text - which is strange. I attached the output of kscreen-doctor.
Thanks. Very strange. The two connected screens are eDP-1 of type 7 ("Panel") and DP-1 of type 14 ("DisplayPort"). The internal screen isn't enabled but your external screen is, so it should identify it as external monitor and disable suspend. The only cause I could see is that it doesn't notice the screen configuration change? When you kill powerdevil and restart it manually (should be somewhere around /usr/lib/x86_something/libexec/org_kde_powerdevil) in that configuration, does it then pick it up?
Created attachment 119898 [details] Powerdevil message log I tried to kill powerdevil and restart it manually. I attach the messages it outputted - this did not solve the problem. I then noticed this NixOS issue: https://github.com/NixOS/nixpkgs/issues/60312, so I tried to clear the .cache folder and restart plasma. With my surprise, it worked! The battery monitor is also back to displaying "Your laptop is configured not to suspend when an external monitor is connected" correctly. I will be marking this as solved - if you need logs or more information, I will be happy to provide them. Thank you, Kai, for your help!
Clearing the ~/.cache folder (specifically, deleting all the k*, plasma* and qt* subfolders) solved the issue for me. I am not sure it is a powerdevil problem at this point, maybe some other plasma components fail to invalidate their caches. Also, NixOS changes paths of the various binaries usually located in /usr - the problem might never emerge in system where binaries and configuration files are held in the conventional Linux FHS.