Create an Icon to Create an Icon in Gnome 3
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.
I’m using Ubuntu-Gnome 16.10.
First we install
gnome-panel, which includes a dialog to do what we need.
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.
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:
echo "gnome-desktop-item-edit ~/.local/share/applications --create-new" > ~/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