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 (type 1),
Link (type 2), FSDevice
(type 3) and Directory (type 4).
| 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 |
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. | localestring | 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 |
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 |
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 |
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. | string(s) | NO | NO | 1 |
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 |
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 |
URL | If entry is Link type, the URL to access. | string | NO | YES | 2 |
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.
UnmountIcon s may be localized with the UnmountIcon[xx]= syntax.
| string | NO | NO | 3 |
SortOrder | This may specify the order in which to display files. | string(s) | NO | NO | 4 |