Skip to content

Instantly share code, notes, and snippets.

@joshjavier
Created July 21, 2020 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshjavier/3da2892d8787ed16ea9e8cbd00c0e72b to your computer and use it in GitHub Desktop.
Save joshjavier/3da2892d8787ed16ea9e8cbd00c0e72b to your computer and use it in GitHub Desktop.
How to manually create a .desktop file for an app in Linux

Create .desktop file

  1. Open terminal.
  2. cd ~/.local/share/applications (or /usr/share/applications if you want it to be accessible to everyone)
  3. vim com.website.AppName.desktop
  4. Type the ff:
[Desktop Entry]
Type=Application
Name=Responsively
Comment=Web browser for responsive web development
Icon=/home/joshjavier/bin/responsively/responsively-logo.png
Exec=/home/joshjavier/bin/responsively/ResponsivelyApp-0.7.0.AppImage

Notes:

  • can be in any order, as long as the first line is [Desktop Entry]
  • I usually place user apps in the bin folder in my home directory
  • I prefer using absolute paths in Icon since it's easier, but another way is to place icon files in corresponding folders in the ~/.local/share/icons/hicolor/ directory

Spec and other references

Desktop Entry Specification

Desktop files: putting your application in the desktop menus

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment