Adding a Custom Launcher to Gnome Shell

Aug 20, 2020    #linux   #gnome  

I have a long history of using Linux and it has always been my preferred operating system. Due to the needs of my photography workflow , however, I’ve been using Windows as my primary OS for the past few years. That’s until recently, however.

While I don’t quite have the photography workflow fully figured out on Linux yet, I’m back to using it as my primary operating system for the first time in probably 5 years. I went with my go-to setup of Ubuntu with the Gnome desktop (I could write a whole additional post as to why this is my go-to, but I digress).

One of the things I’ve found that I’ve needed to do a bit of while setting everything up is adding my own custom launchers to the Gnome applications overview. Like most everything else on Linux, this can be easily done by creating a file.

Let’s take a look!

Creating a Launcher

To create a new launcher, we just need to create a .desktop file in the following path:

1~/.local/share/applications

Here is a template you can use for creating the new launcher:

1[Desktop Entry]
2Encoding=UTF-8
3Name={APPLICATION_NAME}
4Exec={PATH_TO_APPLICATION}
5Icon={PATH_TO_ICON}
6Type=Application
7Categories=Development;

As you can see, there are three primary variables you’ll want to edit for your launcher: the name, path to the executable, and the path to the icon. You’ll notice that there’s also a spot at the end to specify the categories of the application, but I don’t believe these are used anywhere in the Gnome shell unless you’re using a menu extension.

An Example

Just to drive this point home, let’s consider an example. One of the applications I’ve had to do this process for is Ghidra .

Ghidra has no distribution package to install but is instead distributed as a zipfile archive. As such, there is no entry automatically added to the Gnome shell launcher for it. In my case, I’m storing Ghidra in the following path:

1/home/adam/tools/ghidra_9.1.2

The custom launcher I created for the application looks like this:

1[Desktop Entry]
2Encoding=UTF-8
3Name=Ghidra
4Exec=/home/adam/tools/ghidra_9.1.2/ghidraRun
5Icon=/home/adam/tools/ghidra_9.1.2/docs/images/GHIDRA_1.png
6Type=Application
7Categories=Development;

Mere seconds after I saved this file I could see Ghidra listed in the Gnome applications menu!

The new launcher

Hopefully, you found this post at least somewhat useful. I’m sure I’ll have a bunch of other quick tip type posts as I continue to tweak my installation.