How to create a Gnome Desktop Entry

An easy approach to adding a desktop entry for gnome desktops.

How to create a Gnome Desktop Entry

I'm an avid user of Linux and my favorite distro is Fedora that comes with the gnome desktop. I find their search bar one of the most powerful things in my workflow allowing me to find programs with ease. Sometimes when I download programs that are executables they don't have a desktop entry disallowing me to use this feature. I could run them on my terminal but if I close the terminal it closes the program. Adding a desktop entry on these few cases is a quick solution that just requires a little bit of elbow grease. We can always automate the process in the future.

What is a desktop entry?

On your desktop, each program that you find when clicking the super key is a desktop entry. Every new program that doesn't do this for you needs to be registered. How new desktop entries are registered is by having a .desktop extension after the name of the application.

Where is the desktop entries located?

The entries are located in /usr/share/applications directory.

What do I need to do to create one?

You will need to create a file with a unique name that doesn't have spaces or international characters e.g. minecraft.desktop. You can copy-paste this template to get started:

[Desktop Entry]
Name=FooCorp Painter Pro

Following that template if for example, you have your executable on the home directory for your user you can do something like this:

[Desktop Entry]

You can find more information on Gnome Official Documentation

Happy Hacking! 🚀