Creating Custom Launchers in Ubuntu

posted in: HOWTO | 0

Launchers are the Ubuntu-native way to launch an application by double-clicking on it. You can put them in your Unity dash, on your desktop, link to them, etc.

The problem is, since the switch from Gnome to Unity, creating custom launchers is a little tricky. You used to be able to use Alacarte, but that doesn’t interface well with Unity. The easiest way that I’ve found is to just create them manually, in the terminal (or, if you prefer, with gEdit or a similar text editor)

All launchers are natively stored in ~/.local/share/applications and end with the extension .desktop.  They use this format:

[Desktop Entry]
Name=Name of Application
Comment=Optional comment for app
Exec=/path/to/application/binary
Icon=/path/to/icon.png
Terminal=true/false
Type=Application
Categories=Optional;Semicolon;Separated;List;Of;Categories

Those are the main options. You can put your icons into /usr/share/icons or into the folder containing the application. For example, here is the launcher I created for Sublime 2.

[Desktop Entry]
Name=Sublime Text 2
Comment=Sublime text editor
Exec=/home/aaron/Applications/sublime_2/sublime_text
Icon=/home/aaron/Applications/sublime_2/Icon/48x48/sublime_text.png
Terminal=false
Type=Application
Categories=Development;

The Unity Dash cache takes a couple minutes to update, sometimes, but now when I pop open the Dash, I can type “sublime” and it shows up in the list; I can drag that icon to my launchbar for quick access.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.