user-avatar
Today is Saturday
November 23, 2024

Tag: custom

July 2, 2014

Adding custom application to Unity launcher

by viggy — Categories: FOSS — Tags: , , , , Leave a comment

Recently I downloaded Tor Browser and I wanted to be able to search for it in Unity Launcher. Also I wanted to lock it to the launcher instead of my default Firefox. Found this good video on youtube explaining how to add a custom application to Unity Launcher, https://www.youtube.com/watch?v=GSU9YuE_36w

The process is pretty simple.
1) I downloaded a logo of Tor of 128 by 128 size. Copied the same to /usr/share/icons/tor.png
2) In /usr/share/applications/, I created a file called tor-browser.desktop with following contents


[Desktop Entry]
Name=Tor-Browser
Comment=Tor enabled Firefox Browser
Exec=/home/viggy/Documents/tor-browser_en-US/start-tor-browser
Icon=/usr/share/icons/tor.png
Terminal=false
Type=Application
Categories=Developer;Utility;

Note that Exec needs to be given full path of the executable and Icon the full path of the icon.
Also note that Categories can be multiple but it has to end with a semicolon(;) even though there is a single Category

Once this is done, you can just search in your Unity Launcher and you will get the application and see the logo of the same.
Enjoy.

March 24, 2010

Custom icons to your script

by viggy — Categories: tech — Tags: , , , Leave a comment

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.
:)