Creating a .desktop File on Linux

Got an app that needs a shortcut and you can’t make one trivially with your desktop environment? Want to make one manually? The .desktop file is easy to understand.

Create a text file, but name it <foo>.desktop. Save it. This is the format of the code you’ll be using:

[code][Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=/path/to/executable
Name=Name of Application
Icon=/path/to/icon[/code]

That’s all you really need. This isn’t very complicated. Your desktop environment almost certainly has an easier way, but this is how you do it manually. It comes in handy for some folks who want to have desktop icons (I have none, ever) and install applications that don’t set a desktop file.