System values for panel plugins with Xfconf

Graeme Gott graeme at gottcode.org
Fri Oct 22 14:49:03 CEST 2021


> Setting defaults/fallbacks in the plugin itself in combination with distros
> being able to ship defaults so far covered all of my use cases.
> 
> Happy to hear though if there are shortcomings!

But how are the distros able to ship defaults for the plugins? That's 
where I'm getting lost. The way Xfconf handles setting system values 
works great for setting defaults for Thunar, Ristretto, etc, since they 
all have their own XML file to populate.

All panel plugins share the same channel. They are all stored in the 
xfce4-panel.xml file together, and are only identified by plugin ID. It 
becomes part of their property names (since their real properties are 
things like "/plugins/plugin-1/favorites" and not just "/favorites"). 
But the plugin ID can be anything!

For example, if the distro assumes Whisker Menu is plugin ID 1, then the 
defaults won't be loaded if the user adds a second Whisker Menu. They 
also won't be loaded if the user removes Whisker Menu, adds something 
else, and then changes their mind and adds Whisker Menu back. It won't 
have ID 1 anymore. The plugin will be looking at some other 
"/plugins/plugin-$ID/favorites" property instead.

Is there some mechanism in the Xfconf defaults I'm missing? Some way the 
panel handles translating the defaults to some other property path to 
share among instances of the same plugin type?

Cheers,
Graeme


More information about the Xfce4-dev mailing list