Mime/Icon association

Kai-Uwe Behrmann ku.b at gmx.de
Tue Mar 2 08:51:35 PST 2010


Am 02.03.10, 15:36 -0000 schrieb Bastien Nocera:
> On Tue, 2010-03-02 at 16:15 +0100, Kai-Uwe Behrmann wrote:
>> Am 02.03.10, 14:35 -0000 schrieb Bastien Nocera:
>>> On Tue, 2010-03-02 at 15:26 +0100, Kai-Uwe Behrmann wrote:
>>>> Hello,
>>>>
>>>> I am searching for a way to tell filemanagers about a certain mime type
>>>> and a according icon. What I could do is to install the mime type xml file
>>>> in the style described here:
>>>> http://www.freedesktop.org/wiki/Specifications/AddingMIMETutor
>>>>
>>>> Additional I have added a <generic-icon name="oyranos_logo"/> element. But
>>>> this seems to have no effect (dolphin and nautilus). In fact this icon is
>>>> provided as PNG in:
>>>> ~/.local/share/icons/hicolor/128x128/apps/oyranos_logo.png   and
>>>> $(prefix)/share/pixmaps/oyranos_logo.png
>>>> The icons in that paths are used for applications just fine, e.g.
>>>> inkscape.
>>>>
>>>> Is my mime xml file somehow wrong (attached)?
>>>
>>> Yes. Generic icons are just that. They're there to make sure that all
>>> data types have icons. For most image, audio and video documents, that
>>> would already be part of the mime-type (so a image/foobar mime-type
>>> would already know to use the generic image icon if no image-foobar icon
>>> was available).
>>
>> I thought that is expressed in this mime xml file.
>
> No, there's no relationship to icons in the mime database, apart from

... apart from the <generic-icon /> element.

> the mime-types for which it would be impossible to find a generic type
> (usually application/* mime-types).

Sorry I do not understand. You mean the generic-icon can not be used to 
lookup icons? I can only guess to make sense of that.

>>>> Is on freedesktop.org a tutorial on how to install a application including
>>>> a own data format?
>>>
>>> The page you mentioned looks fine to me.
>>
>> Except it does not tell about this special relationship I am intressted
>> in (icon to MIME assigment in the xml file).
>
> You cannot assign icons in the mime database.

Ok, then generic-icon is ignored? Should'nt this be mentioned in the spec?

>>>> I must admit the spec pages on freedesktop.org is somewhat confusing.
>>>> There are even specs which do not have a date inside, especially the
>>>> "Shared MIME-info Database" spec.
>>>>
>>>> Perhaps the generic-icon element is simply not yet implemented?
>>>
>>> No. You should be installing a application-x-icc icon in your icon theme
>>
>> Its not included here - shared-mime-info-0.60-2.2.x86_64 openSUSE-11.2 .
>
> It's in 0.71.

Good, I see it there.

>>> instead. Note that ICC profiles are already in shared-mime-info.
>>
>> Ah, you mean it need the naming convention
>> icon name + file ending == mime name (?)
>
> It's explained in the icon theme spec.

Putting the file into a mimetypes subdirectory?
Tried, still not working.

>> No it does not help. So I assume the missing association to be a bug with
>> both Gnome and KDE. (After updating with xdg-user-dirs-update)
>
> To update the icon cache GTK+ uses, you should run
> "gtk-update-icon-cache". Not sure what KDE uses, but it's not related to
> mime-types.

... makes no difference.

>>> The icon theme specification has the explanations on how to install
>>> icons for mime-types:
>>> http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
>>
>> I tried in ~/.icon but it's confusing as the above paths already worked
>> for apps. No help eigther.
>
> It's ~/.icons not ~/.icon

Thanks for pointing out. I corrected this, but makes no difference.

>>> The shared-mime-info specification only carry information for when it's
>>> impossible to guess the generic icon from the mime-type itself.
>>
>> Yes that would be fine.
>>
>> Anyway, thanks for your quick response.


... guessing guessing guessing ...
Seems here is no help to get that done.


kind regards
Kai-Uwe Behrmann
-- 
developing for colour management 
www.behrmann.name + www.oyranos.org



More information about the xdg mailing list