finding directory icon
j.g.karssenberg at student.utwente.nl
j.g.karssenberg at student.utwente.nl
Thu May 31 11:51:54 PDT 2007
From: xdg-bounces at lists.freedesktop.org on behalf of Sebastian Gurin
... 8< ..
> For a given mimetype, I'm looking for its default application .desktop's
> file in $XDG_DATA_HOME/applications/desfaults.list and in
> $XDG_DATA_DIRS/applications/desfaults.list[1]
>
> Once I've found the .desktop file of the application I can look up for
> its icon. Is this "algorithm" for finding a mimetype's icon right?
Depends on what you want. Normally the application icons are used in applicaiton menus etc.
but not in the file browser to show mimetypes (however Windows does this in some cases).
I don't think you should use application icons for files, there are seperate icons for mimetypes
independend of the application(s) used to open them.
I can't look it up at the moment, but I think there is a way to find per mimetype icons in the icon spec;
else check the mailing list archive for mime icons.
> Well, my problem with directories is that there is no default
> application (in my machine) for opening files "x-directory/normal"
> registered in $XDG_DATA_HOME/applications/desfaults.list..
That might very well be. The "default.list" file is usually controlled by your file manager and normally
there is no reason for a file manager to assign a default application to directories - it knows what to do
with those already. Although this behavior varies between file managers. For example some managers
assume an implicit default when there is only one application installed for a certian mimetype without
a need to update "defaults.list". In general mimetypes will be without a default application until the
file manager has explicitly prompted you for an application to open this type.
Also "x-directory/normal" isn't a standard mimetype (hence the x-). IIRC the mimetype for directories
should be "inode/directory".
... 8< ..
Hope this helps,
Jaap <pardus at cpan.org>
More information about the xdg
mailing list