Desktop file format

m (add freedesktop desktop entry specification link)
(Maemo 5 - Fremantle: add info about Categories)
Line 17: Line 17:
  X-HildonDesk-ShowInToolbar=true    ''Show app in toolbar''
  X-HildonDesk-ShowInToolbar=true    ''Show app in toolbar''
  X-Osso-Type=application/x-executable
  X-Osso-Type=application/x-executable
 +
 +
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 therefore recommended that you add a line like
 +
Categories=Office;                ''Office or whatever Category is suitable''
 +
to the desktop file. 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].
= OS 2008 - Chinook =
= OS 2008 - Chinook =

Revision as of 16:44, 7 March 2010

Maemo 5 - Fremantle

.desktop files are read from directory:

/usr/share/applications/hildon/

Example .desktop file for opening top in terminal:

[Desktop Entry]
Encoding=UTF-8
Version=1.0                        version of .desktop file specification, should be 1.0
Type=Application
Terminal=true                      true: runs application inside of xterm window
Name=topx                          the name that appears in the menu
Exec=/usr/bin/osso-xterm top       the command that is executed when icon is clicked
Icon=                              Icon for shortcut, without path and extension  
#X-Window-Icon=timerwidget
X-Window-Icon=     
X-HildonDesk-ShowInToolbar=true    Show app in toolbar
X-Osso-Type=application/x-executable

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 therefore recommended that you add a line like

Categories=Office;                 Office or whatever Category is suitable

to the desktop file. 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.

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