As described here: https://bugs.kde.org/show_bug.cgi?id=217950#c47 , the D-Bus interface org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript always returns an error if the plasma shell is in "locked widgets" mode. Running the same script from the plasma interactive shell console still works, even if the widgets are locked. Example: $ qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'var test=1;' Error: org.freedesktop.DBus.Error.Failed Widgets are locked
Code goes out of it's way to explicitly check, it's not a code bug. Whether the design choice is sensible is another question. There's not much rationale at the time: https://git.reviewboard.kde.org/r/125648/ What did you want it for?
(In reply to David Edmundson from comment #1) > What did you want it for? Exactly the reason stated in the change request linked in my first commit - set the wallpaper from an application. If this is the stated reason, I don't understand why not enable it when widgets are locked - so I may only script plasma if I'm willing to have my widgets more all over the place?
>so I may only script plasma if I'm willing to have my widgets more all over the place? They don't move all over the place. The handles on mouseover is something that disappeared years ago. You can only edit things if the user has set you can edit things... which has some sane rationale. I'll make a patch and put it on review and see what happens.
Git commit ddf452b6774f481ced47f9551e4a961622194646 by David Edmundson. Committed on 20/03/2018 at 16:26. Pushed by davidedmundson into branch 'master'. Don't block evaluating DBus scripts if widgets are locked. Summary: Original decision didn't really have a rationale: https://git.reviewboard.kde.org/r/125648/ It's causing bugs in people doing somewhat sensible things. If widgets are locked, the script will still fail when it tries to do something it can't. Reviewers: #plasma, broulik Subscribers: mart, broulik, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D11375 M +1 -1 shell/shellcorona.cpp https://commits.kde.org/plasma-workspace/ddf452b6774f481ced47f9551e4a961622194646
With this patch I can no longer change the wallpaper via qdbus with or without the widgets locked. Even with the widgets unlocked, I get this result: qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'var allDesktops = desktops();print (allDesktops);for (i=0;i<allDesktops.length;i++) {d = allDesktops[i];d.wallpaperPlugin = "org.kde.image";d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General");d.writeConfig("Image", "file:/home/user/wallpaper.jpg")}' Error: org.freedesktop.DBus.Error.Failed Widgets are locked I think that the logic in the patch it's wrong. I modified in shell/shellcorona.cpp if (immutability() != Plasma::Types::SystemImmutable) { for if (immutability() == Plasma::Types::SystemImmutable) { And then it works as intended I can change the wallpaper via qdbus with the widgets locked and unlocked.