SUMMARY Many KDE components and applications that use KConfig and KConfigXT allow you to override default settings via XDG configs (ini files ending in rc). For example, this way a system administrator can change the default settings by `/etc/xdg`, or `.config/`. But it seems that plasmoid applets do not support XDG configs (like `kickoffrc`). The default values are written in the file along with the package in the file main.xml. So, if you need to customize the default settings of applet configuration, you need to edit this main.xml manually. But if you edit the configuration template (xml) files directly, then usually such changes are not saved, as they are replaced when updating the package in the distribution. Accordingly, to change the configuration, you will either have to fork the applet with the changed configuration, or make some complex mechanisms with triggers that will change these files after updating the applet in the distribution, which is undesirable. POSSIBLE SOLUTIONS I tried to get around this without major modifications. 1) The first idea was to somehow change the default values for the elements of the loaded configuration. But unfortunately, KConfigLoader does not allow this behavior to be changed, it parses the xml file manually and immediately saves it in KConfigSkeleton, which in turn also does not have methods for changing the default values for its elements. More precisely, there is a swapDefault() method of skeleton item, but calling such methods will lead to changes in the user `plasma-org.kde.plasma.desktop-appletsrc`. 2) Another option is to somehow change the XML file right before loading it into KConfigLoader. In general, this is possible, but for this I need to make some kind of custom parser that will do this. It would be nice, if there were a method in KConfigLoader or KConfigSkeleton that would allow specifying a KConfig (which would be read from XDG directories) that would contain overridden values, and these values would merge and replace the default overridden ones in this KConfigSkeleton. So far, the only thing I could do without major changes was to add the ability to read custom xml files in XDG_DATA_DIRS (/usr/share, /usr/local/share, ~/.local/share/) directories, like `/usr/share/applets.kcfg/org.kde.plasma.kickoff.kcfg`. Accordingly, allowing system admins and users to customize the standard applet settings by this. It looks like customization of elements in the control panel in Dolphin (where they are set by kxmlgui5), but all this is of course just a temporary workaround. Accordingly, I decided to write about this to raise this issue. Perhaps this issue has already been raised somewhere, I apologize in advance if this is a duplicate. OBSERVED RESULT Plasmoid applets do not support configuration customization via XDG configs (/etc/xdg and rc files). EXPECTED RESULT Plasmoid applets do support configuration customization via XDG configs (/etc/xdg and rc files), like other KDE system components and applications.
Please see https://develop.kde.org/docs/plasma/scripting/ You can run hooks on first run or on new applet creation.
(In reply to David Edmundson from comment #1) > Please see https://develop.kde.org/docs/plasma/scripting/ > > You can run hooks on first run or on new applet creation. To be honest, I didn't quite understand how to hook to the creation of a new applet? But by the way, as far as I know, these scripts will change the values in the `plasma-org.kde.plasma.desktop-appletsrc` file in the same way as if they were changed by the user himself. And this differs from the default values in the sense that if the system administrator or system integrator then makes new changes to the default configuration of applets, they will not automatically change for the user, since old values will be explicitly written in `plasma-org.kde.plasma.desktop-appletsrc'. And it will be difficult to distinguish which values were set by the scripts last time, and which values were set by the user himself. But if we change the default values in main.xml, then it will automatically upload new changes for the default settings, unless the user has manually set their own value through the interface, which is saved in `plasma-org.kde.plasma.desktop-appletsrc`.