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.

5 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. Supersonically Says:

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

    cheers, Supersonically

  4. 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?

  5. Rimma Says:

    He rised. ,

Leave a Reply