After having some trouble with an executable path that contained spaces and no satisfactory answer nearby, I try to summarize everything once again in 2025. Works for me on GNOME Shell 48.4.
Basic structure
Create a file named your-program.desktop in folder ~/.local/share/applications with the following content:
[Desktop Entry]
Type=Application
Categories=Development;Graphics
Name=Your Program
Comment=A possibly longer comment describing what Your Program is good fore
Exec=your-executable
Icon=/full/path/to-image.png
Terminal=false
You need to change the following fields:
Categories
Pick one or multiple of the main categories Audio, AudioVideo, Development, Education, Game, Graphics, Network, Office, Science, Settings, System, Utility, Video, separated by ;. You may go overboard and add some of the numerous additional categories as well.
Name & Comment
Just a bare single-line string, no quoting needed.
Exec
Typical cases here are:
- A bare
exec-name if it is found in $PATH (e.g. gimp)
- Full path to an executable (e.g.
/usr/bin/vlc)
- One of the above but with arguments (e.g.
/usr/bin/vlc --started-from-file %U), split by whitespace
- If the executable path/filename or one of the arguments contains whitespace that needs preserving, you can quote them with single (not double) quotes:
'/home/ojdo/bin/Some App With Spaces.AppImage'.
- Further rules on escaping, quoting and defined variables like
%F and %U can be found in the official Exec key specification.
Changes to this file are picked up automatically after some seconds. When in doubt, change the Icon field to a different picture to see when the update has caught on.
rin the box, and press enter. – mlissner Nov 18 '15 at 23:33Path=/path/to/eclipse/working-dir. – psiphi75 Apr 18 '17 at 04:39