Basic format of the file

Desktop Entry Standard
Prev |  | Next

# 2. Basic format of the file

These desktop entry files should have an extension of ".desktop" or ".kdelnk". ".kdelnk" is deprecated, and is only maintained for backwards compatibility. Determining file type on basis of extension makes determining the file type very easy and quick. When no file extension is present, the desktop system should fall back to recognition via "magic detection." Desktop entries which describe how a directory is to be formatted/displayed should be simply called ".directory".

The basic format of the desktop entry file requires that there be a "group" header named "[Desktop Entry]". For backwards compatibility, implementations may also support the header "[KDE Desktop Entry]". This "group" entry denotes that all {key,value} pairs following it belong in the Desktop Entry group. There may be other groups present in the file (see MIME types discussion below), but this is the most important group which explicitly needs to be supported. This group should also be used as the "magic key" for automatic mime type detection. There should be nothing proceeding this group in the desktop entry file but possibly one or more comments (see below).

Lines beginning with a "#" are considered comments and will be ignored, however they should be preserved across reads / writes of the desktop entry file.

Compliant implementations MUST not remove any fields from the file, even if they don't support them. Such fields must be maintained in a list somewhere, and if the file is "rewritten," they will be included. This ensures that any desktop-specific extensions will be preserved even if another system accesses and changes the file.

Entries in the file are {key,value} pairs in the format:

    Name=Value

Space before and after the equals sign should be supported; the "=" sign is the actual delimiter.

Prev | Home | Next
Desktop Entry Standard |  | Possible value types