[Gpephone-devel] Adding new entry to .desktop file

Nils Faerber nils.faerber at kernelconcepts.de
Thu Jan 3 12:45:39 CET 2008


WANG Gang RD-ILAB-PEK schrieb:
> Hi, Florian
Hello!

Conincidentially we had this discussion yersterday ;)

>     Based on our last meeting in Beijing, some new information of an
> application is to be added to its .desktop file to manifest its
> capabilities of acting upon certain types of data.
>     I am thinking of doing this as following:
> 
>     Mime=audio/mp3:Open;application/ogg:Edit

There is already a mimetype entry for the already used .desktop files, see

http://standards.freedesktop.org/desktop-entry-spec/latest/

and especially

http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s07.html

>     the key is 'Mime'
>     diferrent mime types and actions are delimited by a semi colon ';'
>     each mime type is followed by a colon ':' which introduces the
> action(s)
>     for the same mime type, if this application is capable of achieving
> more than one action, separate them by a comma ',', for example:
> audio/mp3:Open,Edit
>     mime types are based on iana's specification, but we are not limited
> in this domain, we can freely add any mime types if appropriate.

The "problem" here is how to add the verbs.
The MimeType field already allows for a list of mimetypes.
The second problem is that we have to standardise verbs we want to
become common methods (like "open" vs. "read" - only one should be used).

>     When applauncher parses the .desktop file, it will store the
> information in a hash table by using each mime/action pair (in form of
> 'mime:action') as the key and application's name as the value.

That looks good ;)

On the one hand it seems to be a bad idea to duplicate the already
existing MimeType field on the other hand its current content is too
limiting for us.
Probably we should ask the .desktop standard creators for advise? I
could imagine to create a new tag for our purpose, like
	MimeTypeAction
or similar.
What I would like to see is
- allow multiple occurance of the keyword/label
- have one mimetype and multiple verbs per entry

Like:
...
MimeTypeAction=text/ascii:create,open,read,save
MimeTypeAction=image/jpeg:open
...

This would be easy to parse and easy to read.

>     What is your idea?

Good start!

> BR
> Gang
Cheers
  nils faerber

-- 
kernel concepts GbR        Tel: +49-271-771091-12
Sieghuetter Hauptweg 48    Fax: +49-271-771091-19
D-57072 Siegen             Mob: +49-176-21024535
--



More information about the Gpephone-devel mailing list