Gnome .desktop file cheat sheet

Jul 7, 2025 Gnome Linux

Another one from the “I never can remember this damn thing” file … putting it here so I know where to look it up next time.

Incidentally I think there’s a “proper” way to do this, but this works fine and is quick. The “proper” documentation for this is at: https://developer.gnome.org/documentation/guidelines/maintainer/integrating.html

Steps

Create a .desktop file in ~/.local/share/applications/ (i.e. under your home directory in the .local hierarchy) … if for any reason you want it to be available to all users on the system you can instead place it under the /usr/share/applications/ directory instead.

The file will look something like this - obviously paths need to be amended accordingly for whatever application you’re setting up:

[Desktop Entry]
Name=IntelliJ PyCharm
GenericName=Integrated Development Environment (IDE)
Comment=IDE for software development
Exec=/home/dcminter/JetBrains/pycharm-2025.1.2/bin/pycharm
Terminal=false
Type=Application
StartupNotify=true
Icon=/home/dcminter/JetBrains/pycharm-2025.1.2/bin/pycharm.png
Categories=IDE;TextEditor;Development;

Once it’s there, run the following command to notify Gnome that it’s got changes to pick up:

$ sudo update-desktop-database

That’s it.

© 2017 - 2025 Dave Minter