Howto add new mime types and icon for visio document in Ubuntu

February 7, 2007

I have installed Visio 2000 on wine 0.9.26 on Ubuntu 6.10. I have created the menu for it in the Applications–>Office. This menu shortcut works to launch Visio 2000, but I want more. I want to automatically launch Visio to open a visio diagram when I double click a visio document, and I want the document to have the same icon as Visio document in windows.

This howto is explaining how to achieve the last.

1. Add new mime types and information

$ sudo gedit /etc/mime.types

Or if you want the new mime types only applies to your current user then you can edit ~/.mime.types

insert this entry
application/vnd.ms-visio vsd

$ sudo gedit /usr/share/mime/packages/freedesktop.org.xml

insert the entry below

<mime-type type=”application/vnd.ms-visio”>
<comment>Visio diagram</comment>
<comment xml:lang=”az”>Visio cədvəli</comment>
<comment xml:lang=”bg”>Диаграма, формат Visio</comment>
<comment xml:lang=”cs”>Graf Visio</comment>
<comment xml:lang=”cy”>Siart Visio</comment>
<comment xml:lang=”da”>Visio-diagram</comment>
<comment xml:lang=”de”>Visio-Diagramm</comment>
<comment xml:lang=”el”>γράφημα Visio</comment>
<comment xml:lang=”eo”>Visio-diagramo</comment>
<comment xml:lang=”es”>Gráfica de Visio</comment>
<comment xml:lang=”eu”>Visio diagrama</comment>
<comment xml:lang=”fi”>Visio-kaavio</comment>
<comment xml:lang=”fr”>graphique Visio</comment>
<comment xml:lang=”hu”>Visio-grafikon</comment>
<comment xml:lang=”it”>Grafico Visio</comment>
<comment xml:lang=”ja”>Visio チャート</comment>
<comment xml:lang=”ko”>Visio 표</comment>
<comment xml:lang=”lt”>Visio diagrama</comment>
<comment xml:lang=”ms”>Carta Visio</comment>
<comment xml:lang=”nb”>Visio graf</comment>
<comment xml:lang=”nl”>Visio-kaart</comment>
<comment xml:lang=”nn”>Visio-graf</comment>
<comment xml:lang=”pl”>Wykres Visio</comment>
<comment xml:lang=”pt”>gráfico do Visio</comment>
<comment xml:lang=”pt_BR”>Gráfico Visio</comment>
<comment xml:lang=”sq”>Grafik Visio</comment>
<comment xml:lang=”sr”>Visio графикон</comment>
<comment xml:lang=”sv”>Visio-diagram</comment>
<comment xml:lang=”uk”>Діаграма Visio</comment>
<comment xml:lang=”vi”>Đồ thị Visio</comment>
<comment xml:lang=”zh_CN”>Visio 图表</comment>
<comment xml:lang=”zh_TW”>Visio 圖表</comment>
<glob pattern=”*.vsd”/>
</mime-type>

$ sudo update-mime-database /usr/share/mime

2. Now that we have add a new mime type for visio document, we need to associate it with an icon. I have extracted icon for visio document and save it in png format :

gnome-mime-application-vndms-visio.png

The icon above is for 48×48 size. You can use gimp or other graphic editor to resize it to 32×32 and 24×24.
Copy various sizes of the png icon for the new mimetype into these directories :

/usr/share/icons/gnome/48×48/mimetypes
/usr/share/icons/gnome/32×32/mimetypes
/usr/share/icons/gnome/24×24/mimetypes

Since the mime type we just added is application/vnd.ms-visio, to work properly, the icon files should be named : gnome-mime-application-vnd.ms-visio.png

Most icon theme inherit gnome icon theme, so whatever icon theme you are using the new mimetype icon for visio will be inherited.

3. Update icon cache of gnome icon theme to make the addition realized by the systems

$ cd /usr/share/icons
$ sudo gtk-update-icon-cache –force gnome

Note : there are two dash before “force” in the command above. It might appear like just one dash

Now every vsd document should use the above icon in nautilus.

11 Responses to “Howto add new mime types and icon for visio document in Ubuntu”

  1. arnaud Says:

    Becarefull on point 3, the correct command line is :
    sudo gtk-update-icon-cache –force gnome

  2. arnaud Says:

    Sorry, it does not display as wanted. In fact –force should be replaced by “minus””minus”force.

  3. music Says:

    very interesting.
    i’m adding in RSS Reader


  4. Somehow i missed the point. Probably lost in translation 🙂 Anyway … nice blog to visit.

    cheers, Supersonically

  5. Christian Says:

    I have a problem with that. So i tried to make a xml-sub-mimetype. Ant it was kind of half-successful. Some of my xml documents are now recognized as my subformat and also have the right icon. But this happens only if i select the file in nautilus. If i refreh the view all files have the standard xml icon until i select each one. It seams, that my changes in Override.xml are only applied if i select the icon. Can you help me with that?

  6. hippotito Says:

    Cool! It works great! Thanks a ton!

    I have problem setting an icon for my newly defined mime type to work in Jaunty Jack for a while using assoGiate.

    Re-naming the icon and put it in the right folder + update cache did the trick!


  7. YakuYaku is seeking ambitious translators to grow its list of translators. Beginners/Students/Freelancers trying to gain experience are accepted as well forイprofessional translation services. The quantity of available jobs depends on the number of visitors
    and you will get an alarm whenever a new job with the languages you work with is live.
    But that’s not all, YakuYaku is ofren publishing new articles to train our community members together with resources to give a helping hand to translators in their jobs.
    Translators who need help can enter our forum and ask for our pro members’ expertise..

  8. Benjamin Says:

    When I copied and pasted the freedesktop.org.xml file, the quotes in the text from this page broke my document I had to search / replace ” with “


  9. I AM LOOKING FOR STENCILS FOR FLOWERS AND LADY BUGS FOR MY GRAND DAUGHTER … I HAVE BEEN ONLINE FOREVER TRYING TO FIND ANYTHING…. ANY IDEAS OF WHAT YO Click http://s.intmainreturn0.com/people3091630


  10. Bitcoin has experienced rapid increases in the last few years and there will be those that will claim that the success is about to end and the currency crumble. Those of us continue support the idea of a user owned system away from the reach of the financial establishment. We don’t believe that crypto currency is finished. We shall be staying with Bitcoin and I am quite certain that Bitcoin will continue to rise more rapidly than in the past. Banks are naturally concerned about the growth of crypto currency. This concern is fuelled by the reality that bitcoin does not generate a small part of the charges that high street banking requires. The use of a manual platform similar to Bitcoin Surfing may offer you the chance to find any new deals are out there in the world of bitcoin. Mining Bitcoin can be a realistic way to start building up your Bitcoin investment. Create a free Bitcoin account with Coinbase and earn $10 worth of Bitcoin for nothing to get you started. There are a lot of offers to get you involved in the new currency and Bitcoin Surfing is the most straight forward way to start. Best of all it is free.

  11. Cody Lufkin Says:

    This website is completely gret. I’ve search these info a whole lot
    and I realised that is professional, fast to understand.

    I congratulate you because of this article that I am going to recommend to people around.
    I request you to go to the gpa-calculator.co site where each pupil or scholar can find results gpa
    marks. Be great!


Leave a comment