Common configuration namespace
Thomas Leonard
tal00r at ecs.soton.ac.uk
Sun Apr 18 14:57:02 EEST 2004
On Sat, Apr 17, 2004 at 09:18:38PM +0200, Claes Holmerson wrote:
[...]
> Define a common hierarchical namespace. Something like
>
> /desktop/kde/...
> /desktop/gnome/...
> /desktop/common/...
I guess this should really be URI based to avoid conflicts, eg:
/freedesktop.org/window_manager/...
/freedesktop.org/mime/...
/gnome.org/nautilus/...
/kde.org/konqueror/...
> Provide API in each individual config framework to let applications refer
> to their config data with keys in this format. Encourage developers to use
> these keys rather than any other way to fetch their config data. (Don't
> work with files directly, etc). Put things that are agreed upon and can be
> shared in the "common" namespace.
Quite possibly, the per-desktop API would just prepend the desktop's
namespace to the key, so that
gnome_config.get("apps/eog")
is the same as
fdo_config.get("gnome.org/apps/eog")
> Then, over time, hopefully each config framework can be ported to a common
> access mechanism, without affecting applications too much. Perhaps there
> will never be a single storage format, but different to choose from,
> depending on the situation. It can be implemented in everything from a
> single XML file, to GConf, Linux Registry or LDAP.
> I guess my point is that since a certain library probably not can be
> agreed upon for a long time, use a common key namespace as API instead.
I think we need to create a library with a plugin system for the backends
as well. Then, a system daemon can do:
config = fdo.Config("system")
max_connections = config.get("apache.org/apache2/max_connections")
Here, "system" is the name of a profile ($XDG_CONFIG_DIRS/profiles/system) which
contains:
libconfig-ini.so /var/lib/registry
libconfig-ini might be a library for non-notifying .ini-file registries. You
could also have libconfig-linux-registry.so, of course.
A desktop app would do:
config = fdo.Config(NULL) # use default profile
dclick_time = config.get("freedesktop.org/xsettings/Net/DoubleClickTime")
This would read $XDG_CONFIG_DIRS/profiles/user (or
$XDG_CONFIG_DIRS/profiles/$XDG_PROFILE), which might be:
libconfig-db3.so user
or
libconfig-sql.so postgres:server.com
or
libconfig-gconf.so
etc
Perhaps older apps could use this with a special plugin:
config = fdo.Config("Config4GNU")
default_runlevel = config.get("freedesktop.org/C4G/init/initdefault")
Or maybe you'd have a switcher-plugin that called the C4G plugin
automatically for that namespace.
--
Thomas Leonard http://rox.sourceforge.net
tal00r at ecs.soton.ac.uk tal197 at users.sourceforge.net
GPG: 9242 9807 C985 3C07 44A6 8B9A AE07 8280 59A5 3CC1
More information about the xdg
mailing list