The Desktop Entry File Format

This document records the *.desktop file format as specified by the freedesktop.org Desktop Entry Specification, the parts a reader must implement, and the historical forms still found in the wild.

Live-state facts in this document were verified on 2026-09-21 against the sources listed below.

Sources

File Naming

Desktop File ID

Basic Format

Value Types

Type Meaning
string ASCII text without control characters
localestring user-displayable UTF-8 text
iconstring an absolute icon path or a symbolic icon name, not user-displayable
boolean the literal true or false
numeric a floating point number as read by %f in the C locale

Lists

Localized Keys

LC_MESSAGES Candidate keys in order
lang_COUNTRY@MODIFIER lang_COUNTRY@MODIFIER, lang_COUNTRY, lang@MODIFIER, lang, unlocalized
lang_COUNTRY lang_COUNTRY, lang, unlocalized
lang@MODIFIER lang@MODIFIER, lang, unlocalized
lang lang, unlocalized

Recognized Keys

Key Type Required Applies to
Type string yes all; Application, Link, or Directory
Version string no specification version, 1.5 for this version
Name localestring yes all
GenericName localestring no all
NoDisplay boolean no all
Comment localestring no all
Icon iconstring no all
Hidden boolean no all
OnlyShowIn string(s) no all
NotShowIn string(s) no all
DBusActivatable boolean no Application
TryExec string no Application
Exec string yes unless DBusActivatable Application
Path string no Application
Terminal boolean no Application
Actions string(s) no Application
MimeType string(s) no Application
Categories string(s) no Application
Implements string(s) no Application
Keywords localestring(s) no Application
StartupNotify boolean no Application
StartupWMClass string no Application
PrefersNonDefaultGPU boolean no Application
SingleMainWindow boolean no Application
URL string yes for Link Link

Additional Actions

The Exec Key

Field code Expands to
%f a single file, even if several are selected
%F a list of files
%u a single URL
%U a list of URLs
%i the icon, as two arguments --icon and the Icon value
%c the translated Name
%k the path to the desktop file

Historical and Deprecated Forms

Consequences for the Reader

The desktop entry reader in this project parses the file into groups, keys, and values.

Verification