Name: Name of the application as it appears in your launcher, menu etcGenericName: Generic Name of the application, E.g Web browserExec: Name of the application/script to be executedIcon: Image file, that appears as iconTerminal: Should this application show the terminal (could be helpful for applications that logs output in a terminal)Type: Application, Link and Directory are three typesCategories: Under which section on menu, should it appear

You can use only names for Icon or Exec, if those files are located at standard path, otherwise you will have to use full path.

If you want to create desktop files locally, create a directory where you will store these files. Lets call it myapplications inside your home directory as ~/myapplications. To make this directory recognizable by application menus or launchers like gnome-do, synapse, unity-dash etc, you will also have to link it to ~/.local/share/applications. Run following command to do so.

$ ln -s ~/myapplications ~/.local/share/applications/

Lets see different examples, where we can use the desktop files.

Note: Be sure to make the files executable, after its creation, using “chmod +x filename“.

1. Games

Lets say, I want to create a desktop file for a game called FTL, that runs only if I run the FTL script on the game’s own installation directory i.e I cannot run /path/to/ftl/FTL and execute the game, if I am in some other directory in a terminal. I will create a desktop file that looks like this

Only interesting thing about above file is the Path variable, that specifies, in which directory should the command execute.

After you create these files, you can collect them just by copying them where ever you like. Just click the icon and the application should launch. You could also drag it to different launcher bars (as you can see in figure below for elementary), execute it from standard application launcher menu etc.

2. Web pages

If I wanted an icon that launches G+, I would create a simple desktop file, that looks like this.

In this case, I downloaded a 256×256 image of googleplus from internet, and kept it inside .icons directory (you can keep it anywhere you like).

If you wanted to open up a collection of web pages, using a desktop file, you could easily do so using a script, and point Exec to that script. E.g If I wanted to run reddit.sh, Exec could look this this.

The good thing is, I don’t have to open up AMD catalyst control center, or fire up a terminal and follow series of steps just to switch the graphics cards. I could simply use my regular application launcher (e.g application menu, gnome-do etc) and execute the script just as I would execute a GUI application.

Conclusion

As you can see, I mentioned a wide range of examples. Purpose of which is to encourage you to create your own launcher for applications you run. There are much more parameters and variables that can be used on a desktop file, which you can see if you explore files at /usr/share/applications. To cover even more use cases, see Desktop Entry Specification. The power of desktop files is limitless. E.g I could create launcher for all my nintento 64 roms (using mupen64plus). I could create desktop files to launch a script that mixes a series of commands and applications. I could create several versions of same application, depending upon different parameters. The point is, there is nothing wrong with using the terminal to execute commands, but sometimes, it is less intimidating and more enjoyable to press a button and see stuffs happen.

Here, I have used xdg-open instead of firefox or chromium-browser, because this command opens the web page in default web browser.

I don’t know how Active Desktop works. May be, you want to drag and drop icons from browser to desktop (I don’t know any application or browser in Linux that works like that). If you use above example as a template, I don’t think it is that hard to create links to web pages you visit.