Desktop file format

(Document)
(Maemo extension keys)
Line 58: Line 58:
== Maemo extension keys ==
== Maemo extension keys ==
-
The following keys have a particular meaning on Maemo:
+
The following keys have a particular meaning on Maemo. None of these fields are required.
-
 
+
-
 
+
{| class="wikitable"
{| class="wikitable"
Line 67: Line 65:
! Type
! Type
! Meaning
! Meaning
-
! Required?
 
|-
|-
| X-Text-Domain
| X-Text-Domain
| string
| string
| The L10n domain from which the application name is translated (with dgettext)
| The L10n domain from which the application name is translated (with dgettext)
-
|
 
|-
|-
| X-Osso-Service
| X-Osso-Service
| string
| string
| DBus service name - if specified hildon desktop will try to call the top_application method on this service rather than execute what is listed in the Exec field).
| DBus service name - if specified hildon desktop will try to call the top_application method on this service rather than execute what is listed in the Exec field).
-
|
 
|-
|-
| X-App-Loading-Image
| X-App-Loading-Image
-
|
 
|  
|  
|  
|  
|-
|-
| X-Maemo-Prestarted
| X-Maemo-Prestarted
-
|
 
|  
|  
|  
|  
|-
|-
| X-Maemo-Wm-Class
| X-Maemo-Wm-Class
-
|
 
|  
|  
|  
|  
|-
|-
| X-Maemo-Prestarted-Priority
| X-Maemo-Prestarted-Priority
-
|
 
|  
|  
|  
|  
|-
|-
| X-Maemo-Switcher-Icon
| X-Maemo-Switcher-Icon
-
|
 
|  
|  
|  
|  
|-
|-
| X-Maemo-Ignore-Lowmem
| X-Maemo-Ignore-Lowmem
-
|
 
|  
|  
|  
|  
|-
|-
| X-Maemo-Prestarted-Ignore-Load
| X-Maemo-Prestarted-Ignore-Load
-
|
 
|  
|  
|  
|  

Revision as of 16:35, 15 October 2010

Contents

Maemo 5 - Fremantle

.desktop files are read from directory:

/usr/share/applications/hildon/

.desktop files consist of at least one Desktop Entry group, containing at least the fields Type and Name.

Maemo .desktop files conform with the freedesktop.org desktop entry spec version 1.0.

Standard keys

Maemo recognises and parses a subset of all of the standard keys defined in the desktop spec. The following keys have a specific meaning in Maemo:

Key Type Meaning Required?
Type string Possible values are "Application", "Link" or "Directory". Only "Application" and "Directory" are parsed on Maemo. Y
Name string The name of the Desktop Entry group - should be unique on the system Y
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, the algorithm described in the Icon Theme Specification will be used to locate the icon. N
Comment string Tooltip for the icon. Unused in touch interface. N
NoDisplay boolean If this is set to true the icon will not be shown in the menu. This is useful for applications which are associated with a mime type, but are not intended for standalone use. N
Exec string The absolute path to the executable to be run when the desktop entry is selected. N
Categories string This field is not used by hildon-desktop, but is used by 3rd party applications such as Catorise N


Maemo extension keys

The following keys have a particular meaning on Maemo. None of these fields are required.

Key Type Meaning
X-Text-Domain string The L10n domain from which the application name is translated (with dgettext)
X-Osso-Service string DBus service name - if specified hildon desktop will try to call the top_application method on this service rather than execute what is listed in the Exec field).
X-App-Loading-Image
X-Maemo-Prestarted
X-Maemo-Wm-Class
X-Maemo-Prestarted-Priority
X-Maemo-Switcher-Icon
X-Maemo-Ignore-Lowmem
X-Maemo-Prestarted-Ignore-Load


Note that while Maemo 5 (Fremantle) does not by default read the "Categories="-entry from the desktop file, enhanced menu applications like Catorise do. It is recommended that you add a Categories line to the .desktop file.

Categories=Office;                 Office or whatever Category is suitable

It is silently ignored in the standard application menu, but allows you to pre-define the location of your application in Catorise. A list of valid categories is found here.

The canonical source for the key types supported on Maemo is the hildon-desktop module, and specifically the files src/launcher/hd-launcher-item.c and src/launcher/hd-launcher-app.c

OS 2008 - Chinook

Format of Maemo .desktop files

Below are the fields supported in hildon-desktop:

Type
Should be application
Icon
Name
Categories
not used on maemo, but used in Ubuntu mobile
Comment
now unused, was used as second line of text in the startup menu in Bora
Exec
NoDisplay
set to true to hide the entry in the menu
StartupNotify
set to false to disable the startup notification banner
StartupWMClass
used to override the expected window class name, default to the binary name

Some Maemo-specific extensions:

X-Text-Domain
set the L10n domain from which the application name is translated (with dgettext)
X-Osso-Service
a DBus service name - if specified hildon desktop will try to call the top_application method on this service rather than execute what is listed in the Exec field).

(Credits to Johan Billen)

BTW: If your application needs the browser to do special URL handling, the desktop file needs to be extended accordingly.

Further reading