diff options
-rw-r--r-- | scripts/desc/xdg-desktop-menu.xml | 5 | ||||
-rw-r--r-- | scripts/html/xdg-desktop-menu.html | 7 | ||||
-rw-r--r-- | scripts/man/xdg-desktop-menu.1 | 351 | ||||
-rwxr-xr-x | scripts/xdg-desktop-menu | 432 |
4 files changed, 358 insertions, 437 deletions
diff --git a/scripts/desc/xdg-desktop-menu.xml b/scripts/desc/xdg-desktop-menu.xml index a9487aa..b34a717 100644 --- a/scripts/desc/xdg-desktop-menu.xml +++ b/scripts/desc/xdg-desktop-menu.xml @@ -527,9 +527,10 @@ xdg-icon-resource install --system --size 64 ./wmicon-admin-64.png webmirror-adm <programlisting> webmirror.menu: - <!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 0.8//EN" - "http://www.freedesktop.org/standards/menu-spec/menu-0.8.dtd"> + <!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" + "http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd"> <Menu> + <Name>Applications</Name> <Menu> <Name>WebMirror</Name> <Directory>shinythings-webmirror.directory</Directory> diff --git a/scripts/html/xdg-desktop-menu.html b/scripts/html/xdg-desktop-menu.html index 04660fa..56d6b4e 100644 --- a/scripts/html/xdg-desktop-menu.html +++ b/scripts/html/xdg-desktop-menu.html @@ -1,4 +1,4 @@ -<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xdg-desktop-menu</title><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="xdg-desktop-menu"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>xdg-desktop-menu — command line tool for (un)installing desktop menu items</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">xdg-desktop-menu</code> install [<code class="option">--noupdate</code>] [<code class="option">--vendor <em class="replaceable"><code>vendor-id</code></em></code>] { <code class="option">--user</code> | <code class="option">--system</code> } { <em class="replaceable"><code>desktop-file</code></em> | <em class="replaceable"><code>menu-file</code></em> | <em class="replaceable"><code>directory-file</code></em> }</p></div><div class="cmdsynopsis"><p><code class="command">xdg-desktop-menu</code> uninstall [<code class="option">--noupdate</code>] [<code class="option">--vendor <em class="replaceable"><code>vendor-id</code></em></code>] { <code class="option">--user</code> | <code class="option">--system</code> } { <em class="replaceable"><code>desktop-file</code></em> | <em class="replaceable"><code>menu-file</code></em> | <em class="replaceable"><code>directory-file</code></em> }</p></div><div class="cmdsynopsis"><p><code class="command">xdg-desktop-menu</code> forceupdate { <code class="option">--user</code> | <code class="option">--system</code> }</p></div><div class="cmdsynopsis"><p><code class="command">xdg-desktop-menu</code> { <code class="option">--help</code> | <code class="option">--manual</code> | <code class="option">--version</code> }</p></div></div><div class="refsect1" lang="en"><a name="description"></a><h2>Description</h2><p> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xdg-desktop-menu</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" lang="en"><a name="xdg-desktop-menu"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>xdg-desktop-menu — command line tool for (un)installing desktop menu items</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">xdg-desktop-menu</code> install [<code class="option">--noupdate</code>] [<code class="option">--vendor <em class="replaceable"><code>vendor-id</code></em></code>] { <code class="option">--user</code> | <code class="option">--system</code> } { <em class="replaceable"><code>desktop-file</code></em> | <em class="replaceable"><code>menu-file</code></em> | <em class="replaceable"><code>directory-file</code></em> }</p></div><div class="cmdsynopsis"><p><code class="command">xdg-desktop-menu</code> uninstall [<code class="option">--noupdate</code>] [<code class="option">--vendor <em class="replaceable"><code>vendor-id</code></em></code>] { <code class="option">--user</code> | <code class="option">--system</code> } { <em class="replaceable"><code>desktop-file</code></em> | <em class="replaceable"><code>menu-file</code></em> | <em class="replaceable"><code>directory-file</code></em> }</p></div><div class="cmdsynopsis"><p><code class="command">xdg-desktop-menu</code> forceupdate { <code class="option">--user</code> | <code class="option">--system</code> }</p></div><div class="cmdsynopsis"><p><code class="command">xdg-desktop-menu</code> { <code class="option">--help</code> | <code class="option">--manual</code> | <code class="option">--version</code> }</p></div></div><div class="refsect1" lang="en"><a name="description"></a><h2>Description</h2><p> The xdg-desktop-menu program can be used to install new items to the desktop's application menu. </p><p> @@ -232,9 +232,10 @@ xdg-icon-resource install --system --size 64 ./wmicon-admin-64.png webmirror-adm </p><pre class="programlisting"> webmirror.menu: - <!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 0.8//EN" - "http://www.freedesktop.org/standards/menu-spec/menu-0.8.dtd"> + <!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" + "http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd"> <Menu> + <Name>Applications</Name> <Menu> <Name>WebMirror</Name> <Directory>shinythings-webmirror.directory</Directory> diff --git a/scripts/man/xdg-desktop-menu.1 b/scripts/man/xdg-desktop-menu.1 index 4975eb0..4821af7 100644 --- a/scripts/man/xdg-desktop-menu.1 +++ b/scripts/man/xdg-desktop-menu.1 @@ -1,193 +1,153 @@ -.\"Generated by db2man.xsl. Don't modify this, modify the source. -.de Sh \" Subsection -.br -.if t .Sp -.ne 5 -.PP -\fB\\$1\fR -.PP -.. -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Ip \" List item -.br -.ie \\n(.$>=3 .ne \\$3 -.el .ne 3 -.IP "\\$1" \\$2 -.. -.TH "XDG-DESKTOP-MENU" 1 "" "" "xdg-desktop-menu Manual" -.SH NAME -xdg-desktop-menu \- command line tool for (un)installing desktop menu items -.SH "SYNOPSIS" +.\" ** You probably do not want to edit this file directly ** +.\" 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" "07/13/2006" "This is release 0.5 of the xdg\-desktop\-m" "" +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) .ad l -.hy 0 +.SH "NAME" +xdg\-desktop\-menu \- command line tool for (un)installing desktop menu items +.SH "SYNOPSIS" .HP 17 -\fBxdg\-desktop\-menu\fR install [\fB\-\-noupdate\fR] [\fB\-\-vendor\ \fIvendor\-id\fR\fR] {\fB\fB\-\-user\fR\fR | \fB\fB\-\-system\fR\fR} {\fB\fIdesktop\-file\fR\fR | \fB\fImenu\-file\fR\fR | \fB\fIdirectory\-file\fR\fR} -.ad -.hy -.ad l -.hy 0 +\fBxdg\-desktop\-menu\fR install [\fB\-\-noupdate\fR] [\fB\-\-vendor\ \fR\fB\fIvendor\-id\fR\fR] {\fB\-\-user\fR \fB\-\-system\fR} {\fIdesktop\-file\fR \fImenu\-file\fR \fIdirectory\-file\fR} .HP 17 -\fBxdg\-desktop\-menu\fR uninstall [\fB\-\-noupdate\fR] [\fB\-\-vendor\ \fIvendor\-id\fR\fR] {\fB\fB\-\-user\fR\fR | \fB\fB\-\-system\fR\fR} {\fB\fIdesktop\-file\fR\fR | \fB\fImenu\-file\fR\fR | \fB\fIdirectory\-file\fR\fR} -.ad -.hy -.ad l -.hy 0 +\fBxdg\-desktop\-menu\fR uninstall [\fB\-\-noupdate\fR] [\fB\-\-vendor\ \fR\fB\fIvendor\-id\fR\fR] {\fB\-\-user\fR \fB\-\-system\fR} {\fIdesktop\-file\fR \fImenu\-file\fR \fIdirectory\-file\fR} .HP 17 -\fBxdg\-desktop\-menu\fR forceupdate {\fB\fB\-\-user\fR\fR | \fB\fB\-\-system\fR\fR} -.ad -.hy -.ad l -.hy 0 +\fBxdg\-desktop\-menu\fR forceupdate {\fB\-\-user\fR \fB\-\-system\fR} .HP 17 -\fBxdg\-desktop\-menu\fR {\fB\fB\-\-help\fR\fR | \fB\fB\-\-manual\fR\fR | \fB\fB\-\-version\fR\fR} -.ad -.hy - +\fBxdg\-desktop\-menu\fR {\fB\-\-help\fR \fB\-\-manual\fR \fB\-\-version\fR} .SH "DESCRIPTION" - .PP -The xdg\-desktop\-menu program can be used to install new items to the desktop's application menu\&. - +The xdg\-desktop\-menu program can be used to install new items to the desktop's application menu. .PP -The application menu works according to the XDG Desktop Menu Specification at http://www\&.freedesktop\&.org/Standards/menu\-spec - +The application menu works according to the XDG Desktop Menu Specification at http://www.freedesktop.org/Standards/menu\-spec .SH "COMMANDS" - .TP install -Install applications or submenus into the desktop menu system\&. - -\fIdesktop\-file\fR: Installs the *\&.desktop file indicated by \fIdesktop\-file\fR to the menu system\&. 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\&. - -\fImenu\-file\fR: Installs the *\&.menu file indicated by \fImenu\-file\fR to the menu system\&. A menu file describes the location and contents for one or more new submenus\&. Each submenu must reference a *\&.directory file\&. - -\fIdirectory\-file\fR: Installs the *\&.directory file indicated by \fIdirectory\-file\fR to the menu system\&. A directory file provides the name and icon for a submenu\&. - +Install applications or submenus into the desktop menu system. +.sp +\fIdesktop\-file\fR: Installs the *.desktop file indicated by +\fIdesktop\-file\fR +to the menu system. 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 +\fImenu\-file\fR: Installs the *.menu file indicated by +\fImenu\-file\fR +to the menu system. A menu file describes the location and contents for one or more new submenus. Each submenu must reference a *.directory file. +.sp +\fIdirectory\-file\fR: Installs the *.directory file indicated by +\fIdirectory\-file\fR +to the menu system. A directory file provides the name and icon for a submenu. .TP uninstall -Remove applications or submenus from the desktop menu system previously installed with \fBxdg\-desktop\-menu install\fR\&. - +Remove applications or submenus from the desktop menu system previously installed with +\fBxdg\-desktop\-menu install\fR. .TP forceupdate -Force an update of the menu system\&. This is only useful if the last call to xdg\-desktop\-menu included the \fB\-\-noupdate\fR option\&. - +Force an update of the menu system. This is only useful if the last call to xdg\-desktop\-menu included the +\fB\-\-noupdate\fR +option. .SH "OPTIONS" - .TP \fB\-\-noupdate\fR -Postpone updating the menu system\&. If multiple updates to the menu system are made in sequence this flag can be used to indicate that additional changes will follow and that it is not necassery to update the menu system right away\&. - +Postpone updating the menu system. If multiple updates to the menu system are made in sequence this flag can be used to indicate that additional changes will follow and that it is not necassery to update the menu system right away. .TP \fB\-\-vendor\fR \fIvendor\-id\fR -Adds \fIvendor\-id\fR as a prefix when installing desktop and directory files\&. - +Adds +\fIvendor\-id\fR +as a prefix when installing desktop and directory files. .TP \fB\-\-user\fR -Installs or uninstalls the file for the current user only\&. - +Installs or uninstalls the file for the current user only. .TP \fB\-\-system\fR -Installs or uninstalls the file for all users on the system\&. Usually only root is allowed to do this\&. - +Installs or uninstalls the file for all users on the system. Usually only root is allowed to do this. .TP \fB\-\-help\fR -Show command synopsis\&. - +Show command synopsis. .TP \fB\-\-manual\fR -Show this manualpage\&. - +Show this manualpage. .TP \fB\-\-version\fR -Show the xdg\-utils version information\&. - +Show the xdg\-utils version information. .SH "DESKTOP FILES" - .PP -An application item in the application menu is represented by a *\&.desktop file\&. A *\&.desktop file consists of a \fI[Desktop Entry]\fR header followed by several \fIKey\fR=\fIValue\fR lines\&. - +An application item in the application menu is represented by a *.desktop file. A *.desktop file consists of a +\fI[Desktop Entry]\fR +header followed by several +\fIKey\fR=\fIValue\fR +lines. .PP -A *\&.desktop file can provide a name and description for an application 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\&. - +A *.desktop file can provide a name and description for an application 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 often used: - .TP -Value=1\&.0 -This is a mandatory field to indicate that the *\&.desktop file follows the 1\&.0 version of the specification\&. - +Value=1.0 +This is a mandatory field to indicate that the *.desktop file follows the 1.0 version of the specification. .TP Type=Application -This is a mandatory field that indicates that the *\&.desktop file describes an application launcher\&. - +This is a mandatory field that indicates that the *.desktop file describes an application launcher. .TP Name=\fIApplication Name\fR -The name of the application\&. For example \fIMozilla\fR - +The name of the application. For example +\fIMozilla\fR .TP GenericName=\fIGeneric Name\fR -A generic description of the application\&. For example \fIWeb Browser\fR - +A generic description of the application. For example +\fIWeb Browser\fR .TP Comment=\fIComment\fR -Optional field to specify a tooltip for the application\&. For example \fIVisit websites on the Internet\fR - +Optional field to specify a tooltip for the application. For example +\fIVisit websites on the Internet\fR .TP Icon=\fIIcon File\fR -The icon to use for the application\&. 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 application icon can be provided in several different sizes as well as in several differently themed styles\&. - +The icon to use for the application. 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 application icon can be provided in several different sizes as well as in several differently themed styles. .TP 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\&. - +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\&. The XDG Desktop Menu Specification defines a large number of predefined 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. The XDG Desktop Menu Specification defines a large number of predefined categories. .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\&. - +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 - +For a complete oveview of the *.desktop file format please visit http://www.freedesktop.org/wiki/Standards/desktop\-entry\-spec .SH "EXIT CODES" - .PP -An exit code of 0 indicates success while a non\-zero exit code indicates failure\&. The following failure codes can be returned: - +An exit code of 0 indicates success while a non\-zero exit code indicates failure. The following failure codes can be returned: .TP \fB1\fR -Error in command line syntax\&. - +Error in command line syntax. .TP \fB2\fR -One of the files passed on the command line did not exist\&. - +One of the files passed on the command line did not exist. .TP \fB3\fR -A required tool could not be found\&. - +A required tool could not be found. .TP \fB4\fR -The action failed\&. - +The action failed. .SH "SEE ALSO" - .PP -\fBxdg\-desktop\-icon\fR(1), \fBxdg\-icon\-resource\fR(1), \fBxdg\-mime\fR(1) - +\fBxdg\-desktop\-icon\fR(1), +\fBxdg\-icon\-resource\fR(1), +\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 order to add the application to the menu there needs to be a \&.desktop file with a suitable \fICategories\fR entry: - +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 - -webmirror\&.desktop: +webmirror.desktop: [Desktop Entry] Encoding=UTF\-8 @@ -200,32 +160,24 @@ webmirror\&.desktop: Name[nl]=WebSpiegel Categories=Network;WebDevelopment; - .fi - - +.sp .PP -Now the xdg\-desktop\-menu tool can be used to add the webmirror\&.desktop file to the desktop application menu: - +Now the xdg\-desktop\-menu tool can be used to add the webmirror.desktop file to the desktop application menu: +.sp .nf - -xdg\-desktop\-menu install \-\-system \-\-vendor shinythings \&./webmirror\&.desktop - +xdg\-desktop\-menu install \-\-system \-\-vendor 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\&. - +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\&. wants to add its own submenu to the desktop application menu consisting of a "WebMirror" menu item and a "WebMirror Admin Tool" menu item\&. - +In the next example the company ShinyThings Inc. wants to 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, this time no Categories item is needed: - +First the company needs to create two .desktop files that describe the two menu items, this time no Categories item is needed: +.sp .nf - -webmirror\&.desktop: +webmirror.desktop: [Desktop Entry] Encoding=UTF\-8 @@ -238,7 +190,7 @@ webmirror\&.desktop: Name[nl]=WebSpiegel -webmirror\-admin\&.desktop: +webmirror\-admin.desktop: [Desktop Entry] Encoding=UTF\-8 @@ -249,30 +201,25 @@ webmirror\-admin\&.desktop: Name=WebMirror Admin Tool Name[nl]=WebSpiegel Administratie Tool - .fi - - +.sp .PP -The files can be installed with: - +The files can be installed with: +.sp .nf - -xdg\-desktop\-menu install \-\-system \-\-noupdate \-\-vendor shinythings \&./webmirror\&.desktop -xdg\-desktop\-menu install \-\-system \-\-noupdate \-\-vendor shinythings \&./webmirror\-admin\&.desktop - +xdg\-desktop\-menu install \-\-system \-\-noupdate \-\-vendor shinythings ./webmirror.desktop +xdg\-desktop\-menu install \-\-system \-\-noupdate \-\-vendor shinythings ./webmirror\-admin.desktop .fi - - +.sp .PP -Because multiple items are added the \fB\-\-noupdate\fR option has been used\&. - +Because multiple items are added the +\fB\-\-noupdate\fR +option has been used. .PP -In addition a \&.directory file needs to be created to provide a title and icon for the sub\-menu itself: - +In addition a .directory file needs to be created to provide a title and icon for the sub\-menu itself: +.sp .nf - -webmirror\&.directory: +webmirror.directory: [Desktop Entry] Encoding=UTF\-8 @@ -281,77 +228,67 @@ webmirror\&.directory: Name=WebMirror Name[nl]=WebSpiegel - .fi - - +.sp .PP -This webmirror\&.directory file can be installed with: - +This webmirror.directory file can be installed with: +.sp .nf - -xdg\-desktop\-menu install \-\-system \-\-noupdate \-\-vendor shinythings \&./webmirror\&.directory - +xdg\-desktop\-menu install \-\-system \-\-noupdate \-\-vendor shinythings ./webmirror.directory .fi - - +.sp .PP -The *\&.desktop and *\&.directory files reference icons with the names webmirror, webmirror\-admin and webmirror\-menu which should also be installed\&. In this example the icons are installed in two different sizes, once with a size of 22x22 pixels and once with a size of 64x64 pixels: - +The *.desktop and *.directory files reference icons with the names webmirror, webmirror\-admin and webmirror\-menu which should also be installed. In this example the icons are installed in two different sizes, once with a size of 22x22 pixels and once with a size of 64x64 pixels: +.sp .nf - -xdg\-icon\-resource install \-\-system \-\-size 22 \&./wmicon\-22\&.png webmirror\&.png -xdg\-icon\-resource install \-\-system \-\-size 22 \&./wmicon\-menu\-22\&.png webmirror\-menu\&.png -xdg\-icon\-resource install \-\-system \-\-size 22 \&./wmicon\-admin\-22\&.png webmirror\-admin\&.png -xdg\-icon\-resource install \-\-system \-\-size 64 \&./wmicon\-64\&.png webmirror\&.png -xdg\-icon\-resource install \-\-system \-\-size 64 \&./wmicon\-menu\-64\&.png webmirror\-menu\&.png -xdg\-icon\-resource install \-\-system \-\-size 64 \&./wmicon\-admin\-64\&.png webmirror\-admin\&.png - +xdg\-icon\-resource install \-\-system \-\-size 22 ./wmicon\-22.png webmirror.png +xdg\-icon\-resource install \-\-system \-\-size 22 ./wmicon\-menu\-22.png webmirror\-menu.png +xdg\-icon\-resource install \-\-system \-\-size 22 ./wmicon\-admin\-22.png webmirror\-admin.png +xdg\-icon\-resource install \-\-system \-\-size 64 ./wmicon\-64.png webmirror.png +xdg\-icon\-resource install \-\-system \-\-size 64 ./wmicon\-menu\-64.png webmirror\-menu.png +xdg\-icon\-resource install \-\-system \-\-size 64 ./wmicon\-admin\-64.png webmirror\-admin.png .fi - - +.sp .PP -The last step is to provide a \&.menu file that links it all togther: - +The last step is to provide a .menu file that links it all togther: +.sp .nf +webmirror.menu: -webmirror\&.menu: - - <!DOCTYPE Menu PUBLIC "\-//freedesktop//DTD Menu 0\&.8//EN" - "http://www\&.freedesktop\&.org/standards/menu\-spec/menu\-0\&.8\&.dtd"> + <!DOCTYPE Menu PUBLIC "\-//freedesktop//DTD Menu 1.0//EN" + "http://www.freedesktop.org/standards/menu\-spec/menu\-1.0.dtd"> <Menu> + <Name>Applications</Name> <Menu> <Name>WebMirror</Name> - <Directory>shinythings\-webmirror\&.directory</Directory> + <Directory>shinythings\-webmirror.directory</Directory> <Include> - <Filename>shinythings\-webmirror\&.desktop</Filename> - <Filename>shinythings\-webmirror\-admin\&.desktop</Filename> + <Filename>shinythings\-webmirror.desktop</Filename> + <Filename>shinythings\-webmirror\-admin.desktop</Filename> </Include> </Menu> </Menu> - .fi - - +.sp .PP -The webmirror\&.menu file can be installed with: - +The webmirror.menu file can be installed with: +.sp .nf - -xdg\-desktop\-menu install \-\-system \-\-noupdate \-\-vendor shinythings \&./webmirror\&.menu - +xdg\-desktop\-menu install \-\-system \-\-noupdate \-\-vendor shinythings ./webmirror.menu .fi - - +.sp .PP -After installing multiple files with \fB\-\-noupdate\fR make sure to force an update: - +After installing multiple files with +\fB\-\-noupdate\fR +make sure to force an update: +.sp .nf - xdg\-desktop\-menu forceupdate \-\-system - .fi - - -.SH AUTHORS -Kevin Krammer, Jeremy White. +.sp +.SH "AUTHOR" +Kevin Krammer, Jeremy White. +.br +<kevin.krammer@gmx.at> +.br +<jwhite@codeweavers.com> diff --git a/scripts/xdg-desktop-menu b/scripts/xdg-desktop-menu index ad966ee..cb340c9 100755 --- a/scripts/xdg-desktop-menu +++ b/scripts/xdg-desktop-menu @@ -38,315 +38,290 @@ manualpage() cat << _MANUALPAGE Name - xdg-desktop-menu -- command line tool for (un)installing desktop menu - items +xdg-desktop-menu — command line tool for (un)installing desktop menu items Synopsis - xdg-desktop-menu install [--noupdate] [--vendor vendor-id] { --user | - --system } { desktop-file | menu-file | directory-file } +xdg-desktop-menu install [--noupdate] [--vendor vendor-id] { --user | --system +} { desktop-file | menu-file | directory-file } - xdg-desktop-menu uninstall [--noupdate] [--vendor vendor-id] { --user | - --system } { desktop-file | menu-file | directory-file } +xdg-desktop-menu uninstall [--noupdate] [--vendor vendor-id] { --user | +--system } { desktop-file | menu-file | directory-file } - xdg-desktop-menu forceupdate { --user | --system } +xdg-desktop-menu forceupdate { --user | --system } - xdg-desktop-menu { --help | --manual | --version } +xdg-desktop-menu { --help | --manual | --version } Description - The xdg-desktop-menu program can be used to install new items to the - desktop's application menu. +The xdg-desktop-menu program can be used to install new items to the desktop's +application menu. - The application menu works according to the XDG Desktop Menu Specification - at http://www.freedesktop.org/Standards/menu-spec +The application menu works according to the XDG Desktop Menu Specification at +http://www.freedesktop.org/Standards/menu-spec Commands - install +install - Install applications or submenus into the desktop menu system. + Install applications or submenus into the desktop menu system. - desktop-file: Installs the *.desktop file indicated by - desktop-file to the menu system. 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. + desktop-file: Installs the *.desktop file indicated by desktop-file to the + menu system. 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. - menu-file: Installs the *.menu file indicated by menu-file to the - menu system. A menu file describes the location and contents for - one or more new submenus. Each submenu must reference a - *.directory file. + menu-file: Installs the *.menu file indicated by menu-file to the menu + system. A menu file describes the location and contents for one or more new + submenus. Each submenu must reference a *.directory file. - directory-file: Installs the *.directory file indicated by - directory-file to the menu system. A directory file provides the - name and icon for a submenu. + directory-file: Installs the *.directory file indicated by directory-file + to the menu system. A directory file provides the name and icon for a + submenu. - uninstall - Remove applications or submenus from the desktop menu system - previously installed with xdg-desktop-menu install. - - forceupdate - Force an update of the menu system. This is only useful if the - last call to xdg-desktop-menu included the --noupdate option. +uninstall + Remove applications or submenus from the desktop menu system previously + installed with xdg-desktop-menu install. +forceupdate + Force an update of the menu system. This is only useful if the last call to + xdg-desktop-menu included the --noupdate option. Options - --noupdate - Postpone updating the menu system. If multiple updates to the menu - system are made in sequence this flag can be used to indicate that - additional changes will follow and that it is not necassery to - update the menu system right away. - - --vendor vendor-id - Adds vendor-id as a prefix when installing desktop and directory - files. - - --user - Installs or uninstalls the file for the current user only. - - --system - Installs or uninstalls the file for all users on the system. - Usually only root is allowed to do this. - - --help - Show command synopsis. - - --manual - Show this manualpage. - - --version - Show the xdg-utils version information. +--noupdate + Postpone updating the menu system. If multiple updates to the menu system + are made in sequence this flag can be used to indicate that additional + changes will follow and that it is not necassery to update the menu system + right away. +--vendor vendor-id + Adds vendor-id as a prefix when installing desktop and directory files. +--user + Installs or uninstalls the file for the current user only. +--system + Installs or uninstalls the file for all users on the system. Usually only + root is allowed to do this. +--help + Show command synopsis. +--manual + Show this manualpage. +--version + Show the xdg-utils version information. Desktop Files - An application item in the application menu is represented by a *.desktop - file. A *.desktop file consists of a [Desktop Entry] header followed by - several Key=Value lines. - - A *.desktop file can provide a name and description for an application 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 often used: - - Value=1.0 - This is a mandatory field to indicate that the *.desktop file - follows the 1.0 version of the specification. - - Type=Application - This is a mandatory field that indicates that the *.desktop file - describes an application launcher. - - Name=Application Name - The name of the application. For example Mozilla - - GenericName=Generic Name - A generic description of the application. For example Web Browser - - Comment=Comment - Optional field to specify a tooltip for the application. For - example Visit websites on the Internet - - Icon=Icon File - The icon to use for the application. 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 - application icon can be provided in several different sizes as - well as in several differently themed styles. - - Exec=Command Line - 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. - - 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. The XDG Desktop Menu Specification defines a large - number of predefined categories. - - 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. - - For a complete oveview of the *.desktop file format please visit - http://www.freedesktop.org/wiki/Standards/desktop-entry-spec +An application item in the application menu is represented by a *.desktop file. +A *.desktop file consists of a [Desktop Entry] header followed by several Key= +Value lines. + +A *.desktop file can provide a name and description for an application 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 often used: + +Value=1.0 + This is a mandatory field to indicate that the *.desktop file follows the + 1.0 version of the specification. +Type=Application + This is a mandatory field that indicates that the *.desktop file describes + an application launcher. +Name=Application Name + The name of the application. For example Mozilla +GenericName=Generic Name + A generic description of the application. For example Web Browser +Comment=Comment + Optional field to specify a tooltip for the application. For example Visit + websites on the Internet +Icon=Icon File + The icon to use for the application. 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 application icon can be provided in several different sizes as well as + in several differently themed styles. +Exec=Command Line + 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. +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. The XDG Desktop Menu + Specification defines a large number of predefined categories. +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. + +For a complete oveview of the *.desktop file format please visit http:// +www.freedesktop.org/wiki/Standards/desktop-entry-spec Exit Codes - An exit code of 0 indicates success while a non-zero exit code indicates - failure. The following failure codes can be returned: +An exit code of 0 indicates success while a non-zero exit code indicates +failure. The following failure codes can be returned: - 1 - Error in command line syntax. - - 2 - One of the files passed on the command line did not exist. - - 3 - A required tool could not be found. - - 4 - The action failed. +1 + Error in command line syntax. +2 + One of the files passed on the command line did not exist. +3 + A required tool could not be found. +4 + The action failed. See Also - xdg-desktop-icon(1), xdg-icon-resource(1), xdg-mime(1) +xdg-desktop-icon(1), xdg-icon-resource(1), xdg-mime(1) 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 order to add the application - to the menu there needs to be a .desktop file with a suitable Categories - entry: +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 Categories entry: + +webmirror.desktop: - webmirror.desktop: + [Desktop Entry] + Encoding=UTF-8 + Type=Application - [Desktop Entry] - Encoding=UTF-8 - Type=Application + Exec=webmirror + Icon=webmirror - Exec=webmirror - Icon=webmirror + Name=WebMirror + Name[nl]=WebSpiegel - Name=WebMirror - Name[nl]=WebSpiegel + Categories=Network;WebDevelopment; - Categories=Network;WebDevelopment; +Now the xdg-desktop-menu tool can be used to add the webmirror.desktop file to +the desktop application menu: - Now the xdg-desktop-menu tool can be used to add the webmirror.desktop - file to the desktop application menu: +xdg-desktop-menu install --system --vendor shinythings ./webmirror.desktop - xdg-desktop-menu install --system --vendor 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. - 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. wants to add its own submenu +to the desktop application menu consisting of a "WebMirror" menu item and a +"WebMirror Admin Tool" menu item. - In the next example the company ShinyThings Inc. wants to 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, this time no Categories item is needed: - First the company needs to create two .desktop files that describe the two - menu items, this time no Categories item is needed: +webmirror.desktop: - webmirror.desktop: + [Desktop Entry] + Encoding=UTF-8 + Type=Application - [Desktop Entry] - Encoding=UTF-8 - Type=Application + Exec=webmirror + Icon=webmirror - Exec=webmirror - Icon=webmirror + Name=WebMirror + Name[nl]=WebSpiegel - Name=WebMirror - Name[nl]=WebSpiegel +webmirror-admin.desktop: - webmirror-admin.desktop: + [Desktop Entry] + Encoding=UTF-8 + Type=Application - [Desktop Entry] - Encoding=UTF-8 - Type=Application + Exec=webmirror-admintool + Icon=webmirror-admintool - Exec=webmirror-admintool - Icon=webmirror-admintool + Name=WebMirror Admin Tool + Name[nl]=WebSpiegel Administratie Tool - Name=WebMirror Admin Tool - Name[nl]=WebSpiegel Administratie Tool +The files can be installed with: - The files can be installed with: +xdg-desktop-menu install --system --noupdate --vendor shinythings ./webmirror.desktop +xdg-desktop-menu install --system --noupdate --vendor shinythings ./webmirror-admin.desktop - xdg-desktop-menu install --system --noupdate --vendor shinythings ./webmirror.desktop - xdg-desktop-menu install --system --noupdate --vendor shinythings ./webmirror-admin.desktop +Because multiple items are added the --noupdate option has been used. - Because multiple items are added the --noupdate option has been used. +In addition a .directory file needs to be created to provide a title and icon +for the sub-menu itself: - In addition a .directory file needs to be created to provide a title and - icon for the sub-menu itself: +webmirror.directory: - webmirror.directory: + [Desktop Entry] + Encoding=UTF-8 - [Desktop Entry] - Encoding=UTF-8 + Icon=webmirror-menu - Icon=webmirror-menu + Name=WebMirror + Name[nl]=WebSpiegel - Name=WebMirror - Name[nl]=WebSpiegel +This webmirror.directory file can be installed with: - This webmirror.directory file can be installed with: +xdg-desktop-menu install --system --noupdate --vendor shinythings ./webmirror.directory - xdg-desktop-menu install --system --noupdate --vendor shinythings ./webmirror.directory +The *.desktop and *.directory files reference icons with the names webmirror, +webmirror-admin and webmirror-menu which should also be installed. In this +example the icons are installed in two different sizes, once with a size of +22x22 pixels and once with a size of 64x64 pixels: - The *.desktop and *.directory files reference icons with the names - webmirror, webmirror-admin and webmirror-menu which should also be - installed. In this example the icons are installed in two different sizes, - once with a size of 22x22 pixels and once with a size of 64x64 pixels: +xdg-icon-resource install --system --size 22 ./wmicon-22.png webmirror.png +xdg-icon-resource install --system --size 22 ./wmicon-menu-22.png webmirror-menu.png +xdg-icon-resource install --system --size 22 ./wmicon-admin-22.png webmirror-admin.png +xdg-icon-resource install --system --size 64 ./wmicon-64.png webmirror.png +xdg-icon-resource install --system --size 64 ./wmicon-menu-64.png webmirror-menu.png +xdg-icon-resource install --system --size 64 ./wmicon-admin-64.png webmirror-admin.png - xdg-icon-resource install --system --size 22 ./wmicon-22.png webmirror.png - xdg-icon-resource install --system --size 22 ./wmicon-menu-22.png webmirror-menu.png - xdg-icon-resource install --system --size 22 ./wmicon-admin-22.png webmirror-admin.png - xdg-icon-resource install --system --size 64 ./wmicon-64.png webmirror.png - xdg-icon-resource install --system --size 64 ./wmicon-menu-64.png webmirror-menu.png - xdg-icon-resource install --system --size 64 ./wmicon-admin-64.png webmirror-admin.png +The last step is to provide a .menu file that links it all togther: - The last step is to provide a .menu file that links it all togther: +webmirror.menu: - webmirror.menu: + <!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" + "http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd"> + <Menu> + <Name>Applications</Name> + <Menu> + <Name>WebMirror</Name> + <Directory>shinythings-webmirror.directory</Directory> + <Include> + <Filename>shinythings-webmirror.desktop</Filename> + <Filename>shinythings-webmirror-admin.desktop</Filename> + </Include> + </Menu> + </Menu> - <!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 0.8//EN" - "http://www.freedesktop.org/standards/menu-spec/menu-0.8.dtd"> - <Menu> - <Menu> - <Name>WebMirror</Name> - <Directory>shinythings-webmirror.directory</Directory> - <Include> - <Filename>shinythings-webmirror.desktop</Filename> - <Filename>shinythings-webmirror-admin.desktop</Filename> - </Include> - </Menu> - </Menu> +The webmirror.menu file can be installed with: - The webmirror.menu file can be installed with: +xdg-desktop-menu install --system --noupdate --vendor shinythings ./webmirror.menu - xdg-desktop-menu install --system --noupdate --vendor shinythings ./webmirror.menu +After installing multiple files with --noupdate make sure to force an update: - After installing multiple files with --noupdate make sure to force an - update: +xdg-desktop-menu forceupdate --system - xdg-desktop-menu forceupdate --system _MANUALPAGE } usage() { cat << _USAGE - xdg-desktop-menu -- command line tool for (un)installing desktop menu - items +xdg-desktop-menu — command line tool for (un)installing desktop menu items Synopsis - xdg-desktop-menu install [--noupdate] [--vendor vendor-id] { --user | - --system } { desktop-file | menu-file | directory-file } +xdg-desktop-menu install [--noupdate] [--vendor vendor-id] { --user | --system +} { desktop-file | menu-file | directory-file } - xdg-desktop-menu uninstall [--noupdate] [--vendor vendor-id] { --user | - --system } { desktop-file | menu-file | directory-file } +xdg-desktop-menu uninstall [--noupdate] [--vendor vendor-id] { --user | +--system } { desktop-file | menu-file | directory-file } - xdg-desktop-menu forceupdate { --user | --system } +xdg-desktop-menu forceupdate { --user | --system } - xdg-desktop-menu { --help | --manual | --version } +xdg-desktop-menu { --help | --manual | --version } _USAGE } @@ -357,6 +332,13 @@ _USAGE # Common utility functions included in all XDG wrapper scripts #---------------------------------------------------------------------------- +DEBUG() +{ + [ ${xdg_utils_debug_level-0} -lt $1 ] && return 0; + shift + echo "$@" +} + #------------------------------------------------------------- # Exit script on successfully completing the desired operation |