Prevent suspend when closing the lid in Fedora 43

I’m new to Linux, just got a Framework 12 and installed Fedora 43. I don’t want the laptop to suspend (or do anything other than turn off the screen) when I close the lid. I found a discussion (this one) explaining how to do it on Fedora 40, but I don’t know whether that method will still work on Fedora 43, and in any case the explanation given in that discussion is beyond my level of proficiency.

Can anyone help?

Power management in linux has always been tricky as it needs cooperation between hardware vendors and linux devs. I have a Dell laptop. Based on the contents of /usr/lib/systemd/logind.conf, I created: /etc/systemd/logind.conf.d/lidswitch.conf with the lines:

[Login]
HandleLidSwitchExternalPower=ignore

but the system suspends if I close the lib with external power connected. I assume this would work on some systems.

Thank you for replying!

If this did work, do you know if it would still turn the screen off when it closes or would that stay on?