My working setup is basically clamshell mode - the laptop is closed and placed vertically, with two external monitors, a mouse, and a keyboard.
On a fresh Fedora KDE 43 install, this caused a weird issue - right after logging in, the system immediately suspends, and I have to wake it up. Tweaking the UI settings (Power Management) did not resolve the issue.
I tried a bunch of solutions I found online, but most of them did not work. The main reason was that many comments pointed to /etc/systemd/logind.conf, but on my setup, that file did not exist. The default config lives under /usr/lib/systemd/logind.conf, and the recommended way to override it is via a drop-in in /etc/systemd/logind.conf.d/.
The working solution is to create /etc/systemd/logind.conf.d/ignore-lid-switch.conf and add the following lines:
[Login]
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
While searching, I also found a neat way to inspect the effective systemd configuration: systemd-analyze.
For example, to check what the configuration is for logind.conf, I can run systemd-analyze cat-config systemd/logind.conf.
And that is all - after restarting systemd-logind or rebooting, everything works as expected.