Keys with type localestring may be postfixed by [LOCALE],
where LOCALE is the locale type of the
entry. LOCALE must be of the form
,
where
lang_COUNTRY.ENCODING@MODIFIER_,
COUNTRY.,
and ENCODING@
may be omitted. If a postfixed key occurs, the same
key must be also present without the postfix.
MODIFIER
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
. part
stripped. The
ENCODING. field is
used only when the value of the ENCODINGEncoding key
for the desktop entry file is Legacy-Mixed
(see Appendix D, The Legacy-Mixed Encoding (Deprecated).)
The matching of is done as follows. If
LC_MESSAGES is of the form
,
then it will match a key of the form
lang_COUNTRY.ENCODING@MODIFIER.
If such a key does not exist, it will attempt to match
lang_COUNTRY@MODIFIER
followed by
lang_COUNTRY.
Then, a match against lang@MODIFIERlang by itself
will be attempted. Finally, if no matching key is found the
required key without a locale specified is used. The encoding
from the LC_MESSAGES value is ignored
when matching.
If LC_MESSAGES does not have a MODIFIER
field, then no key with a modifier will be matched. Similarly, if
LC_MESSAGES does not have a COUNTRY
field, then no key with a country specified will be matched. If
LC_MESSAGES just has a lang field, then
it will do a straight match to a key with a similar value. The
following table lists possible matches of various LC_MESSAGES values in
the order in which they are matched. Note that the
ENCODING field isn't shown.
Table 1. Locale Matching
LC_MESSAGES value | Possible keys in order of matching |
|---|---|
|
,
,
,
,
default value
|
|
,
lang,
default value
|
|
,
lang,
default value
|
lang |
lang,
default value
|
For example, if the current value of the LC_MESSAGES category
is sr_YU@Latn and the desktop file includes:
Name=Foo Name[sr_YU]=... Name[sr@Latn]=... Name[sr]=...
then the value of the Name keyed by sr_YU is used.
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 2. Standard Keys
| Key | Description | Value Type | REQ? | MUST? | Type |
|---|---|---|---|---|---|
Type |
There are 4 types of desktop entries:
Application,
Link, FSDevice
and Directory.
| string | YES | YES | |
Version | Version of Desktop Entry Specification (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). | numeric | NO | YES | 1-4 |
Encoding |
Encoding of the whole desktop entry file
(UTF-8 or
Legacy-Mixed).
| string | YES | YES | 1-4 |
Name | Specific name of the application, for example "Mozilla". | localestring | YES | YES | 1-4 |
GenericName | Generic name of the application, for example "Web Browser". | localestring | NO | YES | 1-4 |
NoDisplay |
NoDisplay means "this application exists, but don't display it in the menus".
This can be useful to e.g. associate this application with MIME types, so that
it gets launched from a file manager (or other apps), without having a menu
entry for it (there are tons of good reasons for this, including e.g. the
netscape -remote, or kfmclient openURL kind of stuff).
| boolean | NO | NO | 1-4 |
Comment |
Tooltip for the entry, for example "View sites on the
Internet", should not be redundant with Name or
GenericName.
| localestring | NO | YES | 1-4 |
Icon |
Icon to display in file manager, menus, etc. If the
name is an absolute path, the given file will be
used. If the name is not an absolute path, an
implementation-dependent search algorithm will be used
to locate the icon. Icons may be localized with the
Icon[xx]= syntax.
| string | NO | YES | 1-4 |
Hidden |
Hidden should have been called Deleted.
It means the user deleted (at his level)
something that was present (at an upper level, e.g. in the system dirs). It's
strictly equivalent to the .desktop file not existing at all, as far as that user is
concerned. This can also be used to "uninstall" existing files (e.g. due to a renaming)
- by letting make install install a file with Hidden=true in it.
| boolean | NO | NO | 1-4 |
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 | 1 |
TryExec | File name 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 | 1 |
Exec | Program to execute, possibly with arguments. | string | NO | YES | 1 |
Path |
If entry is of type Application, the working directory to run the program in.
| string | NO | YES | 1 |
Terminal | Whether the program runs in a terminal window. | boolean | NO | YES | 1 |
SwallowTitle | If entry is swallowed onto the panel, this should be the title of the window. | localestring | NO | NO | 1 |
SwallowExec | Program to exec if swallowed app is clicked. | string | NO | NO | 1 |
Actions | Additional actions possible, see MIME type discussion in the section called “Registering MIME Types”. | string(s) | NO | YES | 1 |
MimeType | The MIME type(s) supported by this entry. | strings(s) | NO | NO | 1 |
SortOrder | This may specify the order in which to display files. | string(s) | NO | NO | 4 |
Dev | The device to mount. | string | NO | NO | 3 |
FSType | The type of file system to try to mount. | string | NO | NO | 3 |
MountPoint | The mount point of the device in question. | string | NO | NO | 3 |
ReadOnly | Specifies whether or not the device is read only. | boolean | NO | NO | 3 |
UnmountIcon |
Icon to display when device is not mounted. Mounted devices display icon from the Icon key.
UnmountIcons may be localized with the UnmountIcon[xx]= syntax.
| string | NO | NO | 3 |
URL | If entry is Link type, the URL to access. | string | NO | YES | 2 |
Categories | Categories in which the entry should be shown in a menu (for possible values see the Desktop Menu Specification). | string(s) | NO | NO | 1 |
OnlyShowIn, NotShowIn |
A list of strings identifying the environments that should
display/not display a given desktop entry. Only one of
these keys, either OnlyShowIn or
NotShowIn, may appear in a group (for
possible values see the Desktop
Menu Specification).
| string(s) | NO | NO | 1-4 |
StartupNotify |
If true, it is KNOWN that the application will send a "remove"
message when started with the DESKTOP_LAUNCH_ID environment variable
set (see the Startup Notification Protocol Specification for more details).
| boolean | NO | NO | 1 |
StartupWMClass | If true, it is KNOWN that the application will map at least one window with the given string as its WM class or WM name hint (see the Startup Notification Protocol Specification for more details). | string | NO | NO | 1 |