Icon / mime association..

Kustaa Nyholm feedback2 at sparetimelabs.com
Mon Oct 16 19:46:41 EEST 2006

Bastian, Waldo wrote:
 >This is a bit tricky. You may want to take a look at xdg-utils [1] which
 >takes part of the hairy parts. Basically, once you have installed
 >mimetype description(s) you can install for each mimetype (e.g.
 >text/foobar) an icon with the name major_minor (e.g. "text_foobar") that
 >will then be used for documents of that mimetype.
 >See http://portland.freedesktop.org/xdg-utils-1.0/xdg-mime.html for an

Ah, thanks for the pointer, this actually solved most of the issues I had, very 
helpful, those scripts. Though it took me a while to use them properly.
BTW some worked out (and thoroughly debuged) examples on how to use them would 
be very helpful as a part of the specs, but thats by the way.

I still have some small issues though.

My extensions (*.jdwg) are now correctly associated by installer with my mime 
types (application/vnd.jdwg) and my jDraft.desktop shows the icon I specified 
for my application and my documents also show the icon I want. The application 
launches from .desktop file or the documents. Everything is great, well almost...

...the actual application executable (which is a shell script with embedded 
executable jar file) only shows the standard (I presume) icon for shell scripts.

Now Magnus Bergman wrote on this subject:

 >Yes. Modify the application to look up the same iconname in the way
 >specified in the icon theme (some toolkits lite GTK+ can do this by
 >itself). In that way the same icon will be found, even if some theme
 >provides an alternative icon for your application, that will be used
 >both for the launcher and the running application.

But I still can't figure this out, could some please spell out an example for me?

Back to the XGDUtils.

Everything works fine as long as I'm installing (with XDG script) them with 
'--mode user' but not '--mode system', also if I sudo them, then the *.desktop 
file does not carry the proper icon and the assocations do not work. I've tried 
this on Ubuntu only. Is this correct behaviour? What is the '--mode system' for?

thanks in advance Kusti

More information about the xdg mailing list