System values for panel plugins with Xfconf

Graeme Gott graeme at gottcode.org
Thu Oct 21 15:43:49 CEST 2021


Hi,

I am considering switching Whisker Menu to Xfconf, but one thing I have 
not been able to determine: can panel plugins have general system values?

The simplest way I could find to set system values for a panel plugin in 
Xfconf was to put values under a property with name="plugin-$ID" in the 
file "/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml". But 
that is obviously linked to a specific panel plugin ID, and there isn't 
a way to predict what the plugin ID will be. It also won't work if the 
user adds more than one instance.

The method I settled on instead is a bit of a hack; have a separate 
channel other than the xfce4-panel channel that all plugins use. Use 
this separate channel only for loading the system values at plugin 
start, then disconnect from it and connect to the regular xfce4-pannel 
channel instead. This wouldn't detect any changes to the system values 
until plugin restart, but those are usually set up once at install time.

This separate channel would be used by distributions to preconfigure 
Whisker Menu instances. That is better than making them patch Whisker 
Menu to change the default values, which is what they did before I added 
support for the "defaults.rc" file.

I suppose I could just keep loading the file "defaults.rc" before 
anything else. The code for reading from RC files would have to stay 
around indefinitely anyway for migrating users to Xfconf, but it just 
feels cleaner if I can use Xfconf for both the user settings and the 
system values. Especially when I add new settings--I would want them to 
be only in Xfconf.

I want to make sure that I'm not missing something and that the separate 
channel is actually necessary.

Cheers,
Graeme
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://mail.xfce.org/pipermail/xfce4-dev/attachments/20211021/b07090f3/attachment.sig>


More information about the Xfce4-dev mailing list