Ubuntu custom desktop shortcuts

With Ubuntu, you can create your own desktop shortcuts that will be accessible directly from the launcher.

You can do it by using a GUI, or you can do it using directly a terminal, which is the what we will be covering here.

EDIT: There is a menu editor for the GNOME desktop, alacarte, which is a better alternative than creating the shortcut yourself.

There are two applications folders that Ubuntu is looking:

  • /usr/share/applications/
    • Shared folder to every computer’s users
  • ~/.local/share/applications/
    • Folder specific to the users, thus shortcuts only available for current user

If you want to create a custom one, create a <name>.desktop file into one of those two folders with the following content:

1
2
3
4
5
6
7
8
[Desktop Entry]
Type=Application
Name=Name of the app
Icon=/path/to/your/icon.png
Exec="/path/to/your/exec" %f
Comment=Some comment
Categories=Categories;separated;by;semi-commas;
Terminal=false

Sources: