Deployment: How to deactivate the Session Lock permanently? CLI or Script

just finished the first attempt to deploy Leap 15.3 with KDE in my organization.
AutoYast and some custom post-install-scripts are working well.

But one thing drives my crazy:

On default the Session will lock after 5 min. Normally I deactivate it in

Settings / Configure Desktop, then Workspace / Desktop Behavior / Screen Locking

How can I do the same with CLI or a script?

I already took a look in the most relevant KDE/X11/Plasma configs, but no luck.

Thanks already for reading this!


Just to understand you correctly, you can deactivate the session lock using the GUI, right? Please confirm.

The tools to do things using the CLI is kcmshell5, try kcmshell5 --help.

Hi marel,
thanks for your answer.
The GUI solution is working, but I an searching a way to do the same with CLI/script.


kcmshell5 screenlocker

I am able to directly open the Settings Windows with the screenlock parameters.
How do I modify them with this comand?

Thanks Hendrik


Maybe it needs some work, but I think you should be able to get it to work using these instructions.
Would be good to post what you did if you made it work.

I found some sort of workaround:

kwriteconfig5 --file  kscreenlockerrc     --group 'Daemon'     --key 'Timeout' '99'

This sets the timeout to 99min, the max value.

I will try to dig deeper in this cmd to find the correct args to disable the locking completely.

I am just jumping in and did not read all posts above. But often in such configurations, a vlue of 0 switches a timing off complete. Did you check that?

BTW your code is not HTML the real CODE tags are just left of it: the # one. :wink:


kwriteconfig5 --file  kscreenlockerrc     --group 'Daemon'     --key Autolock false

Hi and thank you deano_ferrari!

This is the solution I am looking for:

sudo -u $USER kwriteconfig5 --file kscreenlockerrc --group 'Daemon' --key Autolock false

Thank you all for helping me out!

@deano_ferrari Would you let me know where you found this information? I want to learn more of this cli kde settings stuff …

Greetings from Germany,

I examined ~/.config/kscreenlockerrc and after toggling ‘Lock screen automatically’ via the systemsettings5 GUI I could observe the ‘Autolock=false’ key being removed and added, (depending on when being enabled or disabled). Anyway, here is my current configuration

~> cat ~/.config/kscreenlockerrc





I just got something similar to this topic:

I need to activate the Numlock on every boot via CLI/Script.
This is the way to do it via GUI:

Settings / Input Devices/ Keyboard / Numlock at Plasma Start

This Settings corespondents to the file


There is a Entry that saves the settings:


0 is Enabled at boot
1 ist Disabled at boot
2 is don’t care

Unfortunately this modified file will not work after a reboot to set the Numlock on.

Any ideas to trigger this settings (like the GUI) via CLI?

Greetings and thanks,

PS: Should I opened a new thread for this question? Let me know …

Yes, in general new topic —> new thread (with suitable descriptive title to catch the attention of those who may be able to help).