mcs to xfconf migration

Brian J. Tarricone bjt23 at cornell.edu
Fri May 9 20:50:29 CEST 2008


Hey all,

Over the past month or two, Stephan and I have been working to get 
Xfconf in shape for 4.6, and we're making some really good progress. 
I've started working on migrating settings from MCS to Xfconf, and I 
have a little bit of a dilemma as to how to make it all work.

So far I have perl scripts (generally one per module; so xfdesktop would 
install one, xfwm4 would install another, etc.) that manually parse the 
MCS XML files (I think it's reasonable to require the XML::Parser perl 
module), and then use xfconf-query (our command-line tool to get and set 
Xfconf config properties) to migrate the settings.  This seems to work well.

Of course, I don't want people to have to run these manually, and I 
don't want the individual modules to have to check on startup for 
$XDG_CONFIG_HOME/xfce4/mcs_settings/foo.xml every single time and 
possibly initiate migration.

One option I thought of is to use the autostart mechanism.  Each module 
that installs a migration script can install an autostart file to the 
system autostart location.  On first run, the migration script will get 
run.  The last thing each script will do is copy the autostart file to 
that user's per-user autostart directory, but set Hidden=true in the 
copy so future startups cause the system-wide file to be ignored.

This sounds decent to me, and avoids putting annoying migration code 
into the applications themselves (like we did for the xdg basedir 
migration for 4.2... code which I think we should remove for 4.6).  It's 
possibly a little faster to put the code in the apps, since all it has 
to do is a stat() to see if it should do the migration, whereas the 
session manager has to parse .desktop files on startup each time.  But I 
think the autostart method is a much cleaner way of doing it.

Anybody have any thoughts?  A better way of doing it?

	-brian



More information about the Xfce4-dev mailing list