Xfconf — A New Configuration Storage System
I suppose others have written in broad terms about Xfconf, Xfce 4.6’s new configuration storage/retrieval system, but I guess an in-depth explanation is overdue and is probably up to me.
First, some background.
Xfce has used a configuration system called MCS (Multi-Channel Settings) for some time now, since 4.0 was released near the end of 2003. It’s inflexible and very monolithic. Only a single application (xfce-mcs-manager) is allowed to actually modify settings; all other applications can only query values. That means that the GUI settings dialogs have to run in the xfce-mcs-manager process. The GUI dialogs are implemented in shared libraries that are linked into the xfce-mcs-manager process at runtime. To add more confusion as to its purpose, xfce-mcs-manager also acts as an XSETTINGS manager, automatically proxying the settings stored in a “special” channel.
I had a few loosely-defined goals when designing Xfconf.
- Keep the familiar “channels” concept from MCS, but make the namespaces for settings storage inside channels hierarchical.
- The configuration storage daemon should be able to run without a GUI environment, and the client library shouldn’t have GUI dependencies.
- Get the XSETTINGS manager out of the configuration daemon.
- Integrate “kiosk mode” functionality directly into the configuration storage mechanism.
- Native support for arrays/structs in the configuration store.
- Provide a client library that’s easy to use and exposes commonly-used functionality.
- No client application is special: any app can read or write any setting.
There were probably others, but those seem to be the ones that stick out in my mind after the fact.
MCS used a protocol involving a special X window, X selections, and X window properties to pass settings around at runtime. Obviously this kind of thing isn’t suitable for a configuration system that can run without a GUI, or even on a non-X11 system. So, that was right out. Given momentum over the past couple years, D-Bus seemed to make the most sense as an IPC method. So, the D-Bus API for Xfconf was born. (Please note that I don’t consider this frozen until we release 4.6.0 final. I’ll do my best not to remove or change existing interfaces, though.)
The rest of the story might sound rather gconf-like, and I guess it probably is. There’s a settings daemon (xfconfd) and a client library (libxfconf). Apps use the client library to fetch settings from and store settings to xfconfd. The daemon stores the settings on disk in a format of its choosing and manages the D-Bus interface. D-Bus gives us a few nice things for free; for example, xfconfd starts via D-Bus activation, so there’s no need to include it in any startup scripts or have client applications specifically start it. D-Bus also ensures that two instances of xfconfd aren’t running, fighting over the config store (well, unless you start a separate session bus daemon).
As for settings themselves, you have a channel that holds an arbitrary number of hierarchical properties. Channel names are simple ASCII text strings, like “xfwm4″ or “xfce4-desktop”. Property names look a bit like path names and are, as I said, hierarchical. You can use this to logically organise properties inside your application. Xfdesktop is a good example of this, prefixing menu-related preferences with “/desktop-menu/” and backdrop-related prefs with “/backdrop/”. Xfwm4 is a terrible example of this, with all preferences prefixed with “/general/” for no apparent reason.
Anyhow, we support a variety of different data types: basically all of those supported and marshalable by dbus-glib, plus special 16-bit signed and unsigned types (though those two are pretty hacky at the moment and I’d like to be able to do those in a better way). The client library, libxfconf, lets you set commonly-used data types directly, and also has a generic interface for setting the others.
One thing I really like about libxfconf is its incredibly flexible support for array properties. Any property can be set to an array of values rather than a single value. The values in the array need not even be of the same type. Libxfconf has native support for setting array types, and also can directly map C structs to and from array types, automatically.
A final bit of usefulness is in libxfconf’s bindings mechanism. Libxfconf can “bind” an Xfconf property to a GObject property in your application. If the GObject property changes, then libxfconf will automatically update the value in the Xfconf store. If the value in the Xfconf store changes, libxfconf will automatically update the GObject property. This can greatly simplify the Xfconf code in your application. In your settings dialog, you simply have a single line of code to — for example — connect a GtkCheckButton’s “toggled” property to a boolean Xfconf property. If the user toggles the checkbox, Xfconf gets updated automatically. If the setting gets changed outside the application somehow while the settings dialog is open, the dialog gets updated automatically too. You can also use this functionality on the other “end” of the equation, too: if you use GObjects in your application, and your settings map to GObject properties on those objects, you can bind the properties there, too, and not have to manually take action when the user sets a setting in the settings dialog. Unfortunately, libxfconf only supports setting scalar properties now (not arrays), except for the special case of the GdkColor struct. Hopefully this will change in a future release.
We also include an “xfconf-query” application in the xfconf package, written mostly by Stephan Arts, which is a simple command-line Xfconf client. As you might guess, you can use it to query the values of Xfconf properties from the command-line, or from scripts. However, despite the “query” part of its name, it can modify Xfconf properties as well.
In Xfce 4.4 and below, we had the “XfceKiosk” system, which would allow you to lock down a desktop install so certain settings can and can’t be changed by particular users. It worked decently well, but was sometimes confusing to configure, and the application had to do special things to support it. Xfconf integrates a “locking” system whereby the system administrator can install a normally-formatted Xfconf configuration file with directives that instruct xfconfd to consider some properties unmodifiable by the user (and allows the sysadmin to set defaults too). This takes the burden away from applications to support a particular locking framework, as it’s natively built into the configuration system. (Unfortunately, as of this writing, the locking system isn’t working properly. It’ll definitely be finished by 4.6.0 final.)
So, I guess that’s it. If you’d like to get started with Xfconf, a good place to look would be the API documentation (please note that the API will not be frozen until 4.6.0 final). Otherwise, feel free to ask questions on the xfce4-dev mailing list.
Spread the word about Xubuntu
Xubuntu 8.10 is coming, and the world needs to know it!
To make this easier for you, Pasi Lallinaho (Xubuntu’s marketing lead) has prepared an image that shows how many days are yet to come before 8.10 will be released.
And that’s where you come in to play: show the image on your own website, blog, profile page or whatever, by including the following HTML code:
<a href="http://xubuntu.org" title="Learn more about Xubuntu..."><img src="http://xubuntu.org/xubuntu-static/intrepid-countdown/index.php" alt="Countdown to Xubuntu (xubuntu.org) 8.10, by Pasi Lallinaho"></a>
Let’s introduce many more users to the wonderful world of Xubuntu
News and Xubuntu HugDay
There are only ten days left until the first beta release of Xfce 4.6 and we still got a lot of things to do. Over the past week(s) we’ve been working on new features in xfwm4, xfce4-session and xfce4-appfinder mostly.
Olivier added NET_WM_PING support to xfwm4. This means you can now kill applications which are not responding using a dialog that pops up after a few seconds – great! As a funny coincidence I was just browsing the xfce4-dev mailing list archives a few days ago when I found one of my first posts there which was about a similar feature.
About one or two months ago Auke Kok posted a patch for parallel application startup for xfce4-settings on the mailing list. Brian now took the time to implement it and finally committed it yesterday. It notably speeds up the Xfce startup process.
When we tried to fix the main xfdesktop crash which we thought to be related to libxfce4menu a few weeks ago, I tried to reproduce it by adding ThunarVFS monitoring support to xfce4-appfinder and see if it would crash as well. My modifications were pretty rough and I decided to rewrite the appfinder to make its code more readable and flexible. I’ve been working on this for the last two days and comitted it today. I’ve used recordMyDesktop to record a video presenting the new features again, but this time I also recorded my (creepy) voice! It’s awful to hear how long it took me to pronounce “freedesktop.org menu specification compliance” and how I sucked at mentioning the name of the library it’s based on: “libxfce4menu”. Apart from that I’m glad it worked, so I can continue to plan the video series for 4.6.
On to something else: Last week I’ve been announced the official Xubuntu Xfce4 Liaison and I completely forgot to announce that on the mailing lists … anyway, this reminds me of the topic of this post: today is Ubuntu BugDay with special focus on Xubuntu. If you’re interested in getting things fixed in Xfce 4.4.x or Xubuntu in general, you’re welcome to take part by hugging a few bugs!
That’s it! I’ll try to keep you posted on news about the beta release.
Cheers,
Jannis
Edit: I already fixed the categories problem as you can see here.
Weekly news? Nah.
Last weekend we finally released Pinkie. While the reactions on news sites and forums have been quite mixed (as expected) we surprisingly received some very positive feedback from GNOME for xfconf. To me this gives proof that we did the right thing for 4.6. When we discussed the original design proposal for a D-Bus based settings daemon, we also took gconf and dconf into consideration. We decided to write xfconf instead for one reason in particular: Time. We wanted to have this concept in 4.6 and we didn’t want to wait for others to finish their work. Today this sounds reasonable as GNOME still seems to be struggling with dconf. Anyway, we appreciate the feedback and maybe we can cooperate on this one in the future.
So what happened this week, after the long awaited alpha release? The first thing I did was to merge the support for embedded settings dialogs into trunk. Most of the Xfce settings dialogs appear inside the main settings dialog now (as demonstrated in this video). Those which do not support this feature just pop up as usual. We’re using the new X-XfcePluggable key in .desktop files to announce support for this feature. This way it’s pretty easy for third parties to embed their own dialogs.
Stephan continued working on his graphical settings editor for xfconf. He and Brian also moved xfsettingsd into xfce4-settings. From now on xfconf will contain non-UI code only. As always our amazing translators comitted translation updates. I finally added xfconf support to the new mixer. Then, yesterday, Brian fixed our number one bug: xfdesktop used to crash almost everytime the contents of a directory monitored by xfdesktop/libxfce4menu changed and the desktop menu was regenerated. I’m glad this turned out not to be a reference counting bug in libxfce4menu but a very difficult to track down race condition inside xfdesktop. And Brian found it!
Today, I started planning the goodies installer for 4.6. We had different graphical installers for the 4.4 series and I’d like to continue that starting with the first release candidate of 4.6. I asked all maintainers to add their goodies to the list if they are still maintaining them and if they consider their goodies stable. I also wrote down my plans on a video series for 4.6. I recently tested the audio support of recordMyDesktop and it seems to work pretty well, so I thought it would be nice to introduce users and developers to the new release by recording some video presentations and tutorials during the release process.
So, this is it for now. Tomorrow I’ll be visiting my family for a couple days which gives me enough time to fix a few remaining things and get my components in shape for the beta. I’ll keep you posted!
Edit: Oh, what I completely forgot to mention: It’s great that gnomefiles.org is back! But this is even better:
Best Rated: 1. Thunar 9.39 2. catfish 9.38 3. midori 9.37 4. Xfce 9.36
A very minimal desktop
I discovered a really nifty trick the other day, one that makes for a pleasant work environment and that fills the need for a launch area of some kind. It basically eliminates the need for iDesk, too.
While you may be aware that Xfce can draw the usual home, trash, and volume folders directly on the desktop, it can also do things with the icons on the desktop. Like . . . use them as application launchers.
Open up a browser, and drag a .desktop entry from /usr/share/applications onto the desktop. Presto, there's your application launcher. Much larger than the usual miniscule panel icon sizes, too. The downside is that you can't drag items directly from your Xfce menu, but as long as you know where they come from, you can add any launcher you want. A bit of tinkering results in the following:
Who needs a panel, when the desktop launchers, right-click desktop menu, and keyboard commands work just fine? Unless you really need one, of course. It's almost like the ever-popular spartan Openbox + iDesk combination. Xfce distilled to its finest essence. Thank goodness for flexibility.
A very minimal desktop
I discovered a really nifty trick the other day, one that makes for a pleasant work environment and that fills the need for a launch area of some kind. It basically eliminates the need for iDesk, too.
While you may be aware that Xfce can draw the usual home, trash, and volume folders directly on the desktop, it can also do things with the icons on the desktop. Like . . . use them as application launchers.
Open up a browser, and drag a .desktop entry from /usr/share/applications onto the desktop. Presto, there's your application launcher. Much larger than the usual miniscule panel icon sizes, too. The downside is that you can't drag items directly from your Xfce menu, but as long as you know where they come from, you can add any launcher you want. A bit of tinkering results in the following:
Who needs a panel, when the desktop launchers, right-click desktop menu, and keyboard commands work just fine? Unless you really need one, of course. It's almost like the ever-popular spartan Openbox + iDesk combination. Xfce distilled to its finest essence. Thank goodness for flexibility.
Xfce Mailwach Plugin 1.1.0 Released
After a good two and a half years of being lazy, I’ve finally found some time to work on the Mailwatch plugin, and I have a new release ready too!
There’s lots of chewy goodness in this release. Here are some useful links:
As always, please report bugs over at the Xfce bug tracker.
Enjoy!
Xfce Mailwach Plugin 1.1.0 Released
After a good two and a half years of being lazy, I've finally found some time to work on the Mailwatch plugin, and I have a new release ready too!
There's lots of chewy goodness in this release. Here are some useful links:
As always, please report bugs over at the Xfce bug tracker.
Enjoy!
Xfce Mailwach Plugin 1.1.0 Released
After a good two and a half years of being lazy, I’ve finally found some time to work on the Mailwatch plugin, and I have a new release ready too!
There’s lots of chewy goodness in this release. Here are some useful links:
As always, please report bugs over at the Xfce bug tracker.
Enjoy!
Xfce announces alpha release of version 4.6
After about a year and a half of development, the Xfce team has announced the alpha release of Xfce 4.6, codenamed “Pinky” “Pinkie”.
Xfce is the desktop environment and main reason for the existence of Xubuntu. It provides the file manager, panels and much more, keeping your desktop fast yet easy to use. Thus, Xfce is one of the most important parts of Xubuntu, and the 4.4 release has been enjoyed by many users of Xubuntu since it was released.
Obviously, the 4.6 release will be very significant for Xubuntu, and this is an important milestone in the road towards that release. While it was initially hoped that this release would make it into Xubuntu 8.10 (codenamed “Intrepid Ibex”), the Xfce release schedule suggests that, with three beta releases and two release candidated still scheduled, that target won’t be met. However, you can expect to see the new release in Xubuntu 9.04 (codename “Jaunty Jackalope”), and if you’re running 8.10 you can try the alpha release by adding the xubuntu-dev PPA to your software sources. (Note: at the time of writing this the packaged version is not this actual alpha but a version before that, however, this alpha will be packaged soon.)
The new version of Xfce comes with many new features. Xfce now has a new configuration backend called xfconf, similar to gconf, but simpler and easier to work with. This brings more flexibility and better integration between Xfce components. You can now control your desktop settings through the command-line – this is not only handy for people helping on IRC (i.e. there is no more need to guide the user through all kinds of settings dialogs – though, IMHO, that would be less confusing for the user), it also means automated scripts can easily update your settings. One use I see for this is being able to change your keyboard layout using a key combination, an oft-requested feature by programmers.
Speaking of key combinations: the confusing keyboard shortcut-themes have been removed and conflicts between keyboard shortcuts and window manager shortcuts are now easily resolved. All these new settings also come with updated settings dialogs, which can be started standalone as they are now, but also embedded into the settings manager – a feature of which Jannis made a screencast.
Furthermore, Xfce now ships libxfce4menu. This is a software library aiming to implement the menu standard also implemented by GNOME and KDE and partly implemented by Xfce 4.4. While it is currently in use only by the desktop and the Appfinder (the latter of which has been completely rewritten to support libxfce4menu), it paves the way for a proper menu plugin in the panel that you can actually edit.
Apart from the libxfce4menu support, the desktop manager xfdesktop has also received a few small improvements over the previous version. It has a redesigned preferences dialog, includes a few more options for the desktop background (such as colour saturation adjustment), and can now automatically start and stop managing a new desktop when you respectively plug or unplug a monitor.
Finally, the Xfce mixer plugin has been completely rewritten to use gstreamer. One effect this has is that Xubuntu will probably definitely be switching to gstreamer-based applications (Xubuntu used to include a xine version of Totem, the movie player, but recently switched to the gstreamer-based version). The biggest benefit this brings users is that it will automatically ask to search for additional media support when it is not installed yet, which happens e.g. when you try to play an MP3-file on a freshly installed Xubuntu.
All in all, though not as big as 4.4 was, this is shaping up to be another fine release of Xfce that has me looking forward to it.


