Proposed improvement to the Desktop Entry Specification: Relative icon paths

Patryk Zawadzki patrys at
Tue Sep 23 01:06:36 PDT 2008

On Tue, Sep 23, 2008 at 10:01 AM, Magnus Bergmark
<magnus.bergmark at> wrote:
> Proposed solutions
> I propose that we allow the user to specify a relative path to a file to use
> as an icon. How we do this is not really important, but I have these
> separate suggestions (ordered by how it "should" work, IMHO):
> Icon paths starting with a dot will be relative from the directory
> containing the Desktop Entry; the path ./folder_icon.png in
> /home/user/Documents/BookProject/.directory will set the icon to
> /home/user/Documents/BookProject/folder_icon.png.
> When no absolute path is specified, first search the containing directory
> before following the Icon Theme Specification. In the example above, we
> would have entered folder_icon.png and this file would have been found
> locally before searching for it and therefore set.
> Usage of some other prefix to denote a relative path, rules following the
> others
> Using a different setting, or a compliment to the setting (like Icon=...,
> IconPath=Relative), rules following the others

What could also work:
* if an icon name contains directory separators and starts with one,
use absolute path
* if an icon name contains directory separators and does not start
with one, use relative path
* if an icon name contains a dot (presumably extension), try relative lookup
* if you reach this point, fall back to icon spec lookup

Patryk Zawadzki

More information about the xdg mailing list