Putting Applications in your Desktop Menu
By: Roger Creasy
If you are running a Linux Desktop Environment, you have software that you would like run in that environment. Having your software organized so that it can be found easily is critical to productivity. Most installation scripts automatically place the application in the correct application menu. However, some do not, and you may have your own application you would like to add to the menu. This post explains how to add applications to the application menu.
The .desktop file
Everything in Linux is a file, right? The menu configuration is no different. Desktop Environments that are freedesktop.org-compliant (Gnome, KDE, etc) follow the XDG Deskop Entry specification. This specification defines a standard way for applications to integrate with the menu system. Each application that integrates with the menu has a .desktop file. These files are located in
/usr/local/share/applications ) for system-wide applications, or in
~/.local/share/applications for applications installed for only one user. Here is an example file with comments to explain each line.
[Desktop Entry] #The type. Applications are type..application Type=Application #The Name of the Application. No length limit, Avoid special characters. No Spaces Name=ProgramName #The Version number of the Application Version=1.0 #The comment entry shows up as a tooltip. This content is useful if you find applications #via the super key as well Comment=ProgramName is terrific for generating widgets #The path to the executable Path=/path/to/executable/ProgramName #The executable name Exec=ProgramName #The icon for the application. Include the full path Icon=/path/to/icon/icon.png #Categories in which the application should appear Categories=Developer;Other; #Keywords are not required. But, they are helpful in finding the application Keywords=Programming;Design;Awesomeness; #whether or not the application runs in the terminal Terminal=false
To add an application to the menu, create a text file with the above content. Edit it to match your application. Save the file named
[yourApplication].desktop in the correct directory, as described above. Your application should be available in menus and via search with the super key.
The Linux desktop is highly configurable. .desktop files are another way that you can mold your Linux desktop to be truly YOUR Linux desktop.