OLD | NEW |
(Empty) | |
| 1 .\" ** You probably do not want to edit this file directly ** |
| 2 .\" It was generated using the DocBook XSL Stylesheets (version 1.69.1). |
| 3 .\" Instead of manually editing it, you probably should edit the DocBook XML |
| 4 .\" source for it and then use the DocBook XSL Stylesheets to regenerate it. |
| 5 .TH "XDG\-DESKTOP\-MENU" "1" "06/24/2007" "xdg\-utils 1.0" "" |
| 6 .\" disable hyphenation |
| 7 .nh |
| 8 .\" disable justification (adjust text to left margin only) |
| 9 .ad l |
| 10 .SH "NAME" |
| 11 xdg\-desktop\-menu \- command line tool for (un)installing desktop menu items |
| 12 .SH "SYNOPSIS" |
| 13 .HP 17 |
| 14 \fBxdg\-desktop\-menu\fR install [\fB\-\-noupdate\fR] [\fB\-\-novendor\fR] [\fB\
-\-mode\ \fR\fB\fImode\fR\fR] \fIdirectory\-file(s)\fR \fIdesktop\-file(s)\fR |
| 15 .HP 17 |
| 16 \fBxdg\-desktop\-menu\fR uninstall [\fB\-\-noupdate\fR] [\fB\-\-mode\ \fR\fB\fIm
ode\fR\fR] \fIdirectory\-file(s)\fR \fIdesktop\-file(s)\fR |
| 17 .HP 17 |
| 18 \fBxdg\-desktop\-menu\fR forceupdate [\fB\-\-mode\ \fR\fB\fImode\fR\fR] |
| 19 .HP 17 |
| 20 \fBxdg\-desktop\-menu\fR {\fB\-\-help\fR \fB\-\-manual\fR \fB\-\-version\fR} |
| 21 .SH "DESCRIPTION" |
| 22 .PP |
| 23 The xdg\-desktop\-menu program can be used to install new menu entries to the de
sktop's application menu. |
| 24 .PP |
| 25 The application menu works according to the XDG Desktop Menu Specification at ht
tp://www.freedesktop.org/Standards/menu\-spec |
| 26 .SH "COMMANDS" |
| 27 .TP |
| 28 install |
| 29 Install one or more applications in a submenu of the desktop menu system. |
| 30 .sp |
| 31 \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. Th
e most important aspects of *.desktop files are summarized below. |
| 32 .sp |
| 33 Menu entries can be added to the menu system in two different ways. They can eit
her be added to a predefined submenu in the menu system based on one or more cat
egory keywords, or they can be added to a new submenu. |
| 34 .sp |
| 35 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 m
enu item will be included in an appropriate submenu based on the included keywor
ds. |
| 36 .sp |
| 37 To add menu items to a new submenu the desktop\-files must be preceded by a dire
ctory\-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 |
| 38 \fBxdg\-desktop\-menu\fR |
| 39 the entries will be installed in addition to any already existing entries. |
| 40 .sp |
| 41 \fIdirectory\-file\fR: The *.directory file indicated by |
| 42 \fIdirectory\-file\fR |
| 43 represents a submenu. The directory file provides the name and icon for a submen
u. The name of the directory file is used to identify the submenu. |
| 44 .sp |
| 45 If multiple directory files are provided each file will represent a submenu with
in the menu that preceeds it, creating a nested menu hierarchy (sub\-sub\-menus)
. The menu entries themselves will be added to the last submenu. |
| 46 .sp |
| 47 Directory files follow the syntax defined by the freedesktop.org Desktop Entry S
pecification. |
| 48 .TP |
| 49 uninstall |
| 50 Remove applications or submenus from the desktop menu system previously installe
d with |
| 51 \fBxdg\-desktop\-menu install\fR. |
| 52 .sp |
| 53 A submenu and the associated directory file is only removed when the submenu no
longer contains any menu entries. |
| 54 .TP |
| 55 forceupdate |
| 56 Force an update of the menu system. |
| 57 .sp |
| 58 This command is only useful if the last call to xdg\-desktop\-menu included the |
| 59 \fB\-\-noupdate\fR |
| 60 option. |
| 61 .SH "OPTIONS" |
| 62 .TP |
| 63 \fB\-\-noupdate\fR |
| 64 Postpone updating the menu system. If multiple updates to the menu system are ma
de in sequence this flag can be used to indicate that additional changes will fo
llow and that it is not necassery to update the menu system right away. |
| 65 .TP |
| 66 \fB\-\-novendor\fR |
| 67 Normally, xdg\-desktop\-menu checks to ensure that any *.directory and *.desktop
files to be installed has a vendor prefix. This option can be used to disable t
hat check. |
| 68 .sp |
| 69 A vendor prefix consists of alpha characters ([a\-zA\-Z]) and is terminated with
a dash ("\-"). Companies and organizations are encouraged to use a word or phra
se, preferably the organizations name, for which they hold a trademark as their
vendor prefix. The purpose of the vendor prefix is to prevent name conflicts. |
| 70 .TP |
| 71 \fB\-\-mode\fR \fImode\fR |
| 72 \fImode\fR |
| 73 can be |
| 74 \fIuser\fR |
| 75 or |
| 76 \fIsystem\fR. In user mode the file is (un)installed for the current user only.
In system mode the file is (un)installed for all users on the system. Usually on
ly root is allowed to install in system mode. |
| 77 .sp |
| 78 The default is to use system mode when called by root and to use user mode when
called by a non\-root user. |
| 79 .TP |
| 80 \fB\-\-help\fR |
| 81 Show command synopsis. |
| 82 .TP |
| 83 \fB\-\-manual\fR |
| 84 Show this manualpage. |
| 85 .TP |
| 86 \fB\-\-version\fR |
| 87 Show the xdg\-utils version information. |
| 88 .SH "DESKTOP FILES" |
| 89 .PP |
| 90 An application item in the application menu is represented by a *.desktop file.
A *.desktop file consists of a |
| 91 \fI[Desktop Entry]\fR |
| 92 header followed by several |
| 93 \fIKey\fR=\fIValue\fR |
| 94 lines. |
| 95 .PP |
| 96 A *.desktop file can provide a name and description for an application in severa
l different languages. This is done by adding a language code as used by LC_MESS
AGES in square brackets behind the |
| 97 \fIKey\fR. This way one can specify different values for the same |
| 98 \fIKey\fR |
| 99 depending on the currently selected language. |
| 100 .PP |
| 101 The following keys are often used: |
| 102 .TP |
| 103 Value=1.0 |
| 104 This is a mandatory field to indicate that the *.desktop file follows the 1.0 ve
rsion of the specification. |
| 105 .TP |
| 106 Type=Application |
| 107 This is a mandatory field that indicates that the *.desktop file describes an ap
plication launcher. |
| 108 .TP |
| 109 Name=\fIApplication Name\fR |
| 110 The name of the application. For example |
| 111 \fIMozilla\fR |
| 112 .TP |
| 113 GenericName=\fIGeneric Name\fR |
| 114 A generic description of the application. For example |
| 115 \fIWeb Browser\fR |
| 116 .TP |
| 117 Comment=\fIComment\fR |
| 118 Optional field to specify a tooltip for the application. For example |
| 119 \fIVisit websites on the Internet\fR |
| 120 .TP |
| 121 Icon=\fIIcon File\fR |
| 122 The icon to use for the application. This can either be an absolute path to an i
mage 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 |
| 123 \fBxdg\-icon\-resource\fR |
| 124 command can be used to install image files into icon themes. The advantage of us
ing an icon\-name instead of an absolute path is that with an icon\-name the app
lication icon can be provided in several different sizes as well as in several d
ifferently themed styles. |
| 125 .TP |
| 126 Exec=\fICommand Line\fR |
| 127 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 l
auncher the %f is replaced with the file path of the dropped file. If multiple f
iles can be specified on the command line the %F placeholder should be used inst
ead of %f. If the application is able to open URLs in addition to local files th
en %u or %U can be used instead of %f or %F. |
| 128 .TP |
| 129 Categories=\fICategories\fR |
| 130 A list of categories separated by semi\-colons. A category is a keyword that des
cribes and classifies the application. By default applications are organized in
the application menu based on category. When menu entries are explicitly assigne
d to a new submenu it is not necassery to list any categories. |
| 131 .sp |
| 132 When using categories it is recommended to include one of the following categori
es: AudioVideo, Development, Education, Game, Graphics, Network, Office, Setting
s, System, Utility. |
| 133 .sp |
| 134 See Appendix A of the XDG Desktop Menu Specification for information about addit
ional categories. http://standards.freedesktop.org/menu\-spec/menu\-spec\-1.0.ht
ml |
| 135 .TP |
| 136 MimeType=\fIMimetypes\fR |
| 137 A list of mimetypes separated by semi\-colons. This field is used to indicate wh
ich file types the application is able to open. |
| 138 .PP |
| 139 For a complete oveview of the *.desktop file format please visit http://www.free
desktop.org/wiki/Standards/desktop\-entry\-spec |
| 140 .SH "DIRECTORY FILES" |
| 141 .PP |
| 142 The appearance of submenu in the application menu is provided by a *.directory f
ile. In particular it provides the title of the submenu and a possible icon. A *
.directory file consists of a |
| 143 \fI[Desktop Entry]\fR |
| 144 header followed by several |
| 145 \fIKey\fR=\fIValue\fR |
| 146 lines. |
| 147 .PP |
| 148 A *.directory file can provide a title (name) for the submenu in several differe
nt languages. This is done by adding a language code as used by LC_MESSAGES in s
quare brackets behind the |
| 149 \fIKey\fR. This way one can specify different values for the same |
| 150 \fIKey\fR |
| 151 depending on the currently selected language. |
| 152 .PP |
| 153 The following keys are relevqnt for submenus: |
| 154 .TP |
| 155 Value=1.0 |
| 156 This is a mandatory field to indicate that the *.directory file follows the 1.0
version of the Desktop Entry specification. |
| 157 .TP |
| 158 Type=Directory |
| 159 This is a mandatory field that indicates that the *.directory file describes a s
ubmenu. |
| 160 .TP |
| 161 Name=\fIMenu Name\fR |
| 162 The title of submenu. For example |
| 163 \fIMozilla\fR |
| 164 .TP |
| 165 Comment=\fIComment\fR |
| 166 Optional field to specify a tooltip for the submenu. |
| 167 .TP |
| 168 Icon=\fIIcon File\fR |
| 169 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 |
| 170 \fBxdg\-icon\-resource\fR |
| 171 command can be used to install image files into icon themes. The advantage of us
ing an icon\-name instead of an absolute path is that with an icon\-name the sub
menu icon can be provided in several different sizes as well as in several diffe
rently themed styles. |
| 172 .SH "ENVIRONMENT VARIABLES" |
| 173 .PP |
| 174 xdg\-desktop\-menu honours the following environment variables: |
| 175 .TP |
| 176 XDG_UTILS_DEBUG_LEVEL |
| 177 Setting this environment variable to a non\-zero numerical value makes xdg\-desk
top\-menu do more verbose reporting on stderr. Setting a higher value increases
the verbosity. |
| 178 .TP |
| 179 XDG_UTILS_INSTALL_MODE |
| 180 This environment variable can be used by the user or administrator to override t
he installation mode. Valid values are |
| 181 \fIuser\fR |
| 182 and |
| 183 \fIsystem\fR. |
| 184 .SH "EXIT CODES" |
| 185 .PP |
| 186 An exit code of 0 indicates success while a non\-zero exit code indicates failur
e. The following failure codes can be returned: |
| 187 .TP |
| 188 \fB1\fR |
| 189 Error in command line syntax. |
| 190 .TP |
| 191 \fB2\fR |
| 192 One of the files passed on the command line did not exist. |
| 193 .TP |
| 194 \fB3\fR |
| 195 A required tool could not be found. |
| 196 .TP |
| 197 \fB4\fR |
| 198 The action failed. |
| 199 .TP |
| 200 \fB5\fR |
| 201 No permission to read one of the files passed on the command line. |
| 202 .SH "SEE ALSO" |
| 203 .PP |
| 204 \fBxdg\-desktop\-icon\fR(1), |
| 205 \fBxdg\-icon\-resource\fR(1), |
| 206 \fBxdg\-mime\fR(1) |
| 207 .SH "EXAMPLES" |
| 208 .PP |
| 209 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 |
| 210 \fICategories\fR |
| 211 entry: |
| 212 .sp |
| 213 .nf |
| 214 shinythings\-webmirror.desktop: |
| 215 |
| 216 [Desktop Entry] |
| 217 Encoding=UTF\-8 |
| 218 Type=Application |
| 219 |
| 220 Exec=webmirror |
| 221 Icon=webmirror |
| 222 |
| 223 Name=WebMirror |
| 224 Name[nl]=WebSpiegel |
| 225 |
| 226 Categories=Network;WebDevelopment; |
| 227 .fi |
| 228 .sp |
| 229 .PP |
| 230 Now the xdg\-desktop\-menu tool can be used to add the shinythings\-webmirror.de
sktop file to the desktop application menu: |
| 231 .sp |
| 232 .nf |
| 233 xdg\-desktop\-menu install ./shinythings\-webmirror.desktop |
| 234 .fi |
| 235 .sp |
| 236 .PP |
| 237 Note that for the purpose of this example the menu items are available in two la
nguages, English and Dutch. The language code for Dutch is nl. |
| 238 .PP |
| 239 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. |
| 240 .PP |
| 241 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 i
nclude a Categories= line: |
| 242 .sp |
| 243 .nf |
| 244 shinythings\-webmirror.desktop: |
| 245 |
| 246 [Desktop Entry] |
| 247 Encoding=UTF\-8 |
| 248 Type=Application |
| 249 |
| 250 Exec=webmirror |
| 251 Icon=shinythings\-webmirror |
| 252 |
| 253 Name=WebMirror |
| 254 Name[nl]=WebSpiegel |
| 255 |
| 256 |
| 257 shinythings\-webmirror\-admin.desktop: |
| 258 |
| 259 [Desktop Entry] |
| 260 Encoding=UTF\-8 |
| 261 Type=Application |
| 262 |
| 263 Exec=webmirror\-admintool |
| 264 Icon=shinythings\-webmirror\-admintool |
| 265 |
| 266 Name=WebMirror Admin Tool |
| 267 Name[nl]=WebSpiegel Administratie Tool |
| 268 .fi |
| 269 .sp |
| 270 .PP |
| 271 In addition a .directory file needs to be created to provide a title and icon fo
r the sub\-menu itself: |
| 272 .sp |
| 273 .nf |
| 274 shinythings\-webmirror.directory: |
| 275 |
| 276 [Desktop Entry] |
| 277 Encoding=UTF\-8 |
| 278 |
| 279 Icon=shinythings\-webmirror\-menu |
| 280 |
| 281 Name=WebMirror |
| 282 Name[nl]=WebSpiegel |
| 283 .fi |
| 284 .sp |
| 285 .PP |
| 286 These file can now be installed with: |
| 287 .sp |
| 288 .nf |
| 289 xdg\-desktop\-menu install ./shinythings\-webmirror.directory \\ |
| 290 ./shinythings\-webmirror.desktop ./shinythings\-webmirror\-admin.desktop |
| 291 .fi |
| 292 .sp |
| 293 .PP |
| 294 The menu entries could also be installed one by one: |
| 295 .sp |
| 296 .nf |
| 297 xdg\-desktop\-menu install \-\-noupdate ./shinythings\-webmirror.directory \\ |
| 298 ./shinythings\-webmirror.desktop |
| 299 xdg\-desktop\-menu install \-\-noupdate ./shinythings\-webmirror.directory \\ |
| 300 ./shinythings\-webmirror\-admin.desktop |
| 301 xdg\-desktop\-menu forceupdate |
| 302 .fi |
| 303 .sp |
| 304 .PP |
| 305 Although the result is the same it is slightly more efficient to install all fil
es at the same time. |
| 306 .PP |
| 307 The *.desktop and *.directory files reference icons with the names webmirror, we
bmirror\-admin and webmirror\-menu which should also be installed. In this examp
le the icons are installed in two different sizes, once with a size of 22x22 pix
els and once with a size of 64x64 pixels: |
| 308 .sp |
| 309 .nf |
| 310 xdg\-icon\-resource install \-\-size 22 ./wmicon\-22.png shinythings\-webmirror |
| 311 xdg\-icon\-resource install \-\-size 22 ./wmicon\-menu\-22.png shinythings\-webm
irror\-menu |
| 312 xdg\-icon\-resource install \-\-size 22 ./wmicon\-admin\-22.png shinythings\-web
mirror\-admin |
| 313 xdg\-icon\-resource install \-\-size 64 ./wmicon\-64.png shinythings\-webmirror |
| 314 xdg\-icon\-resource install \-\-size 64 ./wmicon\-menu\-64.png shinythings\-webm
irror\-menu |
| 315 xdg\-icon\-resource install \-\-size 64 ./wmicon\-admin\-64.png shinythings\-web
mirror\-admin |
| 316 .fi |
| 317 .sp |
| 318 .SH "AUTHOR" |
| 319 Kevin Krammer, Jeremy White. |
| 320 .br |
| 321 <kevin.krammer@gmx.at> |
| 322 .br |
| 323 <jwhite@codeweavers.com> |
OLD | NEW |