Menu

Adding to the Gnome 3 menu

0 Comment

Aptana 3 is a breath of fresh air compared to to my highly customised GEdit install. Don’t get me wrong GEdit is a great text editor but I prefer the snuggly embrace of an IDE rather than using lots of separate tools. The only problem with Aptana so far, on my Fedora 16 install at least, is that it doesn’t show up in the Gnome menu and it isn’t in the “Open With” list of applications.

I’ve had a look at the gnome shell before and it looked to be a big series of config files and some javascript so I had an idea that it would be possible to add applications in to the menu (I even had the crazy idea of adding a third tab…)

Anyway, rather than trying to bodge the fine work the Gnome developers had done, I found out that you can just add a new .desktop file into your /usr/share/applications/ folder.  The .desktop file defines everything Gnome shell needs to display your application in the menu (or in this case, Appcelerator’s applicaiton).

Listed below is my Aptana entry. I don’t have localisation entries in, however its quite easy to do that, just look at another application’s .desktop file and you’ll see the language code in square brackets after each key name i.e. Name[fr]=Aptana Studio 3.

[Desktop Entry]
Name=Aptana Studio 3
GenericName=Text Editor
Comment=Light weight web development version of Eclipse
Icon=/opt/aptana-studio-3/icon.xpm
Exec=/opt/aptana-studio-3/studio3 %U
Terminal=false
Type=Application
Categories=Development;IDE;PHP
StartupNotify=true

One of the key things here is the %U after the executable name.  Adding this allows your application to be the target of “Open With”.

Once saved your application should appear in the menu straight away and in also be available for open with requests.

UPDATE: The following URL shows in depth information about what you can pass to the executable:

http://developer.gnome.org/integration-guide/stable/desktop-files.html.en