Where GNOME Looks for Desktop Entry Files

This document records the directories the GNOME desktop searches for *.desktop files, the precedence rules between them, and the observed values on this host.

The directory-selection rules are stable specification facts. The observed environment values are live state and carry a verification date.

Sources

GNOME Uses GIO

The GNOME Application Search Path

The application search path, highest priority first, is:

  1. $XDG_DATA_HOME/applications
  2. $XDG_DATA_DIRS[0]/applications
  3. $XDG_DATA_DIRS[1]/applications
  4. and so on for every entry of $XDG_DATA_DIRS

With default values, the path is:

  1. $HOME/.local/share/applications
  2. /usr/local/share/applications
  3. /usr/share/applications

GIO also builds config-directory units from $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS, but marks them is_config and explicitly refuses to find desktop entries there. Those units serve configuration lookups such as mimeapps.list, not entry discovery.

Precedence and Masking

Desktop File ID and Subdirectories

Desktop Environments and Visibility

Autostart Entries

Autostart entries are found by a separate mechanism with a separate path, per the Desktop Application Autostart Specification.

  1. $XDG_CONFIG_HOME/autostart
  2. each $XDG_CONFIG_DIRS entry plus /autostart

Directories Injected by Packaging Systems

Flatpak and snapd add their export directories to $XDG_DATA_DIRS through environment setup, so GIO sees them without any GNOME-private rule.

Observed Values on This Host

Verified 2026-09-21 on this Ubuntu 24.04 host running GNOME Shell 46.0.

/usr/share/ubuntu:/usr/share/gnome:~/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop

The resulting effective application search path and its observed state was:

Priority Directory Observed 2026-09-21
1 $HOME/.local/share/applications present, 18 entries
2 /usr/share/ubuntu/applications present
3 /usr/share/gnome/applications present
4 $HOME/.local/share/flatpak/exports/share/applications absent
5 /var/lib/flatpak/exports/share/applications present, 20 entries
6 /usr/local/share/applications absent
7 /usr/share/applications present, 129 entries
8 /var/lib/snapd/desktop/applications present, 32 entries

Observed autostart directories, verified 2026-09-21:

Priority Directory Observed 2026-09-21
1 $HOME/.config/autostart present, 1 entry
2 /etc/xdg/xdg-ubuntu/autostart not inspected
3 /etc/xdg/autostart present, 38 entries

Consequences for the Locator

The desktop entry locator in this project mirrors the GIO order.

Verification