Monday, October 29, 2012

Xubuntu ".desktop" files

Xubuntu doesn't have a nice gui editor for the desktop menu. It isn't hard to edit by hand, though.

Each application that appears in the desktop menu has a corresponding file in /usr/share/applications. To create a new one, just copy an existing one and edit it. For example, I created one for jEdit by copying the netbeans.desktop file:

netbeans.desktop:
[Desktop Entry]
Name=NetBeans
Comment=NetBeans
Exec=/home/danson/bin/netbeans
Icon=/home/danson/apps/netbeans-7.0.1/nb/netbeans.png
Categories=Development;Java;
Terminal=false
Type=Application

Modified to jedit.desktop:
[Desktop Entry]
Name=jEdit
Comment=jEdit
Exec=/home/danson/bin/jedit
Icon=/home/danson/apps/jedit/current/doc/jedit.png
Categories=Development;Java;
Terminal=false
Type=Application

One important entry is the "Categories", this puts the applications in the appropriate place in the menu. Possible choices are:

Accessories
Audio
Development
Games
Graphics
Internet
Multimedia
Network
Office
Settings
System
Utility

There are others, but these are the common categories.




No comments: