Proposal: Inharitance for Desktop Entry Spec

洪任諭 at
Thu Apr 17 05:52:01 PDT 2008

> > Combining all desktop files with the same name is a good idea.
>  > However, this doesn't solve the problem where two different files are
>  > only different from Exec key, such as the case of synaptic.desktop and
>  > synaptic-kde.desktop.
>  > Having to copy the whole files just to modify one line is apparently
>  > not a good idea.
>  > This is why I think inheritance is needed.
> No, you misunderstand:
I totally understand what you said.
>  for your example this would give a synaptic.desktop as is now, and a
>  synaptic-kde.desktop which only the the exec key in a higher priority
>  basedir.
>  You then use the exact same mechanism as now with the sole difference that
>  the granularity would be per-key instead of per-file.
>  In other words instead of searching for the highest priority basedir that
>  has the .desktop file in question and using only the keys in that file.
>  You would check the basedirs for each key in the desktop file, taking the
>  value from the highest priority basedir where the key is present.

The problem is, currently synaptic.desktop and synaptic-kde.desktop
are put in the same dir. In this way you proposed, some
desktop-specific files should be put in dirs with higher priority.
That means, all desktop environments should export their own
XDG_DATA_DIRS to put their applications directory before the other
ones to get the top priority. Otherwise things will broken. This is
not a bad idea but it make things more complicated.
However, I agree this approach is much cleaner then current
implementation using duplicated desktop files with different names.
Also, your proposal is easy to implement, too.
Anyway, current desktop entry spec should be fixed as soon as possible
since this is a real issue and the current spec doesn't work well.

Thank you for the nice idea.

More information about the xdg mailing list