How to turn off display & lock the screen after inactivity on KDE Neon based on Ubuntu?

Operating System: KDE neon User Edition
KDE Plasma Version: 6.6.2
KDE Frameworks Version: 6.24.0
Qt Version: 6.10.2
Kernel Version: 6.17.0-19-generic (64-bit)
Graphics Platform: Wayland

Hello, I have noticed that the screen remains turned on and do not blank(turn off) after inactivity of several minutes.

I think that it previously worked.

Do you have idea what to try please?
I would like to turn off the display after 1 or 2 minutes of inactivity and also lock the screen so password is required to unlock the session.

Manual session locking works via GUI button or via command “loginctl lock-session --output=verbose”

Tried this on my laptop which has Neon and is up to date and this works for X11 and Wayland session.

The Wayland session took a bit longer after locking before it also turned off the screen but I didn’t repeat to time it.

The cause of the issue where the screen was not locked & display was not turned off, was an AppImage. Try to run:

systemd-inhibit --list|grep -E "WHAT|block"

consider killing a PID from the output, where the “WHAT” column contains “idle”:

/usr/bin/kill -SIGTERM PIDhere

It started turning off the screen automatically after defined minute/s.

App does not have any display related setting so I do not know better workaround than launching the AppImage using bash script, which contains following lines:

/path/to/abc.AppImage &>/dev/null
/usr/bin/sleep 30
kill -SIGTERM $(/usr/bin/systemd-inhibit --list | grep "AppNameFromSystemd-inhibitOutput" | grep block | grep idle | awk '{print $4}')

The screen is turned off but the session is not locked. Journal does not show any log line around the event, but there are still some events at different time regarding screenlocker:

“sudo journalctl -b --since today | grep -i kscreenlocker”
output is there: JustPaste.it - Share Text & Images the Easy Way