Have a way to dynamically change software associations at distribution level

Stanislav Brabec sbrabec at suse.cz
Wed Aug 26 08:16:34 PDT 2009


Alexander Larsson wrote:
> On Tue, 2009-08-04 at 09:16 +0200, Didier Roche wrote:
> > What do you think about it? I only take a look at glib (more
> > precisely, the gio module) and update-mime-info and the code to write
> > to achieve that goal seems minimal.

I just wrote a proof-of-concept of update-mime-database, which
implements a heuristic to generate the defaults.list from the list of
all available desktop files and additional meta-configuration. It's easy
to add support for DesignedFor= (which is much better than
InitialPreference without knowing the desktop which should prefer the
application).

I have the following idea:

Use defaults.list in all desktops.

Patch tools to use prefixed defaults.list. We can use for example
XDG_DESKTOP_PREFIX or so to use e. g. gnome-defaults.list.

Run update-desktop-database to generate all *desktop.list files using
all available desktop files.

Heuristic code. (Incomplete, heuristic works except "Inherit" keyword,
but files are read and written from $PWD).
http://pack.suse.cz/sbrabec/mime-types/

Example of meta-configuration desktop-defaults.conf:

[Desktop Defaults]

[GNOME]
XDG_DESKTOP_PREFIX=gnome-
Categories=GNOME;GTK
Inherit=GTK
Preferred=eog.desktop;banshee-1.desktop;
Default=eog.desktop;evince.desktop;gedit.desktop;file-roller.desktop;nautilus-folder-handler.desktop;MozillaFirefox.desktop;
image/tiff=eog.desktop

[GTK]
Categories=GTK

[Moblin]
video/x-ms-asf-plugin=moonshine.desktop
video/x-msvideo=moonshine.desktop
Inherit=GNOME

[KDE]
Preferred=amarok.desktop;konqueror.desktop;
Categories=KDE;Qt

etc.

This will actually fix very ugly problem Opening GNOME applications from
Firefox in KDE instead of native KDE applications.

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: sbrabec at suse.cz
Lihovarská 1060/12           tel: +420 284 028 966, +49 911 740538747
190 00 Praha 9                                  fax: +420 284 028 951
Czech Republic                                    http://www.suse.cz/



More information about the xdg mailing list