Recognized desktop entry keys

Keys may be postfixed by [locale], where locale is the LOCALE type of the entry. locale must be of the form lang[_COUNTRY][.ENCODING], where either _COUNTRY or .ENCODING may be omitted. If a postfixed key occurs, the same key must be also present without the postfix.

When reading in the desktop entry file, the value of the key is selected by matching the current POSIX locale for the LC_MESSAGES category against the locale postfixes of all occurrences of the key, with the .ENCODING part stripped. (The .ENCODING is used when the Encoding key for the desktop entry file is Legacy-Mixed, see the Appendix called The Legacy-Mixed encoding.)

The matching is done as follows: if the current value of LC_MESSAGES is lang_country.encoding@modifier, then, if a key for lang_country is present, it will be used. Otherwise, if a key for lang is present, it will be used. If both of these are missing, the required key without a locale specified is used. The encoding and modifier from the LC_MESSAGES value are ignored.

For example, if the current value of the LC_MESSAGES category is de_DE, and the desktop file includes:

 Name=Foo
 Name[de]=Foo auf Deutsch

Then the value used for the name key will be 'Foo auf Deutsch'. However, if a value is specified for Name[de_DE], then that will be used instead.

Case is significant. The keys "Name" and "NAME" are not equivalent. The same holds for group names. Key values are case sensitive as well.

Keys are either OPTIONAL or REQUIRED. If a key is optional it may or may not be present in the file. However, if it isn't, the implementation of the standard should not blow up, it must provide some sane defaults. Additionally, keys either MUST or MAY be supported by a particular implementation.

Some keys only make sense in the context when another particular key is also present.

Some example keys: Name[C], Comment[it].

Table 1. Standard Keys

KeyDescriptionValue TypeREQ?MUST?
Encoding encoding of the desktop entry file stringYESYES
Version version of Desktop Entry Specification numeric (4)NOYES
Name name of the entry, need not match binary name localestringYESYES
Type the type of desktop entry string (1)YESYES
FilePattern a list of regular expressions to match against for a file manager to determine if this entry's icon should be displayed. Usually simply the name of the main executable and friends. regexp(s)NONO
TryExec filename of a binary on disk used to determine if the program is actually installed. If not, entry may not show in menus, etc. stringNONO
NoDisplay whether not to display in menus, etc. booleanNONO
Comment descriptive comment localestringNOYES
Exec program to execute, possibly with arguments stringNOYES
Actions additional actions possible, see MIME type discussion in the Section called Detailed discussion of supporting MIME types string(s)NOYES
Icon icon to display in file manager, menus, etc. the icon MAY specify a specific path to override common search directories stringNOYES
MiniIcon small icon for menus, etc (deprecated). stringNONO
Hidden if true, pretend this entry doesn't exist. booleanNONO
Path if entry is type Application, the working directory to run the program in. stringNOYES
Terminal whether the program runs in a terminal window boolean (2)NOYES
TerminalOptions if the program runs in a terminal, any options that should be passed to the terminal emulator before actually executing the program stringNONO
SwallowTitle if entry is swallowed onto the panel, this should be the title of window localestringNONO
SwallowExec program to exec if swallowed app is clicked stringNONO
MimeType the MIME type(s) supported by this entry regexp(s)NONO
Patterns if entry is type MimeType, various file name extensions associated with the MIME type. regexp(s)NONO
DefaultApp if entry is type MimeType, the default application associated with this mime type stringNONO
Dev if FSDevice type of entry, the device to mount stringNONO
FSType The type of filesystem to try to mount stringNONO
MountPoint if FSDevice type of entry, the mount point of the device in question stringNONO
ReadOnly if FSDevice type of entry, specifies whether or not the device is read-only boolean (2)NONO
UnmountIcon icon to display when device is not mounted Mounted devices display icon from Icon key stringNONO
SortOrder if entry of type Directory, this may specify the order in which to display files strings (3)NONO
URL if entry is Link type, the URL to access string NOYES

Notes:

  1. possible values are Application, Link, FSDevice, MimeType, Directory, Service, ServiceType

  2. historically these have been represented by the numeric entries 0 or 1. With this version of the standard they are now to be represented as a boolean string. However, if an implementation is reading a pre-1.0 desktop entry, it should interpret 0 and 1 as false and true, respectively.

  3. historically this has been a comma separated list. This is inconsistent with other lists which are separated by a semicolon. When reading a pre-1.0 desktop entry, comma separated lists should continue to be supported.

  4. while the version field is not required to be present, it should be in all newer implementations of the Desktop Entry specification. If the version number is not present, a "pre-standard" desktop entry file is to be assumed.