Ubuntu – create a custom launcher for Eclipse


Can't make my custom Eclipse launcher work on 13.10 (fresh install).
See screenshot below:

enter image description here

The custom eclipse launcher on panel doesn't work.

Double click on Eclipse.desktop from file manager works but adds a new launcher with grey "?" icon. Eclipse is managed by the new grey launcher, not mine.

I can't just block and use the "?" launcher because it opens eclipse directly while I need to run my command.

I followed the following steps:

1) Unzipped eclipse into /opt/eclipse (repository is not an option).
2) Created custom gtk theme in /opt/eclipse/gtkrc-2.0-eclipse
3) Created /opt/eclipse/run.sh (the content is in the picture)
4) Installed gnome-panel and created a new launcher with custom icon and run.sh command
5) Opened the file manager, navigated to /usr/.../application and
   dragged-dropped Eclipse.desktop onto panel

Hope it's all clear.
How can I make my custom launcher work as expected or, at least, make the grey one run my command?

Following the Sushantp606's instructions I got the launcher work, but the grey laucher still opens when I run eclipse.
Then… I looked for eclipse launchers with

locate .desktor | grep eclipse 

and found this:


I changed the Icon in both with the right path and now the launcher with grey icon has the eclipse icon as expected. So dropped the one I've created.

Best Answer

After your first step make a link by using -

sudo ln -s /opt/eclipse/eclipse /usr/bin/eclipse

Creating unity launcher icon-

sudo gedit /usr/share/applications/eclipse.desktop

paste the following lines as it is-

[Desktop Entry]
Exec=env UBUNTU_MENUPROXY= eclipse
[NewWindow Shortcut Group]
Name=New Window
Exec=env UBUNTU_MENUPROXY= eclipse

For custom theme make the file in home as-

gedit .gtkrc-2.0

and paste the information of theme.

now search for eclipse in dash, drag it to unity launcher . done.

Related Question