I have to use VNC many times for my work. Everytime to invoke vncviewer, I had to press -F2 and then type “vncviewer”. I didnt want to do this and hence I thought I will write a simple shell script which I can use to run whenever I needed vncviewer. Hence I wrote following two lines in a shell script.
#!/bin/bash
vncviewer
This I saved on my desktop and used to double click it whenever I needed to run it. However even this used to ask me if I wanted to run it or display it. Also the script had a default icon which I didnt want and wanted it to have the icon of vnc. Also I didnt like it to occupy my desktop area and wanted to keep it on my panel. Hence i searched on google for answers. i found the following mail which gave me a clear idea of how to do it.
http://linux.derkeiler.com/Mailing-Lists/KDE/2009-04/msg00131.html
You can create your own icons by creating a textfile and giving it a .desktop
extension. That’s all an icon is. Go to /usr/share/applications and have a look.
Anyone of those files can be dragged into you ~/Desktop folder if you use that for
desktop icons or else directly onto your desktop.
The format of the .desktop file is fairly simple to follow I have made them for
url as well as script icons and keep them in /usr/local/share/applications. Once
you have created the file the “icon” can be used like any other icon, e.g. adding
to Quicklaunch. Use anything for an icon. Here is what one of mine looks like.
[root@localhost ~]# cat /usr/local/share/vncviewer.desktop
[Desktop Entry]
Name=Vncviewer
Comment = runs vncviewer script
Exec=/usr/local/bin/vncviewer.sh
Icon=/usr/share/icons/vncviewer.jpeg
Terminal=0
Type=Application
Categories=Application;Internet;
Hence now I could drag this icon on my panel and launch vncviewer in just one click.