The Problem

As of version 3.20.4, there is no simple way to create a launcher icon in Gnome 3. When I install something like Android Studio or MATLAB (or most software not installed by the package manager), I can initially only start them from a terminal.

The only way to do it is to manually create a desktop file in just the right folder.

  • I don’t want to remember what exact directory the files go in
  • I don’t want to memorize the .desktop format/syntax/options
  • I don’t wanna keep a terminal open to run a GUI program. That’s dumb.

How to

I’m using Ubuntu-Gnome 16.10.

First we install gnome-panel, which includes a dialog to do what we need.

1
sudo apt-get install --no-install-recommends gnome-panel

From here, we can open the dialog with the following command.
For Ubuntu, we also pass in the path ~/.local/share/applications as the location where the .desktop file should be saved. Gnome will load .desktop entries from there.

1
gnome-desktop-item-edit ~/.local/share/applications --create-new

I’m not really interested in memorizing or typing all that. So we will put it into a script that we can run from anywhere:

1
2
echo "gnome-desktop-item-edit ~/.local/share/applications --create-new" > ~/bin/newicon
chmod +x ~/bin/newicon

Now we can run the newicon command from anywhere to open that dialog, and then use the dialog to make a launcher to run newicon, the command that opens the dialog.

Now when we open the Activities/Overview (by pressing the SUPER key, or the windows key if you’re not cool), we can start typing ‘create launcher’ and see our launcher.


Here is the Create Launcher.desktop file that was created in .local/share/applications:

1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=gnome-panel-launcher
Name[en_US]=Create Launcher
Exec=newicon
Name=Create Launcher
Icon=gnome-panel-launcher