summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldo Bastian <waldo.bastian@intel.com>2006-09-14 03:12:44 +0000
committerWaldo Bastian <waldo.bastian@intel.com>2006-09-14 03:12:44 +0000
commitc70b1d02c62307a7cbad1fc1b4daa12f04ac34da (patch)
treefb19f80e0e7e3b7f7050e6dbef5a6dc4688b7ac4
parent652d615809016f5b776ddc2786e733abc69ac6f5 (diff)
Docu update
-rw-r--r--scripts/desc/xdg-desktop-menu.xml231
-rw-r--r--scripts/html/xdg-desktop-menu.html164
-rw-r--r--scripts/man/xdg-desktop-menu.1123
-rwxr-xr-xscripts/xdg-desktop-menu147
4 files changed, 416 insertions, 249 deletions
diff --git a/scripts/desc/xdg-desktop-menu.xml b/scripts/desc/xdg-desktop-menu.xml
index 58e7af0..83752b0 100644
--- a/scripts/desc/xdg-desktop-menu.xml
+++ b/scripts/desc/xdg-desktop-menu.xml
@@ -88,6 +88,33 @@
Install one or more applications in a submenu of
the desktop menu system.
</simpara>
+ <simpara><replaceable>desktop-file</replaceable>:
+ A desktop file represents a single menu entry in the menu.
+ Desktop files are defined by the freedesktop.org Desktop Entry
+ Specification. The most important aspects of *.desktop
+ files are summarized below.
+ </simpara>
+ <simpara>
+ Menu entries can be added to the menu system in two different
+ ways. They can either be added to a predefined submenu in the
+ menu system based on one or more category keywords, or they can
+ be added to a new submenu.
+ </simpara>
+ <simpara>
+ To add a menu entry to a predefined submenu the desktop file
+ that represents the menu entry must have a Categories= entry
+ that lists one or more keywords. The menu item will be included
+ in an appropriate submenu based on the included keywords.
+ </simpara>
+ <simpara>
+ To add menu items to a new submenu the desktop-files must be
+ preceded by a directory-file that describes the submenu.
+ If multiple desktop-files are specified, all entries will
+ be added to the same menu. If entries are installed to a menu
+ that has been created with a previous call to
+ <command>xdg-desktop-menu</command> the entries will be
+ installed in addition to any already existing entries.
+ </simpara>
<simpara><replaceable>directory-file</replaceable>:
The *.directory file indicated by
<replaceable>directory-file</replaceable> represents a submenu.
@@ -104,19 +131,6 @@
Directory files follow the syntax defined by the freedesktop.org
Desktop Entry Specification.
</simpara>
- <simpara><replaceable>desktop-file</replaceable>:
- A desktop file represents a single application in the menu.
- Desktop files are defined by the freedesktop.org Desktop Entry
- Specification. The most important aspects of *.desktop
- files are summarized below.
- </simpara>
- <simpara>
- If multiple desktop-files are specified, multiple entries will
- be added to the same menu. If entries are installed to a menu
- that has been created with a previous call to
- <command>xdg-desktop-menu</command> the entries will be
- installed in addition to any already existing entries.
- </simpara>
</listitem>
</varlistentry>
@@ -228,86 +242,6 @@
</variablelist>
</refsect1>
- <refsect1 id="directoryfiles">
- <title>Directory Files</title>
- <para>
- The appearance of submenu in the application menu is
- provided by a *.directory file. In particular it provides the title
- of the submenu and a possible icon. A *.directory file consists of a
- <emphasis>[Desktop Entry]</emphasis> header followed by several
- <replaceable>Key</replaceable>=<replaceable>Value</replaceable> lines.
- </para>
- <para>
- A *.directory file can provide a title (name) for the submenu
- in several different languages. This is done by adding a language
- code as used by LC_MESSAGES in square brackets behind the
- <replaceable>Key</replaceable>. This way one can specify different
- values for the same <replaceable>Key</replaceable> depending on the
- currently selected language.
- </para>
- <para>
- The following keys are relevqnt for submenus:
- </para>
- <variablelist>
- <varlistentry>
- <term>Value=1.0</term>
- <listitem>
- <simpara>
- This is a mandatory field to indicate that the *.directory file
- follows the 1.0 version of the Desktop Entry specification.
- </simpara>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Type=Directory</term>
- <listitem>
- <simpara>
- This is a mandatory field that indicates that the *.directory file
- describes a submenu.
- </simpara>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Name=<replaceable>Menu Name</replaceable></term>
- <listitem>
- <simpara>
- The title of submenu.
- For example <emphasis>Mozilla</emphasis>
- </simpara>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Comment=<replaceable>Comment</replaceable></term>
- <listitem>
- <simpara>
- Optional field to specify a tooltip for the submenu.
- </simpara>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>Icon=<replaceable>Icon File</replaceable></term>
- <listitem>
- <simpara>
- The icon to use for the submenu. This can either be
- an absolute path to an image file or an icon-name.
- If an icon-name is provided an image lookup by name is done
- in the user's current icon theme.
- The <command>xdg-icon-resource</command>
- command can be used to install image files into icon themes.
- The advantage of using an icon-name instead of an absolute
- path is that with an icon-name the submenu icon can be
- provided in several different sizes as well as in several
- differently themed styles.
- </simpara>
- </listitem>
- </varlistentry>
-
- </variablelist>
- </refsect1>
<refsect1 id="desktopfiles">
<title>Desktop Files</title>
<para>
@@ -411,7 +345,6 @@
</listitem>
</varlistentry>
-<!--
<varlistentry>
<term>Categories=<replaceable>Categories</replaceable></term>
<listitem>
@@ -419,12 +352,23 @@
A list of categories separated by semi-colons. A category is
a keyword that describes and classifies the application.
By default applications are organized in the application menu
- based on category. The XDG Desktop Menu Specification defines
- a large number of predefined categories.
+ based on category. When menu entries are explicitly assigned
+ to a new submenu it is not necassery to list any categories.
+ </simpara>
+ <simpara>
+ When using categories it is recommended to include
+ one of the following categories:
+ AudioVideo, Development, Education, Game, Graphics, Network,
+ Office, Settings, System, Utility.
+ </simpara>
+ <simpara>
+ See Appendix A of the XDG Desktop Menu Specification
+ for information about additional categories.
+ http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html
</simpara>
</listitem>
</varlistentry>
--->
+
<varlistentry>
<term>MimeType=<replaceable>Mimetypes</replaceable></term>
<listitem>
@@ -441,7 +385,86 @@
visit http://www.freedesktop.org/wiki/Standards/desktop-entry-spec
</para>
</refsect1>
+ <refsect1 id="directoryfiles">
+ <title>Directory Files</title>
+ <para>
+ The appearance of submenu in the application menu is
+ provided by a *.directory file. In particular it provides the title
+ of the submenu and a possible icon. A *.directory file consists of a
+ <emphasis>[Desktop Entry]</emphasis> header followed by several
+ <replaceable>Key</replaceable>=<replaceable>Value</replaceable> lines.
+ </para>
+ <para>
+ A *.directory file can provide a title (name) for the submenu
+ in several different languages. This is done by adding a language
+ code as used by LC_MESSAGES in square brackets behind the
+ <replaceable>Key</replaceable>. This way one can specify different
+ values for the same <replaceable>Key</replaceable> depending on the
+ currently selected language.
+ </para>
+ <para>
+ The following keys are relevqnt for submenus:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term>Value=1.0</term>
+ <listitem>
+ <simpara>
+ This is a mandatory field to indicate that the *.directory file
+ follows the 1.0 version of the Desktop Entry specification.
+ </simpara>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Type=Directory</term>
+ <listitem>
+ <simpara>
+ This is a mandatory field that indicates that the *.directory file
+ describes a submenu.
+ </simpara>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Name=<replaceable>Menu Name</replaceable></term>
+ <listitem>
+ <simpara>
+ The title of submenu.
+ For example <emphasis>Mozilla</emphasis>
+ </simpara>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Comment=<replaceable>Comment</replaceable></term>
+ <listitem>
+ <simpara>
+ Optional field to specify a tooltip for the submenu.
+ </simpara>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>Icon=<replaceable>Icon File</replaceable></term>
+ <listitem>
+ <simpara>
+ The icon to use for the submenu. This can either be
+ an absolute path to an image file or an icon-name.
+ If an icon-name is provided an image lookup by name is done
+ in the user's current icon theme.
+ The <command>xdg-icon-resource</command>
+ command can be used to install image files into icon themes.
+ The advantage of using an icon-name instead of an absolute
+ path is that with an icon-name the submenu icon can be
+ provided in several different sizes as well as in several
+ differently themed styles.
+ </simpara>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </refsect1>
<refsect1 id="env_vars">
<title>Environment Variables</title>
<para>
@@ -526,7 +549,7 @@
</refsect1>
<refsect1 id="examples">
<title>Examples</title>
-<!--
+
<para>
The company ShinyThings Inc. has developed an application named
"WebMirror" and would like to add it to the application menu.
@@ -560,19 +583,15 @@ xdg-desktop-menu install ./shinythings-webmirror.desktop
in two languages, English and Dutch.
The language code for Dutch is nl.
</para>
--->
<para>
- The company ShinyThings Inc. has developed an application named
- "WebMirror" and would like to add it to the application menu.
- The company will use "shinythings" as its vendor id.
- In this example the company ShinyThings Inc. will add its own
+ In the next example the company ShinyThings Inc. will add its own
submenu to the desktop application menu consisting of a
- "WebMirror" menu item and a
- "WebMirror Admin Tool" menu item.
+ "WebMirror" menu item and a "WebMirror Admin Tool" menu item.
</para>
<para>
First the company needs to create two .desktop files that describe
- the two menu items:
+ the two menu items. Since the items are to be added to a new submenu
+ it is not necassery to include a Categories= line:
<programlisting>
shinythings-webmirror.desktop:
diff --git a/scripts/html/xdg-desktop-menu.html b/scripts/html/xdg-desktop-menu.html
index daa6e30..eee4c2e 100644
--- a/scripts/html/xdg-desktop-menu.html
+++ b/scripts/html/xdg-desktop-menu.html
@@ -8,6 +8,29 @@
</p></div><div class="refsect1" lang="en"><a name="commands"></a><h2>Commands</h2><div class="variablelist"><dl><dt><span class="term">install</span></dt><dd><p>
Install one or more applications in a submenu of
the desktop menu system.
+ </p><p><em class="replaceable"><code>desktop-file</code></em>:
+ A desktop file represents a single menu entry in the menu.
+ Desktop files are defined by the freedesktop.org Desktop Entry
+ Specification. The most important aspects of *.desktop
+ files are summarized below.
+ </p><p>
+ Menu entries can be added to the menu system in two different
+ ways. They can either be added to a predefined submenu in the
+ menu system based on one or more category keywords, or they can
+ be added to a new submenu.
+ </p><p>
+ To add a menu entry to a predefined submenu the desktop file
+ that represents the menu entry must have a Categories= entry
+ that lists one or more keywords. The menu item will be included
+ in an appropriate submenu based on the included keywords.
+ </p><p>
+ To add menu items to a new submenu the desktop-files must be
+ preceded by a directory-file that describes the submenu.
+ If multiple desktop-files are specified, all entries will
+ be added to the same menu. If entries are installed to a menu
+ that has been created with a previous call to
+ <span><strong class="command">xdg-desktop-menu</strong></span> the entries will be
+ installed in addition to any already existing entries.
</p><p><em class="replaceable"><code>directory-file</code></em>:
The *.directory file indicated by
<em class="replaceable"><code>directory-file</code></em> represents a submenu.
@@ -21,17 +44,6 @@
</p><p>
Directory files follow the syntax defined by the freedesktop.org
Desktop Entry Specification.
- </p><p><em class="replaceable"><code>desktop-file</code></em>:
- A desktop file represents a single application in the menu.
- Desktop files are defined by the freedesktop.org Desktop Entry
- Specification. The most important aspects of *.desktop
- files are summarized below.
- </p><p>
- If multiple desktop-files are specified, multiple entries will
- be added to the same menu. If entries are installed to a menu
- that has been created with a previous call to
- <span><strong class="command">xdg-desktop-menu</strong></span> the entries will be
- installed in addition to any already existing entries.
</p></dd><dt><span class="term">uninstall</span></dt><dd><p>
Remove applications or submenus from the desktop menu system
previously installed with <span><strong class="command">xdg-desktop-menu install</strong></span>.
@@ -74,44 +86,7 @@
Show this manualpage.
</dd><dt><span class="term"><code class="option">--version</code></span></dt><dd>
Show the xdg-utils version information.
- </dd></dl></div></div><div class="refsect1" lang="en"><a name="directoryfiles"></a><h2>Directory Files</h2><p>
- The appearance of submenu in the application menu is
- provided by a *.directory file. In particular it provides the title
- of the submenu and a possible icon. A *.directory file consists of a
- <span class="emphasis"><em>[Desktop Entry]</em></span> header followed by several
- <em class="replaceable"><code>Key</code></em>=<em class="replaceable"><code>Value</code></em> lines.
- </p><p>
- A *.directory file can provide a title (name) for the submenu
- in several different languages. This is done by adding a language
- code as used by LC_MESSAGES in square brackets behind the
- <em class="replaceable"><code>Key</code></em>. This way one can specify different
- values for the same <em class="replaceable"><code>Key</code></em> depending on the
- currently selected language.
- </p><p>
- The following keys are relevqnt for submenus:
- </p><div class="variablelist"><dl><dt><span class="term">Value=1.0</span></dt><dd>
- This is a mandatory field to indicate that the *.directory file
- follows the 1.0 version of the Desktop Entry specification.
- </dd><dt><span class="term">Type=Directory</span></dt><dd>
- This is a mandatory field that indicates that the *.directory file
- describes a submenu.
- </dd><dt><span class="term">Name=<em class="replaceable"><code>Menu Name</code></em></span></dt><dd>
- The title of submenu.
- For example <span class="emphasis"><em>Mozilla</em></span>
- </dd><dt><span class="term">Comment=<em class="replaceable"><code>Comment</code></em></span></dt><dd>
- Optional field to specify a tooltip for the submenu.
- </dd><dt><span class="term">Icon=<em class="replaceable"><code>Icon File</code></em></span></dt><dd>
- The icon to use for the submenu. This can either be
- an absolute path to an image file or an icon-name.
- If an icon-name is provided an image lookup by name is done
- in the user's current icon theme.
- The <span><strong class="command">xdg-icon-resource</strong></span>
- command can be used to install image files into icon themes.
- The advantage of using an icon-name instead of an absolute
- path is that with an icon-name the submenu icon can be
- provided in several different sizes as well as in several
- differently themed styles.
- </dd></dl></div></div><div class="refsect1" lang="en"><a name="desktopfiles"></a><h2>Desktop Files</h2><p>
+ </dd></dl></div></div><div class="refsect1" lang="en"><a name="desktopfiles"></a><h2>Desktop Files</h2><p>
An application item in the application menu is represented by a
*.desktop file. A *.desktop file consists of a
<span class="emphasis"><em>[Desktop Entry]</em></span> header followed by several
@@ -159,14 +134,66 @@
be used instead of %f. If the application is able to open URLs
in addition to local files then %u or %U can be used instead
of %f or %F.
- </dd><dt><span class="term">MimeType=<em class="replaceable"><code>Mimetypes</code></em></span></dt><dd>
+ </dd><dt><span class="term">Categories=<em class="replaceable"><code>Categories</code></em></span></dt><dd><p>
+ A list of categories separated by semi-colons. A category is
+ a keyword that describes and classifies the application.
+ By default applications are organized in the application menu
+ based on category. When menu entries are explicitly assigned
+ to a new submenu it is not necassery to list any categories.
+ </p><p>
+ When using categories it is recommended to include
+ one of the following categories:
+ AudioVideo, Development, Education, Game, Graphics, Network,
+ Office, Settings, System, Utility.
+ </p><p>
+ See Appendix A of the XDG Desktop Menu Specification
+ for information about additional categories.
+ http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html
+ </p></dd><dt><span class="term">MimeType=<em class="replaceable"><code>Mimetypes</code></em></span></dt><dd>
A list of mimetypes separated by semi-colons. This field is
used to indicate which file types the application is able to
open.
</dd></dl></div><p>
For a complete oveview of the *.desktop file format please
visit http://www.freedesktop.org/wiki/Standards/desktop-entry-spec
- </p></div><div class="refsect1" lang="en"><a name="env_vars"></a><h2>Environment Variables</h2><p>
+ </p></div><div class="refsect1" lang="en"><a name="directoryfiles"></a><h2>Directory Files</h2><p>
+ The appearance of submenu in the application menu is
+ provided by a *.directory file. In particular it provides the title
+ of the submenu and a possible icon. A *.directory file consists of a
+ <span class="emphasis"><em>[Desktop Entry]</em></span> header followed by several
+ <em class="replaceable"><code>Key</code></em>=<em class="replaceable"><code>Value</code></em> lines.
+ </p><p>
+ A *.directory file can provide a title (name) for the submenu
+ in several different languages. This is done by adding a language
+ code as used by LC_MESSAGES in square brackets behind the
+ <em class="replaceable"><code>Key</code></em>. This way one can specify different
+ values for the same <em class="replaceable"><code>Key</code></em> depending on the
+ currently selected language.
+ </p><p>
+ The following keys are relevqnt for submenus:
+ </p><div class="variablelist"><dl><dt><span class="term">Value=1.0</span></dt><dd>
+ This is a mandatory field to indicate that the *.directory file
+ follows the 1.0 version of the Desktop Entry specification.
+ </dd><dt><span class="term">Type=Directory</span></dt><dd>
+ This is a mandatory field that indicates that the *.directory file
+ describes a submenu.
+ </dd><dt><span class="term">Name=<em class="replaceable"><code>Menu Name</code></em></span></dt><dd>
+ The title of submenu.
+ For example <span class="emphasis"><em>Mozilla</em></span>
+ </dd><dt><span class="term">Comment=<em class="replaceable"><code>Comment</code></em></span></dt><dd>
+ Optional field to specify a tooltip for the submenu.
+ </dd><dt><span class="term">Icon=<em class="replaceable"><code>Icon File</code></em></span></dt><dd>
+ The icon to use for the submenu. This can either be
+ an absolute path to an image file or an icon-name.
+ If an icon-name is provided an image lookup by name is done
+ in the user's current icon theme.
+ The <span><strong class="command">xdg-icon-resource</strong></span>
+ command can be used to install image files into icon themes.
+ The advantage of using an icon-name instead of an absolute
+ path is that with an icon-name the submenu icon can be
+ provided in several different sizes as well as in several
+ differently themed styles.
+ </dd></dl></div></div><div class="refsect1" lang="en"><a name="env_vars"></a><h2>Environment Variables</h2><p>
xdg-desktop-menu honours the following environment variables:
</p><div class="variablelist"><dl><dt><span class="term">XDG_UTILS_DEBUG_LEVEL</span></dt><dd>
Setting this environment variable to a non-zero numerical value
@@ -193,13 +220,40 @@
The company ShinyThings Inc. has developed an application named
"WebMirror" and would like to add it to the application menu.
The company will use "shinythings" as its vendor id.
- In this example the company ShinyThings Inc. will add its own
+ In order to add the application to the menu there needs to be a
+ .desktop file with a suitable <span class="emphasis"><em>Categories</em></span> entry:
+</p><pre class="programlisting">
+shinythings-webmirror.desktop:
+
+ [Desktop Entry]
+ Encoding=UTF-8
+ Type=Application
+
+ Exec=webmirror
+ Icon=webmirror
+
+ Name=WebMirror
+ Name[nl]=WebSpiegel
+
+ Categories=Network;WebDevelopment;
+</pre><p>
+ </p><p>Now the xdg-desktop-menu tool can be used to add the
+ shinythings-webmirror.desktop file to the desktop application menu:
+</p><pre class="programlisting">
+xdg-desktop-menu install ./shinythings-webmirror.desktop
+</pre><p>
+ </p><p>
+ Note that for the purpose of this example the menu items are available
+ in two languages, English and Dutch.
+ The language code for Dutch is nl.
+ </p><p>
+ In the next example the company ShinyThings Inc. will add its own
submenu to the desktop application menu consisting of a
- "WebMirror" menu item and a
- "WebMirror Admin Tool" menu item.
+ "WebMirror" menu item and a "WebMirror Admin Tool" menu item.
</p><p>
First the company needs to create two .desktop files that describe
- the two menu items:
+ the two menu items. Since the items are to be added to a new submenu
+ it is not necassery to include a Categories= line:
</p><pre class="programlisting">
shinythings-webmirror.desktop:
diff --git a/scripts/man/xdg-desktop-menu.1 b/scripts/man/xdg-desktop-menu.1
index 485744e..c70e768 100644
--- a/scripts/man/xdg-desktop-menu.1
+++ b/scripts/man/xdg-desktop-menu.1
@@ -2,7 +2,7 @@
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
-.TH "XDG\-DESKTOP\-MENU" "1" "09/11/2006" "xdg\-utils 1.0 beta4" ""
+.TH "XDG\-DESKTOP\-MENU" "1" "09/13/2006" "xdg\-utils 1.0 beta4" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
@@ -28,6 +28,16 @@ The application menu works according to the XDG Desktop Menu Specification at ht
install
Install one or more applications in a submenu of the desktop menu system.
.sp
+\fIdesktop\-file\fR: A desktop file represents a single menu entry in the menu. Desktop files are defined by the freedesktop.org Desktop Entry Specification. The most important aspects of *.desktop files are summarized below.
+.sp
+Menu entries can be added to the menu system in two different ways. They can either be added to a predefined submenu in the menu system based on one or more category keywords, or they can be added to a new submenu.
+.sp
+To add a menu entry to a predefined submenu the desktop file that represents the menu entry must have a Categories= entry that lists one or more keywords. The menu item will be included in an appropriate submenu based on the included keywords.
+.sp
+To add menu items to a new submenu the desktop\-files must be preceded by a directory\-file that describes the submenu. If multiple desktop\-files are specified, all entries will be added to the same menu. If entries are installed to a menu that has been created with a previous call to
+\fBxdg\-desktop\-menu\fR
+the entries will be installed in addition to any already existing entries.
+.sp
\fIdirectory\-file\fR: The *.directory file indicated by
\fIdirectory\-file\fR
represents a submenu. The directory file provides the name and icon for a submenu. The name of the directory file is used to identify the submenu.
@@ -35,12 +45,6 @@ represents a submenu. The directory file provides the name and icon for a submen
If multiple directory files are provided each file will represent a submenu within the menu that preceeds it, creating a nested menu hierarchy (sub\-sub\-menus). The menu entries themselves will be added to the last submenu.
.sp
Directory files follow the syntax defined by the freedesktop.org Desktop Entry Specification.
-.sp
-\fIdesktop\-file\fR: A desktop file represents a single application in the menu. Desktop files are defined by the freedesktop.org Desktop Entry Specification. The most important aspects of *.desktop files are summarized below.
-.sp
-If multiple desktop\-files are specified, multiple entries will be added to the same menu. If entries are installed to a menu that has been created with a previous call to
-\fBxdg\-desktop\-menu\fR
-the entries will be installed in addition to any already existing entries.
.TP
uninstall
Remove applications or submenus from the desktop menu system previously installed with
@@ -81,38 +85,6 @@ Show this manualpage.
.TP
\fB\-\-version\fR
Show the xdg\-utils version information.
-.SH "DIRECTORY FILES"
-.PP
-The appearance of submenu in the application menu is provided by a *.directory file. In particular it provides the title of the submenu and a possible icon. A *.directory file consists of a
-\fI[Desktop Entry]\fR
-header followed by several
-\fIKey\fR=\fIValue\fR
-lines.
-.PP
-A *.directory file can provide a title (name) for the submenu in several different languages. This is done by adding a language code as used by LC_MESSAGES in square brackets behind the
-\fIKey\fR. This way one can specify different values for the same
-\fIKey\fR
-depending on the currently selected language.
-.PP
-The following keys are relevqnt for submenus:
-.TP
-Value=1.0
-This is a mandatory field to indicate that the *.directory file follows the 1.0 version of the Desktop Entry specification.
-.TP
-Type=Directory
-This is a mandatory field that indicates that the *.directory file describes a submenu.
-.TP
-Name=\fIMenu Name\fR
-The title of submenu. For example
-\fIMozilla\fR
-.TP
-Comment=\fIComment\fR
-Optional field to specify a tooltip for the submenu.
-.TP
-Icon=\fIIcon File\fR
-The icon to use for the submenu. This can either be an absolute path to an image file or an icon\-name. If an icon\-name is provided an image lookup by name is done in the user's current icon theme. The
-\fBxdg\-icon\-resource\fR
-command can be used to install image files into icon themes. The advantage of using an icon\-name instead of an absolute path is that with an icon\-name the submenu icon can be provided in several different sizes as well as in several differently themed styles.
.SH "DESKTOP FILES"
.PP
An application item in the application menu is represented by a *.desktop file. A *.desktop file consists of a
@@ -154,10 +126,49 @@ command can be used to install image files into icon themes. The advantage of us
Exec=\fICommand Line\fR
The command line to start the application. If the application can open files the %f placeholder should be specified. When a file is dropped on the application launcher the %f is replaced with the file path of the dropped file. If multiple files can be specified on the command line the %F placeholder should be used instead of %f. If the application is able to open URLs in addition to local files then %u or %U can be used instead of %f or %F.
.TP
+Categories=\fICategories\fR
+A list of categories separated by semi\-colons. A category is a keyword that describes and classifies the application. By default applications are organized in the application menu based on category. When menu entries are explicitly assigned to a new submenu it is not necassery to list any categories.
+.sp
+When using categories it is recommended to include one of the following categories: AudioVideo, Development, Education, Game, Graphics, Network, Office, Settings, System, Utility.
+.sp
+See Appendix A of the XDG Desktop Menu Specification for information about additional categories. http://standards.freedesktop.org/menu\-spec/menu\-spec\-1.0.html
+.TP
MimeType=\fIMimetypes\fR
A list of mimetypes separated by semi\-colons. This field is used to indicate which file types the application is able to open.
.PP
For a complete oveview of the *.desktop file format please visit http://www.freedesktop.org/wiki/Standards/desktop\-entry\-spec
+.SH "DIRECTORY FILES"
+.PP
+The appearance of submenu in the application menu is provided by a *.directory file. In particular it provides the title of the submenu and a possible icon. A *.directory file consists of a
+\fI[Desktop Entry]\fR
+header followed by several
+\fIKey\fR=\fIValue\fR
+lines.
+.PP
+A *.directory file can provide a title (name) for the submenu in several different languages. This is done by adding a language code as used by LC_MESSAGES in square brackets behind the
+\fIKey\fR. This way one can specify different values for the same
+\fIKey\fR
+depending on the currently selected language.
+.PP
+The following keys are relevqnt for submenus:
+.TP
+Value=1.0
+This is a mandatory field to indicate that the *.directory file follows the 1.0 version of the Desktop Entry specification.
+.TP
+Type=Directory
+This is a mandatory field that indicates that the *.directory file describes a submenu.
+.TP
+Name=\fIMenu Name\fR
+The title of submenu. For example
+\fIMozilla\fR
+.TP
+Comment=\fIComment\fR
+Optional field to specify a tooltip for the submenu.
+.TP
+Icon=\fIIcon File\fR
+The icon to use for the submenu. This can either be an absolute path to an image file or an icon\-name. If an icon\-name is provided an image lookup by name is done in the user's current icon theme. The
+\fBxdg\-icon\-resource\fR
+command can be used to install image files into icon themes. The advantage of using an icon\-name instead of an absolute path is that with an icon\-name the submenu icon can be provided in several different sizes as well as in several differently themed styles.
.SH "ENVIRONMENT VARIABLES"
.PP
xdg\-desktop\-menu honours the following environment variables:
@@ -189,9 +200,39 @@ No permission to read one of the files passed on the command line.
\fBxdg\-mime\fR(1)
.SH "EXAMPLES"
.PP
-The company ShinyThings Inc. has developed an application named "WebMirror" and would like to add it to the application menu. The company will use "shinythings" as its vendor id. In this example the company ShinyThings Inc. will add its own submenu to the desktop application menu consisting of a "WebMirror" menu item and a "WebMirror Admin Tool" menu item.
+The company ShinyThings Inc. has developed an application named "WebMirror" and would like to add it to the application menu. The company will use "shinythings" as its vendor id. In order to add the application to the menu there needs to be a .desktop file with a suitable
+\fICategories\fR
+entry:
+.sp
+.nf
+shinythings\-webmirror.desktop:
+
+ [Desktop Entry]
+ Encoding=UTF\-8
+ Type=Application
+
+ Exec=webmirror
+ Icon=webmirror
+
+ Name=WebMirror
+ Name[nl]=WebSpiegel
+
+ Categories=Network;WebDevelopment;
+.fi
+.sp
+.PP
+Now the xdg\-desktop\-menu tool can be used to add the shinythings\-webmirror.desktop file to the desktop application menu:
+.sp
+.nf
+xdg\-desktop\-menu install ./shinythings\-webmirror.desktop
+.fi
+.sp
+.PP
+Note that for the purpose of this example the menu items are available in two languages, English and Dutch. The language code for Dutch is nl.
+.PP
+In the next example the company ShinyThings Inc. will add its own submenu to the desktop application menu consisting of a "WebMirror" menu item and a "WebMirror Admin Tool" menu item.
.PP
-First the company needs to create two .desktop files that describe the two menu items:
+First the company needs to create two .desktop files that describe the two menu items. Since the items are to be added to a new submenu it is not necassery to include a Categories= line:
.sp
.nf
shinythings\-webmirror.desktop:
diff --git a/scripts/xdg-desktop-menu b/scripts/xdg-desktop-menu
index cb6463f..d4d3ada 100755
--- a/scripts/xdg-desktop-menu
+++ b/scripts/xdg-desktop-menu
@@ -63,6 +63,27 @@ install
Install one or more applications in a submenu of the desktop menu system.
+ desktop-file: A desktop file represents a single menu entry in the menu.
+ Desktop files are defined by the freedesktop.org Desktop Entry
+ Specification. The most important aspects of *.desktop files are summarized
+ below.
+
+ Menu entries can be added to the menu system in two different ways. They
+ can either be added to a predefined submenu in the menu system based on one
+ or more category keywords, or they can be added to a new submenu.
+
+ To add a menu entry to a predefined submenu the desktop file that
+ represents the menu entry must have a Categories= entry that lists one or
+ more keywords. The menu item will be included in an appropriate submenu
+ based on the included keywords.
+
+ To add menu items to a new submenu the desktop-files must be preceded by a
+ directory-file that describes the submenu. If multiple desktop-files are
+ specified, all entries will be added to the same menu. If entries are
+ installed to a menu that has been created with a previous call to
+ xdg-desktop-menu the entries will be installed in addition to any already
+ existing entries.
+
directory-file: The *.directory file indicated by directory-file represents
a submenu. The directory file provides the name and icon for a submenu. The
name of the directory file is used to identify the submenu.
@@ -75,16 +96,6 @@ install
Directory files follow the syntax defined by the freedesktop.org Desktop
Entry Specification.
- desktop-file: A desktop file represents a single application in the menu.
- Desktop files are defined by the freedesktop.org Desktop Entry
- Specification. The most important aspects of *.desktop files are summarized
- below.
-
- If multiple desktop-files are specified, multiple entries will be added to
- the same menu. If entries are installed to a menu that has been created
- with a previous call to xdg-desktop-menu the entries will be installed in
- addition to any already existing entries.
-
uninstall
Remove applications or submenus from the desktop menu system previously
@@ -135,39 +146,6 @@ Options
--version
Show the xdg-utils version information.
-Directory Files
-
-The appearance of submenu in the application menu is provided by a *.directory
-file. In particular it provides the title of the submenu and a possible icon. A
-*.directory file consists of a [Desktop Entry] header followed by several Key=
-Value lines.
-
-A *.directory file can provide a title (name) for the submenu in several
-different languages. This is done by adding a language code as used by
-LC_MESSAGES in square brackets behind the Key. This way one can specify
-different values for the same Key depending on the currently selected language.
-
-The following keys are relevqnt for submenus:
-
-Value=1.0
- This is a mandatory field to indicate that the *.directory file follows the
- 1.0 version of the Desktop Entry specification.
-Type=Directory
- This is a mandatory field that indicates that the *.directory file
- describes a submenu.
-Name=Menu Name
- The title of submenu. For example Mozilla
-Comment=Comment
- Optional field to specify a tooltip for the submenu.
-Icon=Icon File
- The icon to use for the submenu. This can either be an absolute path to an
- image file or an icon-name. If an icon-name is provided an image lookup by
- name is done in the user's current icon theme. The xdg-icon-resource
- command can be used to install image files into icon themes. The advantage
- of using an icon-name instead of an absolute path is that with an icon-name
- the submenu icon can be provided in several different sizes as well as in
- several differently themed styles.
-
Desktop Files
An application item in the application menu is represented by a *.desktop file.
@@ -210,6 +188,22 @@ Exec=Command Line
placeholder should be used instead of %f. If the application is able to
open URLs in addition to local files then %u or %U can be used instead of
%f or %F.
+Categories=Categories
+
+ A list of categories separated by semi-colons. A category is a keyword that
+ describes and classifies the application. By default applications are
+ organized in the application menu based on category. When menu entries are
+ explicitly assigned to a new submenu it is not necassery to list any
+ categories.
+
+ When using categories it is recommended to include one of the following
+ categories: AudioVideo, Development, Education, Game, Graphics, Network,
+ Office, Settings, System, Utility.
+
+ See Appendix A of the XDG Desktop Menu Specification for information about
+ additional categories. http://standards.freedesktop.org/menu-spec/
+ menu-spec-1.0.html
+
MimeType=Mimetypes
A list of mimetypes separated by semi-colons. This field is used to
indicate which file types the application is able to open.
@@ -217,6 +211,39 @@ MimeType=Mimetypes
For a complete oveview of the *.desktop file format please visit http://
www.freedesktop.org/wiki/Standards/desktop-entry-spec
+Directory Files
+
+The appearance of submenu in the application menu is provided by a *.directory
+file. In particular it provides the title of the submenu and a possible icon. A
+*.directory file consists of a [Desktop Entry] header followed by several Key=
+Value lines.
+
+A *.directory file can provide a title (name) for the submenu in several
+different languages. This is done by adding a language code as used by
+LC_MESSAGES in square brackets behind the Key. This way one can specify
+different values for the same Key depending on the currently selected language.
+
+The following keys are relevqnt for submenus:
+
+Value=1.0
+ This is a mandatory field to indicate that the *.directory file follows the
+ 1.0 version of the Desktop Entry specification.
+Type=Directory
+ This is a mandatory field that indicates that the *.directory file
+ describes a submenu.
+Name=Menu Name
+ The title of submenu. For example Mozilla
+Comment=Comment
+ Optional field to specify a tooltip for the submenu.
+Icon=Icon File
+ The icon to use for the submenu. This can either be an absolute path to an
+ image file or an icon-name. If an icon-name is provided an image lookup by
+ name is done in the user's current icon theme. The xdg-icon-resource
+ command can be used to install image files into icon themes. The advantage
+ of using an icon-name instead of an absolute path is that with an icon-name
+ the submenu icon can be provided in several different sizes as well as in
+ several differently themed styles.
+
Environment Variables
xdg-desktop-menu honours the following environment variables:
@@ -250,12 +277,38 @@ Examples
The company ShinyThings Inc. has developed an application named "WebMirror" and
would like to add it to the application menu. The company will use
-"shinythings" as its vendor id. In this example the company ShinyThings Inc.
-will add its own submenu to the desktop application menu consisting of a
-"WebMirror" menu item and a "WebMirror Admin Tool" menu item.
+"shinythings" as its vendor id. In order to add the application to the menu
+there needs to be a .desktop file with a suitable Categories entry:
+
+shinythings-webmirror.desktop:
+
+ [Desktop Entry]
+ Encoding=UTF-8
+ Type=Application
+
+ Exec=webmirror
+ Icon=webmirror
+
+ Name=WebMirror
+ Name[nl]=WebSpiegel
+
+ Categories=Network;WebDevelopment;
+
+Now the xdg-desktop-menu tool can be used to add the
+shinythings-webmirror.desktop file to the desktop application menu:
+
+xdg-desktop-menu install ./shinythings-webmirror.desktop
+
+Note that for the purpose of this example the menu items are available in two
+languages, English and Dutch. The language code for Dutch is nl.
+
+In the next example the company ShinyThings Inc. will add its own submenu to
+the desktop application menu consisting of a "WebMirror" menu item and a
+"WebMirror Admin Tool" menu item.
First the company needs to create two .desktop files that describe the two menu
-items:
+items. Since the items are to be added to a new submenu it is not necassery to
+include a Categories= line:
shinythings-webmirror.desktop: