Skip to content

Instantly share code, notes, and snippets.

@davipatti
Created January 28, 2022 20:27
Show Gist options
  • Save davipatti/aee1f54b0c212371b4047d2878f4aec5 to your computer and use it in GitHub Desktop.
Save davipatti/aee1f54b0c212371b4047d2878f4aec5 to your computer and use it in GitHub Desktop.
Integrate executable programs with the system launcher in Ubuntu

Integrate executable programs with the system launcher in Ubuntu

Occasionally you download some pre-compiled software. It can be a pain to remember where you put it, navigate there in a shell and run it.

Better would be if it were integrated with the desktop launchers so you can launch it like a regular program.

Information for this behaviour (like where the executable is, what the icon is, etc...) is defined by a .desktop file, which has to be put in a directory the system monitors. See here for more details.

I was recently wanted to do this with Zotero, and their instructions had some recommendations on how to set this up properly:

  1. For Ubuntu, the tarball includes a .desktop file that can be used to add Zotero to the launcher
  2. Move the extracted directory to a location of your choice (e.g., /opt/zotero)
  3. Run the set_launcher_icon script from a terminal to update the .desktop file for that location
  4. Symlink zotero.desktop into ~/.local/share/applications/ (e.g., ln -s /opt/zotero/zotero.desktop ~/.local/share/applications/zotero.desktop).
  5. Zotero should then appear either in your launcher or in the applications list when click the grid icon (“Show Applications”), from which you can drag it to the launcher.

If the program you're installing doesn't have a set_launcher_icon script (or something similar), then go into the .desktop file and edit the Exec=/path/to/executable line to point at the executable.

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