Default Program | File Association

Alexander Larsson alexl at
Fri Jan 25 04:18:13 PST 2008

On Fri, 2008-01-25 at 13:10 +0100, nf2 wrote:
> > This is up to the distribution/sysadmin/user to handle. If you want to
> > do some kind of desktop-specific handling you can just add a desktop
> > specific directory to the XDG_DATA_DIR env var. And for extremely
> > specific things you can use OnlyShowIn/NotShowIn.
> >
> > Doing it with two different files is a very bad idea. I mean, what file
> > would a third party app use? And why should a kde and a gnome app
> > running in the same session launch different apps for the same files?
> >   
> I meant the opposite. Regardless which stack an application links to 
> (GIO, kdelibs,...), the defaults.list flavor would be picked according 
> to the currently running desktop. But perhaps setting XDG_DATA_DIR would 
> also work. I just wanted to address the situation where users have 
> multiple desktops installed and for instance would expect something like 
> GEdit to be default on GNOME and KWrite on KDE. You can't use 
> OnlyShowIn/NotShowIn for this, as some GNOME users might want to use 
> KWrite or vice versa. Perhaps a DefaultIn= desktop entry key would also 
> be an option...

OnlyShowIn etc are not used for things like KWrite, just for things that
are very desktop specific, like desktop preferences and similar apps.

Since there is only one set of defaults.list (exactly which ones
depending on XDG_DATA_DIR) all apps get the same associations, and there
is no problem with figuring out what the "currently running desktop" is.

More information about the xdg mailing list