|
Packit |
1470ea |
|
|
Packit |
1470ea |
<page xmlns="http://projectmallard.org/1.0/" xmlns:its="http://www.w3.org/2005/11/its" type="topic" style="task" id="dev-launching-desktop" xml:lang="oc">
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<info>
|
|
Packit |
1470ea |
<link type="next" xref="dev-launching-icons"/>
|
|
Packit |
1470ea |
<revision version="0.1" date="2014-01-28" status="draft"/>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<credit type="author">
|
|
Packit |
1470ea |
<name>David King</name>
|
|
Packit |
1470ea |
<email its:translate="no">davidk@gnome.org</email>
|
|
Packit |
1470ea |
<years>2014</years>
|
|
Packit |
1470ea |
</credit>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<include xmlns="http://www.w3.org/2001/XInclude" href="cc-by-sa-3-0.xml"/>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
</info>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<title>Install a desktop file</title>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
<links type="series" style="floatend">
|
|
Packit |
1470ea |
<title>Launch your application</title>
|
|
Packit |
1470ea |
</links>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
Write and install a desktop file so that users can discover and launch
|
|
Packit |
1470ea |
your application.
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
GNOME uses the
|
|
Packit |
1470ea |
<link href="http://standards.freedesktop.org/desktop-entry-spec/latest/index.html">freedesktop.org
|
|
Packit |
1470ea |
Desktop Entry</link> and
|
|
Packit |
1470ea |
<link href="http://standards.freedesktop.org/menu-spec/latest/">Desktop
|
|
Packit |
1470ea |
Menu specifications</link> to describe application launchers. Installing a
|
|
Packit |
1470ea |
desktop file is the standard way to register your application with GNOME and
|
|
Packit |
1470ea |
other desktops.
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
A desktop file lists your application binary, name and type, and can also
|
|
Packit |
1470ea |
list an icon, description and several other pieces of information about
|
|
Packit |
1470ea |
launching an application.
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
For a hypothetical application <app>My Application</app>, a desktop file
|
|
Packit |
1470ea |
would look as follows:
|
|
Packit |
1470ea |
<example>
|
|
Packit |
1470ea |
<listing>
|
|
Packit |
1470ea |
<title><file>myapplication.desktop</file></title>
|
|
Packit |
1470ea |
[Desktop Entry]
|
|
Packit |
1470ea |
Name=My Application
|
|
Packit |
1470ea |
Exec=myapplication
|
|
Packit |
1470ea |
Type=Application
|
|
Packit |
1470ea |
Icon=myapplication
|
|
Packit |
1470ea |
Comment=Do the thing that the application does
|
|
Packit |
1470ea |
Categories=GTK;GNOME;Utility;
|
|
Packit |
1470ea |
</listing>
|
|
Packit |
1470ea |
</example>
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
The [Desktop Entry] line indicates that this is a desktop
|
|
Packit |
1470ea |
file. It is followed by keys, which describe the application launcher. The
|
|
Packit |
1470ea |
Name key is the human-readable name of the application, to be
|
|
Packit |
1470ea |
shown in the UI. The application binary is listed in the Exec
|
|
Packit |
1470ea |
key, either the complete path or a binary that is looked up in the
|
|
Packit |
1470ea |
PATH . The last required key is the Type , which for
|
|
Packit |
1470ea |
applications is always Application . Alternative types are listed
|
|
Packit |
1470ea |
in the desktop entry specification.
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
Other fields in the desktop file are optional, but recommended.
|
|
Packit |
1470ea |
Applications should install an icon, and list the name of the icon (excluding
|
|
Packit |
1470ea |
the extension) in the Icon key. The Comment is a
|
|
Packit |
1470ea |
brief description of the application. To help users when browsing
|
|
Packit |
1470ea |
applications, the Categories key should be populated with a
|
|
Packit |
1470ea |
list of categories, separated by a semicolon, from the Desktop Menu
|
|
Packit |
1470ea |
Specification.
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
There are several other keys that can be added to desktop files, which are
|
|
Packit |
1470ea |
listed and described in the Desktop Entry Specification.
|
|
Packit |
1470ea |
|
|
Packit |
1470ea |
</page>
|