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 :
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.
Howto add right click menu to mount smb shares in Ubuntu
February 6, 2007
This howto is based on my installed Ubuntu Edgy Eft (6.10), it might work for other versions also.
There are three steps needed here :
1. Make sure smbfs package is installed. By default Ubuntu edgy do not install smbfs package. If it is not installed yet you can install it using this command
$ sudo apt-get install smbfs
After making sure that smbfs is installed, set file permission of smbmnt and smbumount
$ sudo chmod u+s /usr/bin/smbmnt
$ sudo chmod u+s /usr/bin/smbumount
Update : I have update to 7.04 and it is not needed anymore to do chmod for smbumount.
2. Create entry in the /etc/fstab and credential file for username and password
entry in /etc/fstab will look like this :
//asterix/pub /mnt/pub smbfs noauto,rw,users,credentials
=/etc/credentials
Create credential file with the command :
$ sudo gedit /etc/credentials
The credential file content should look like this :
username=adrianus
password=mypassword
After saving the file dont forget to make it secure as it contains your password
$ sudo chmod 600 /etc/credentials
The purpose of creating the entry in fstab is to make the shortcut appear in the desktop after we mount the share, and the purpose of creating credential file is to avoid the need for typing in smb password each time we want to mount the share.
Change the italic part above with your username and password for accessing smb share.
Don’t forget to create the directory for mount point if it is not available yet.
3. Create nautilus script file in $HOME/.gnome2/nautilus-scripts/ directory
My nautilus script file name is “mount pub” the content is something like this :
#!/bin/sh
# Script to mount //asterix/pub
smbmount //asterix/pub /mnt/pub -o credentials=/etc/credentials,uid=adrianus,gid
=adrianus
Don’t forget to make the script file executable using chmod +x yourscriptfilename
4. Last but not least, chown and chgrp the directory you will be using as mount point to be owned by your username.
Now to mount the shares all I have to do is right click mouse over my desktop and choose “mount pub” from the “Scripts” menu and the shortcut icon for the drive will pop up on my desktop ![]()
To unmount I just right click my mouse over the “pub” icon on the desktop and choose “Unmount Volume”
For polishing the look, I browse the mount pub script using nautilus and assign custom icon to it so now it has harddisk icon in the right click menu.
Howto update gaim yahoo emoticon
December 24, 2006
I happen to visit yahoo messenger website
http://messenger.yahoo.com/hiddenemoticons.php
several weeks ago and notice that there are some new emoticons that are not available on the bundled emoticon in gaim. The newest addition is showing a puppy face by typing :o3
If you type those in your IM windows and do not see a puppy face then you don’t have the complete yahoo emoticon set yet.
I have download before “updated and corrected yahoo” theme by Kshitij Bhardwaj but it still lack the new puppy smilie and miss the american flag smilie, so I add the file yahoo_puppy.gif and edit the theme file accordingly.
First grab the puppy gif file from the link above. Just right click when your mouse is over the puppy icon and select “save image as”. I name the file yahoo_puppy.gif and save it in my home directory
Second you have to find where is your smiley directory. For me it is /usr/share/pixmaps/gaim/smileys
I used updated-and-corrected yahoo theme so I go inside that directory and copy the yahoo_puppy.gif file into that directory
Last but not least edit the theme file to include this entry :
yahoo_puppy.gif :o3
I put the entry after the yahoo_pumpkin entry to keep it sorted.
I have the zipped theme files but I haven’t find out how to attach it to this blog. So for the time being the instruction above have to do.
