Editing Desktop file format

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
== Maemo 5 - Fremantle ==
+
= Maemo 5 - Fremantle =
-
''application''.desktop files are read from directory:
+
.desktop files are read from directory:
  /usr/share/applications/hildon/
  /usr/share/applications/hildon/
-
''application''.desktop files consist of at least one <code>Desktop Entry</code> group, containing at least the fields <code>Type</code> and <code>Name</code>.
+
.desktop files consist of at least one <code>Desktop Entry</code> group, containing at least the fields <code>Type</code> and <code>Name</code>.
-
Maemo ''application''.desktop files conform with [http://standards.freedesktop.org/desktop-entry-spec/1.0/ the freedesktop.org desktop entry spec version 1.0].
+
Maemo .desktop files conform with [http://standards.freedesktop.org/desktop-entry-spec/1.0/ the freedesktop.org desktop entry spec version 1.0].
-
These files are parsed by a number of different modules in Maemo: hildon-desktop reads them to display icons in the main application menu, and launch applications. [http://maemo.gitorious.org/fremantle-hildon-desktop/libhildonmime/ libhildonmime] reads the files to launch applications associated with a specific mime type.
+
== Standard keys ==
-
 
+
-
''widget''.desktop files are read from directory:
+
-
/usr/share/applications/hildon-home/
+
-
They determine which widgets can get added to desktop(s)
+
-
 
+
-
=== 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:
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:
{| class="wikitable"
{| class="wikitable"
-
|+ Standardised desktop file keys supported in Maemo
 
|-
|-
! Key
! Key
Line 26: Line 19:
! Required?
! Required?
|-
|-
-
| <code>Type</code>
+
| Type
| string
| string
| Possible values are "Application", "Link" or "Directory". Only "Application" and "Directory" are parsed on Maemo.
| Possible values are "Application", "Link" or "Directory". Only "Application" and "Directory" are parsed on Maemo.
| Y
| Y
|-
|-
-
| <code>Name</code>
+
| Name
| string
| string
| The name of the Desktop Entry group - should be unique on the system
| The name of the Desktop Entry group - should be unique on the system
| Y
| Y
|-
|-
-
| <code>Icon</code>
+
| Icon
-
| string
+
|  
| 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 [http://freedesktop.org/wiki/Standards/icon-theme-spec Icon Theme Specification] will be used to locate the 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 [http://freedesktop.org/wiki/Standards/icon-theme-spec Icon Theme Specification] will be used to locate the icon.  
| N
| N
|-
|-
-
| <code>Comment</code>
+
| Comment
| string
| string
| Tooltip for the icon. Unused in touch interface.
| Tooltip for the icon. Unused in touch interface.
| N
| N
|-
|-
-
| <code>NoDisplay</code>
+
| NoDisplay
| boolean
| boolean
| If this is set to <code>true</code> 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.
| If this is set to <code>true</code> 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
| N
|-
|-
-
| <code>Exec</code>
+
| Exec
| string
| string
| The absolute path to the executable to be run when the desktop entry is selected.
| The absolute path to the executable to be run when the desktop entry is selected.
| N
| N
|-
|-
-
| <code>Categories</code>
+
| Categories
| string
| string
| This field is not used by hildon-desktop, but is used by 3rd party applications such as Catorise
| This field is not used by hildon-desktop, but is used by 3rd party applications such as Catorise
-
| N
 
-
|-
 
-
| <code>MimeType</code>
 
-
| string
 
-
| Parsed by libhildonmime, this field relates the mime type of a file to the applications which can be used to open it.
 
| N
| N
|}
|}
-
The frequently found key "<code>Version=</code>" is seemingly unused in Maemo at the time of this writing. Anyway according to http://standards.freedesktop.org/desktop-entry-spec/1.0/ar01s05.html it MUST NOT hold the version of the executable, rather it defines the format and version of the .desktop file itself *). In expression:
 
-
Version=1.0  is the only valid version key for .desktop files (of v1.0)
 
-
*)>>Version of the Desktop Entry Specification that the desktop entry conforms with. Entries that conform to this version of the specification should use 1.0. Note that the version field is not required to be present.
 
-
=== Maemo extension keys ===
+
== Maemo extension keys ==
The following keys have a particular meaning on Maemo. None of these fields are required.
The following keys have a particular meaning on Maemo. None of these fields are required.
{| class="wikitable"
{| class="wikitable"
-
|+ Maemo-specific extensions to the standardised desktop file keys supported in Maemo
 
|-
|-
! Key
! Key
Line 82: Line 66:
! Meaning
! Meaning
|-
|-
-
| <code>X-Text-Domain</code>
+
| 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)
|-
|-
-
| <code>X-Osso-Service</code>
+
| X-Osso-Service
| string
| string
-
| DBus service name - if specified hildon desktop will try to call the <code>top_application</code> method on this service rather than execute what is listed in the <code>Exec</code> 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).
|-
|-
-
| <code>X-App-Loading-Image</code>
+
| X-App-Loading-Image
-
| string
+
|  
-
| Location of application loading image, will  be loaded if there is no screenshot with the string of X-Osso-Service in $HOME/.cache/launch/, if none, no loading image is shown while the application is being started.
+
|  
|-
|-
-
| <code>X-Maemo-Prestarted</code>
+
| X-Maemo-Prestarted
-
| boolean
+
|  
-
| If true, the application will be started automatically at boot time. However: X-Maemo-Prestarted=always in calendar.desktop. Which works for e.g xchat as well
+
|  
-
 
+
|-
|-
-
| <code>X-Maemo-Wm-Class</code>
+
| X-Maemo-Wm-Class
|  
|  
|  
|  
|-
|-
-
| <code>X-Maemo-Prestarted-Priority</code>
+
| X-Maemo-Prestarted-Priority
-
| number
+
|  
-
| Priority for the application launch - lower means application is launched sooner
+
|  
|-
|-
-
| <code>X-Maemo-Switcher-Icon</code>
+
| X-Maemo-Switcher-Icon
|  
|  
|  
|  
|-
|-
-
| <code>X-Maemo-Ignore-Lowmem</code>
+
| X-Maemo-Ignore-Lowmem
| boolean
| boolean
-
| Ignore the low memory status when this application is launched. If this is absent, or set to false, an application will not be launched if there is insufficient memory available.
+
| Ignore the low memory status when this application is launched. If this is absent, or set to false, an application will not be launched is there is insufficient memory available.
|-
|-
-
| <code>X-Maemo-Prestarted-Ignore-Load</code>
+
| X-Maemo-Prestarted-Ignore-Load
-
| boolean
+
|  
-
| If true, prestart the app as soon as possible without regards to load or memory limits
+
|  
-
|-
+
-
| <code>X-Osso-Service</code>
+
-
| string
+
-
| The name of the DBus service to call to start this application on demand
+
-
|-
+
-
| <code>X-Osso-URI-Actions</code>
+
-
| string
+
-
| Used in [[URL Handler/API rev1|version 1 of URL handler]] to indicate URI handlers which this application can deal with
+
-
|-
+
-
| <code>X-Multiple</code>
+
-
| boolean
+
-
| Allows installing multiple of these widgets on desktop (/usr/share/applications/hildon-home/*.desktop; needs reboot or killall hildon-home after edit)
+
|}
|}
-
Note that while Maemo 5 (Fremantle) does not by default read the "<code>Categories=</code>"-entry from the desktop file, enhanced menu applications like [http://maemo.org/downloads/product/Maemo5/catorise/ Catorise] do. It is recommended that you add a Categories line to the .desktop file.
+
 
 +
Note that while Maemo 5 (Fremantle) does not by default read the "Categories="-entry from the desktop file, enhanced menu applications like [http://maemo.org/downloads/product/Maemo5/catorise/ Catorise] do. It is recommended that you add a Categories line to the .desktop file.
  Categories=Office;                ''Office or whatever Category is suitable''
  Categories=Office;                ''Office or whatever Category is suitable''
Line 138: Line 110:
It is silently ignored in the standard application menu, but allows you to pre-define the location of your application in [http://maemo.org/downloads/product/Maemo5/catorise/ Catorise]. A list of valid categories is found [http://standards.freedesktop.org/menu-spec/latest/apa.html here].
It is silently ignored in the standard application menu, but allows you to pre-define the location of your application in [http://maemo.org/downloads/product/Maemo5/catorise/ Catorise]. A list of valid categories is found [http://standards.freedesktop.org/menu-spec/latest/apa.html here].
-
The canonical source for the key types supported on Maemo for the application menu is the <code>hildon-desktop</code> module, and specifically the files [http://maemo.gitorious.org/fremantle-hildon-desktop/hildon-desktop/blobs/master/src/launcher/hd-launcher-item.c src/launcher/hd-launcher-item.c] and [http://maemo.gitorious.org/fremantle-hildon-desktop/hildon-desktop/blobs/master/src/launcher/hd-launcher-app.c src/launcher/hd-launcher-app.c]
+
The canonical source for the key types supported on Maemo is the <code>hildon-desktop</code> module, and specifically the files [http://maemo.gitorious.org/fremantle-hildon-desktop/hildon-desktop/blobs/master/src/launcher/hd-launcher-item.c src/launcher/hd-launcher-item.c] and [http://maemo.gitorious.org/fremantle-hildon-desktop/hildon-desktop/blobs/master/src/launcher/hd-launcher-app.c src/launcher/hd-launcher-app.c]
-
 
+
-
=== URL handlers ===
+
-
 
+
-
There are a number of custom fields used in [http://maemo.gitorious.org/fremantle-hildon-desktop/libhildonmime/blobs/master/libhildonmime/hildon-uri.c hildon-uri.c] to handle [[URL Handler|custom URI groups]].
+
== OS 2008 - Chinook ==
== OS 2008 - Chinook ==
Line 154: Line 122:
; Name
; Name
; Categories
; Categories
-
:not used on Maemo, but used in Ubuntu mobile
+
:not used on maemo, but used in Ubuntu mobile
; Comment
; Comment
:now unused, was used as second line of text in the startup menu in Bora
:now unused, was used as second line of text in the startup menu in Bora
Line 170: Line 138:
:set the L10n domain from which the application name is translated (with dgettext)
:set the L10n domain from which the application name is translated (with dgettext)
;X-Osso-Service
;X-Osso-Service
-
:a DBus service name - if specified hildon desktop will try to call the <code>top_application</code> method on this service rather than execute what is listed in the Exec field).
+
: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 [https://bugs.maemo.org/show_bug.cgi?id=95#c15 Johan Billen])
(Credits to [https://bugs.maemo.org/show_bug.cgi?id=95#c15 Johan Billen])
Line 176: Line 144:
BTW: If your application needs the browser to do special URL handling, the desktop file needs to be extended [[URL_Handler|accordingly]].
BTW: If your application needs the browser to do special URL handling, the desktop file needs to be extended [[URL_Handler|accordingly]].
-
== Further reading ==
+
= Further reading =
* [http://standards.freedesktop.org/desktop-entry-spec/1.0/ Desktop Entry Specification]
* [http://standards.freedesktop.org/desktop-entry-spec/1.0/ Desktop Entry Specification]

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)