[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: *.desktop Files



Hi,

On Wed, May 25, 2016 at 11:00:10AM +0200, Hartwig Flamm wrote:
> linked in /usr/share/applications/libreoffice-*) and they all have this
> Comment at their Beginning:
> 
[ snip ]
> As far as I found in the Documentation the first Line in a *.desktop
> File hast to be:
> 
> [Desktop Entry]

No, the Documentation does NOT say this :)

>From the specification (https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s02.html):

--- snip ---
Basic format of the file
[...]
Comments

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

Comment lines are uninterpreted and may contain any character (except for LF). However, using UTF-8 for comment lines that contain characters not in ASCII is encouraged.

Group headers

A group header with name groupname is a line in the format:

[groupname]
Group names may contain all ASCII characters except for [ and ] and control characters.

Multiple groups may not have the same name.

All {key,value} pairs following a group header until a new group header belong to the group.

The basic format of the desktop entry file requires that there be a group header named Desktop Entry. There may be other groups present in the file, 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 preceding this group in the desktop entry file but possibly one or more comments.
-- snip --

The specification does not say that this had the first line but that nothing should precede it -
*except comments*.
The only things preceding it _is_ comments ;)

We could change it nevertheless, but the files are correct according to the
specification.

> If You put this Files, or a soft Link pointing to them, on the Desktop
> or in the Desktop Folder, KDE will open the *.desktop File in Kate
> instead of running the Open Libre Component.

Why would one do that? To open it from the Desktop directly?

But given the above this looks more like KDE not handling it correctly to me?
Regards,

Rene


Reply to: