https://bugs.kde.org/show_bug.cgi?id=469061

Niccolò Venerandi <nicc...@venerandi.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WORKSFORME
             Status|CONFIRMED                   |RESOLVED

--- Comment #5 from Niccolò Venerandi <nicc...@venerandi.com> ---
Hi! I'm back. This approach isn't super easy, but I do believe I have a
solution here.

> One requirement for me is to NOT modify any file provided by packages, so 
> that my customization remains after packages upgrades

I believe you can install layout packages to
`/home/niccolove/.local/share/plasma/layout-templates/` and you won't have any
problem there.

> On the other end, how could we modify widgets default settings? For example, 
> as I said in my original message, how could we:
> - add or remove programs in `org.kde.plasma.icontasks`
> - disable clipboard by default in `org.kde.plasma.systemtray`

You can do that thanks to the scripting "config" settings. If you open
`~/.config/plasma-org.kde.plasma.desktop-appletsrc` you will see the current
configuration of all of your panel and widgets. When you create the applet
objects for the panel, you can handle its config values either through its
config properties (configKeys, configGroups, globalConfigKeys,
globalConfigGroups); for some reason the readConfig and writeConfig calls are
not exposed to the JS scripting, but that can be changed. You can also create a
config group object, which is able to open a file
(plasma-org.kde.plasma.desktop-appletsrc, which again contains all the config
you need to change), enter its configuration groups (you can find the right
ones since you should have the id of the panel and applets you just created)
and write to those config. Sadly there's no dedicated documentation about this,
but you can see all the classes that handle these things here:
https://invent.kde.org/plasma/plasma-workspace/-/tree/master/shell/scripting

The ones you're particularly interested in are widget, applet, containment, and
configgroup. I'd be open to better documenting this process and making the API
a bit easier to use.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to