How to lock Plasma 6 desktop settings -rather non-standard use case

OK, I have a very specific and non-standard use case…

I have configured a touchscreen PC to function as a multimedia player that is operated solely by pressing on Plasmoids. Those Plasmoids each perform a very simple function: kill whatever mediaplayer is active (for instance, VLC or Spotify) and then start it with a predetermined config file. These things happen on the CLI, off-screen.
In order for the end users not to be able to modify any of the settings, I have the whole setup locked down with:
qdbus org.kde.plasmashell /PlasmashellevaluateScript ‘lockCorona(!locked)’ passed through an SSH login. Unlocking happens by changing the part between the brackets with (false).

Now, I am looking to keep this system up-to date so I want to migrate it to Plasma 6 in the near future, but this command no longer works (the evaluateScript isnot a part of Plasma 6).
Is there another way I can achieve the same effect (I looked into Kiosk mode but can’t see how that would fit my goal), or is it possible to migrate this evaluateScript to Plasma 6?
Thanks in advance for your help!

The command still works for me on plasma 6.0.2 (I see Add widgets or Edit mode gone/greyed out) I just changed qdbus to qdbus6

Thank you Louis. That makes so much sense :grinning:

You have just saved me from a lot of worry…

Thank you so much.

You’re welcome! I found about this after seeing some of my scripts that used qdbus falling :upside_down_face:

Yeah, I just finished that machine I built a month ago and figured I should get myself future-proof :slight_smile:
Version 2 will be updated to Plasma 6.

I once again thank you for your help, I will close the query as not to pollute the forum with chatter.

Thanks again!

Just tried the below and as you ca see it doesn’t work.

 qdbus6 org.kde.plasmashell /PlasmashellevaluateScript ‘lockCorona(!locked)’       ✔  08:47:56 AM 
zsh: event not found: locked)’

OP’s command is using the curly quote symbols or whatever that thing is, this should work:

qdbus6 org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'lockCorona(!locked)'
1 Like

Is there a way to lock down ALL Plasma settings, panels, widgets, etc… within a normal user session?

EDIT:

I just notice the post above this one does that last through logoff and reboot, or does it have to be done each time? If it last through logoff and rebook what’s the command to disable it if I need to? Thanks

if you change the (!locked) with (false) it will unlock.
I just have the two commands in very simple scripts I have stored in /home, and run them from a different TTY (i.e. I switch to TTY5 with , log in, run whichever of the two scripts I want, exit the TTY, switch back to TT7 where the GUI lives

so to lock the script looks like this:

#! /bin/bash
qdbus6 org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript ‘lockCorona(!locked)’
exit

and to unlock:

#! /bin/bash
qdbus6 org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript ‘lockCorona(false)’
exit

That’s all

1 Like

Thanks tested and works perfectly, very much appreciated. Now I just need to be able to lock ALL settings in one command under System Settings.

So no way to lockdown System Setting in one go?

What you could do is use a launcher plasmoid (like “Run”) and make it execute the lock script.
Put it on the panel with a little lock as an icon and you’re set.
You could even use the “scriptinator” plasmoid, and have it change its icon from an unlocked state to a locked state when you run the lock script.

Sorry but completely Greek to me.

OK, you’re on some form of linx with KDE Plasma desktop.
Open a text editor, make a file called lock.sh
paste the following text in the file:

#! /bin/bash
qdbus6 org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript ‘lockCorona(!locked)’
exit

save the file somewhere convenient, right-click it and in the “properties” menu look for “permissions” and move the slider that says “allow executing file as a program”.

Right- click on your desktop, “enter edit mode”, add widget. Look for a widget called “Run”, if you don’t have it installed download it from the store (top right hand corner of that window).
Add the “Run” widget to your desktop, place it somewhere convenient. Exit edit mode. Right click the Run widget, pick an icon you like and in the field where it says" Command" enter the full path to the .sh file you created above.

Now, if you click that button you just made it will lock all settings on your desktop. Including the widget you just made.

The only way to remove the lock is to hit , log in and enter this:
qdbus6 org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript ‘lockCorona(false)’

If you have no idea what this all means you might want to stay away from this method until you do, because it can become confusing how to unlock the system