KDE - how suspend to ram from locked screen?

Hi,

is there a way to suspend computer while screen is locked?

I have set up Power Settings to put computer to sleep when Power Button pressed. But when screen is locked the button is ignored.
Can I override this behaviour? Is it possible to force sleep when screen is locked

Power button worked fine for me in 13.1, but now in 13.2 stopped

Thanks

Bump.
This is still an issue to me. And I hate that Windows allows me to suspend from locked screen

Can anyone help me to write a daemon who will intercept ACPI power button press and perform sleep? Please, I really appreciate that! Any suggestions that could lead me towards a workaround are welcome

I assume (but this my theory) this is a KDE feature you switched on. And when the session is locked, KDE is not in charge and there is no user (verified by a password) busy. Thus the sytem wil not allow any bypasser to do this.

When you want to compare this with Windows, I think (but I do not know very much about Windows) that the big difference is that Linux is a multi-user system where Windows is not.

Yeah, I understand that someone (something) either KDE or acpid or some new systemd service does not allow me to suspend. I’m looking for a way to hack, override or workaround this limitation. As you pointed out this is Linux, not Windows, and I’m free to hack it. There is only one user logged into the system (me) and I’m an admin, so I grant the OS permission to suspend.

But how do I do that? Who exactly prevents sleep? Which code line should I comment out or change to override this behavior? Is that systemd-logind preventing?

Actually I don’t have that problem. Even on the lock-screen, my computer suspends when I close the lid.

So just out of the blue:
Could you have a look in your systemd-settings? In your KDE settings there’s an icon called “Systemd” in the last category “Systemadministration”. The tab "“Logind” gives you the possibility to change the behaviour of your HW in detail (without learning the CLI).

My settings are (from default install):

Ide action: ignore
Power key: poweroff
Suspend key: suspend
Hibernate key: Hibernate
Lid switch: suspend [Can be inhibited]
Maximum delay: 5 seconds

Especially the option “Can be inhibited” for Lid switch may cause an issue.

Maybe this helps
Simon