Recognized desktop entry keys

Desktop Entry Standard
Prev |  | Next

# 4. 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 Appendix B.)

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

Key | Description | Value Type | REQ? | MUST?
--- | --- | --- | --- | ---
Encoding | encoding of the desktop entry file | string | YES | YES
Version | version of Desktop Entry Specification | numeric (4) | NO | YES
Name | name of the entry, need not match binary name | localestring | YES | YES
Type | the type of desktop entry | string (1) | YES | YES
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) | NO | NO
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. | string | NO | NO
NoDisplay | whether not to display in menus, etc. | boolean | NO | NO
Comment | descriptive comment | localestring | NO | YES
Exec | program to execute, possibly with arguments | string | NO | YES
Actions | additional actions possible, see MIME type discussion in Section 7 | string(s) | NO | YES
Icon | icon to display in file manager, menus, etc. the icon MAY specify a specific path to override common search directories | string | NO | YES
MiniIcon | small icon for menus, etc (deprecated). | string | NO | NO
Hidden | if true, pretend this entry doesn't exist. | boolean | NO | NO
Path | if entry is type Application, the working directory to run the program in. | string | NO | YES
Terminal | whether the program runs in a terminal window | boolean (2) | NO | YES
TerminalOptions | if the program runs in a terminal, any options that should be passed to the terminal emulator before actually executing the program | string | NO | NO
SwallowTitle | if entry is swallowed onto the panel, this should be the title of window | localestring | NO | NO
SwallowExec | program to exec if swallowed app is clicked | string | NO | NO
MimeType | the MIME type(s) supported by this entry | regexp(s) | NO | NO
Patterns | if entry is type MimeType, various file name extensions associated with the MIME type. | regexp(s) | NO | NO
DefaultApp | if entry is type MimeType, the default application associated with this mime type | string | NO | NO
Dev | if FSDevice type of entry, the device to mount | string | NO | NO
FSType | The type of filesystem to try to mount | string | NO | NO
MountPoint | if FSDevice type of entry, the mount point of the device in question | string | NO | NO
ReadOnly | if FSDevice type of entry, specifies whether or not the device is read-only | boolean (2) | NO | NO
UnmountIcon | icon to display when device is not mounted Mounted devices display icon from Icon key | string | NO | NO
SortOrder | if entry of type Directory, this may specify the order in which to display files | strings (3) | NO | NO
URL | if entry is Link type, the URL to access | string | NO | YES

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.

Prev | Home | Next
Possible value types |  | Character set encoding of the file