What is important when assigning an app to a .desktop launcher?

A .desktop launcher follows freedesktop.org desktop entry and menu standards. Some standard keys are:

  • Name= Specific name of the application.
  • Comment= A short description of the application.
  • Exec= Command to launch the application.
  • Icon= Icon for the application (an icon provided by your icon theme or an absolute path to an image file).
  • Type= Types of desktop entries, supported ones are Application, Link or Directory.
  • Terminal= true/false, whether the application runs in a terminal window.
  • Categories= Categories to which the application belongs (Main Categories, Additional Categories and Reserved Categories).
  • StartupWMClass= is a very useful one.

For a detailed list of specifications, visit freedesktop.org.


P.S. Various GUI applications which can be used to create application launchers, e.g. 'Main Menu' (aka alacarte) or 'MenuLibre' (menulibre), just creates a .desktop file in an appropriate location (e.g. ~/.local/share/applications/) under the hood.


The other part of your question:

Programs that are designed for the CLI (and some GUI ones too) usually write all their informational and error messages to stdout and stderr which are normally connected to a terminal/CLI. When you start such programs from a GUI, these streams are usually connected to bit buckets (/dev/null) and all such messages are lost.

When a GUI program misbehaves, a handy trick is to run it from within a terminal. Then, any such messages it issues will have a place to go and may tell you why things aren't working as desired.

A number of GUI programs are quite loquacious when run this way.

In KDE (and probably elsewhere), the Application Menu Editor allows you to select an option for an entry to run in a terminal. This causes a terminal window to automatically open when you run such an entry. When the program is done, the terminal window closes, so if you need to see the final messages, you have to add something that pauses the program or a wrapper script at the end so you can read the messages before they disappear.