1XDG-DESKTOP-MENU(1) XDG-DESKTOP-MENU(1)
2
3
4
6 xdg-desktop-menu - command line tool for (un)installing desktop menu
7 items
8
10 xdg-desktop-menu install [--noupdate] [--novendor] [--mode mode]
11 directory-file(s) desktop-file(s)
12
13 xdg-desktop-menu uninstall [--noupdate] [--mode mode] directory-file(s)
14 desktop-file(s)
15
16 xdg-desktop-menu forceupdate [--mode mode]
17
18 xdg-desktop-menu {--help --manual --version}
19
21 The xdg-desktop-menu program can be used to install new menu entries to
22 the desktop's application menu.
23
24 The application menu works according to the XDG Desktop Menu
25 Specification at http://www.freedesktop.org/Standards/menu-spec
26
28 install
29 Install one or more applications in a submenu of the desktop
30 menu system.
31
32 desktop-file: A desktop file represents a single menu entry in
33 the menu. Desktop files are defined by the freedesktop.org
34 Desktop Entry Specification. The most important aspects of
35 *.desktop files are summarized below.
36
37 Menu entries can be added to the menu system in two different
38 ways. They can either be added to a predefined submenu in the
39 menu system based on one or more category keywords, or they can
40 be added to a new submenu.
41
42 To add a menu entry to a predefined submenu the desktop file
43 that represents the menu entry must have a Categories= entry
44 that lists one or more keywords. The menu item will be included
45 in an appropriate submenu based on the included keywords.
46
47 To add menu items to a new submenu the desktop-files must be
48 preceded by a directory-file that describes the submenu. If
49 multiple desktop-files are specified, all entries will be added
50 to the same menu. If entries are installed to a menu that has
51 been created with a previous call to xdg-desktop-menu the
52 entries will be installed in addition to any already existing
53 entries.
54
55 directory-file: The *.directory file indicated by directory-file
56 represents a submenu. The directory file provides the name and
57 icon for a submenu. The name of the directory file is used to
58 identify the submenu.
59
60 If multiple directory files are provided each file will
61 represent a submenu within the menu that preceeds it, creating a
62 nested menu hierarchy (sub-sub-menus). The menu entries
63 themselves will be added to the last submenu.
64
65 Directory files follow the syntax defined by the freedesktop.org
66 Desktop Entry Specification.
67
68 uninstall
69 Remove applications or submenus from the desktop menu system
70 previously installed with xdg-desktop-menu install.
71
72 A submenu and the associated directory file is only removed when
73 the submenu no longer contains any menu entries.
74
75 forceupdate
76 Force an update of the menu system.
77
78 This command is only useful if the last call to xdg-desktop-menu
79 included the --noupdate option.
80
82 --noupdate
83 Postpone updating the menu system. If multiple updates to the
84 menu system are made in sequence this flag can be used to
85 indicate that additional changes will follow and that it is not
86 necassery to update the menu system right away.
87
88 --novendor
89 Normally, xdg-desktop-menu checks to ensure that any *.directory
90 and *.desktop files to be installed has a vendor prefix. This
91 option can be used to disable that check.
92
93 A vendor prefix consists of alpha characters ([a-zA-Z]) and is
94 terminated with a dash ("-"). Companies and organizations are
95 encouraged to use a word or phrase, preferably the organizations
96 name, for which they hold a trademark as their vendor prefix.
97 The purpose of the vendor prefix is to prevent name conflicts.
98
99 --mode mode
100 mode can be user or system. In user mode the file is
101 (un)installed for the current user only. In system mode the file
102 is (un)installed for all users on the system. Usually only root
103 is allowed to install in system mode.
104
105 The default is to use system mode when called by root and to use
106 user mode when called by a non-root user.
107
108 --help Show command synopsis.
109
110 --manual
111 Show this manualpage.
112
113 --version
114 Show the xdg-utils version information.
115
117 An application item in the application menu is represented by a
118 *.desktop file. A *.desktop file consists of a [Desktop Entry] header
119 followed by several Key=Value lines.
120
121 A *.desktop file can provide a name and description for an application
122 in several different languages. This is done by adding a language code
123 as used by LC_MESSAGES in square brackets behind the Key. This way one
124 can specify different values for the same Key depending on the
125 currently selected language.
126
127 The following keys are often used:
128
129 Value=1.0
130 This is a mandatory field to indicate that the *.desktop file
131 follows the 1.0 version of the specification.
132
133 Type=Application
134 This is a mandatory field that indicates that the *.desktop file
135 describes an application launcher.
136
137 Name=Application Name
138 The name of the application. For example Mozilla
139
140 GenericName=Generic Name
141 A generic description of the application. For example Web
142 Browser
143
144 Comment=Comment
145 Optional field to specify a tooltip for the application. For
146 example Visit websites on the Internet
147
148 Icon=Icon File
149 The icon to use for the application. This can either be an
150 absolute path to an image file or an icon-name. If an icon-name
151 is provided an image lookup by name is done in the user's
152 current icon theme. The xdg-icon-resource command can be used to
153 install image files into icon themes. The advantage of using an
154 icon-name instead of an absolute path is that with an icon-name
155 the application icon can be provided in several different sizes
156 as well as in several differently themed styles.
157
158 Exec=Command Line
159 The command line to start the application. If the application
160 can open files the %f placeholder should be specified. When a
161 file is dropped on the application launcher the %f is replaced
162 with the file path of the dropped file. If multiple files can be
163 specified on the command line the %F placeholder should be used
164 instead of %f. If the application is able to open URLs in
165 addition to local files then %u or %U can be used instead of %f
166 or %F.
167
168 Categories=Categories
169 A list of categories separated by semi-colons. A category is a
170 keyword that describes and classifies the application. By
171 default applications are organized in the application menu based
172 on category. When menu entries are explicitly assigned to a new
173 submenu it is not necassery to list any categories.
174
175 When using categories it is recommended to include one of the
176 following categories: AudioVideo, Development, Education, Game,
177 Graphics, Network, Office, Settings, System, Utility.
178
179 See Appendix A of the XDG Desktop Menu Specification for
180 information about additional categories.
181 http://standards.freedesktop.org/menu-spec/menu-spec-1.0.html
182
183 MimeType=Mimetypes
184 A list of mimetypes separated by semi-colons. This field is used
185 to indicate which file types the application is able to open.
186
187 For a complete oveview of the *.desktop file format please visit
188 http://www.freedesktop.org/wiki/Standards/desktop-entry-spec
189
191 The appearance of submenu in the application menu is provided by a
192 *.directory file. In particular it provides the title of the submenu
193 and a possible icon. A *.directory file consists of a [Desktop Entry]
194 header followed by several Key=Value lines.
195
196 A *.directory file can provide a title (name) for the submenu in
197 several different languages. This is done by adding a language code as
198 used by LC_MESSAGES in square brackets behind the Key. This way one can
199 specify different values for the same Key depending on the currently
200 selected language.
201
202 The following keys are relevqnt for submenus:
203
204 Value=1.0
205 This is a mandatory field to indicate that the *.directory file
206 follows the 1.0 version of the Desktop Entry specification.
207
208 Type=Directory
209 This is a mandatory field that indicates that the *.directory
210 file describes a submenu.
211
212 Name=Menu Name
213 The title of submenu. For example Mozilla
214
215 Comment=Comment
216 Optional field to specify a tooltip for the submenu.
217
218 Icon=Icon File
219 The icon to use for the submenu. This can either be an absolute
220 path to an image file or an icon-name. If an icon-name is
221 provided an image lookup by name is done in the user's current
222 icon theme. The xdg-icon-resource command can be used to install
223 image files into icon themes. The advantage of using an
224 icon-name instead of an absolute path is that with an icon-name
225 the submenu icon can be provided in several different sizes as
226 well as in several differently themed styles.
227
229 xdg-desktop-menu honours the following environment variables:
230
231 XDG_UTILS_DEBUG_LEVEL
232 Setting this environment variable to a non-zero numerical value
233 makes xdg-desktop-menu do more verbose reporting on stderr.
234 Setting a higher value increases the verbosity.
235
236 XDG_UTILS_INSTALL_MODE
237 This environment variable can be used by the user or
238 administrator to override the installation mode. Valid values
239 are user and system.
240
242 An exit code of 0 indicates success while a non-zero exit code
243 indicates failure. The following failure codes can be returned:
244
245 1 Error in command line syntax.
246
247 2 One of the files passed on the command line did not exist.
248
249 3 A required tool could not be found.
250
251 4 The action failed.
252
253 5 No permission to read one of the files passed on the command
254 line.
255
257 xdg-desktop-icon(1), xdg-icon-resource(1), xdg-mime(1)
258
260 The company ShinyThings Inc. has developed an application named
261 "WebMirror" and would like to add it to the application menu. The
262 company will use "shinythings" as its vendor id. In order to add the
263 application to the menu there needs to be a .desktop file with a
264 suitable Categories entry:
265
266 shinythings-webmirror.desktop:
267
268 [Desktop Entry]
269 Encoding=UTF-8
270 Type=Application
271
272 Exec=webmirror
273 Icon=webmirror
274
275 Name=WebMirror
276 Name[nl]=WebSpiegel
277
278 Categories=Network;WebDevelopment;
279
280
281 Now the xdg-desktop-menu tool can be used to add the
282 shinythings-webmirror.desktop file to the desktop application menu:
283
284 xdg-desktop-menu install ./shinythings-webmirror.desktop
285
286
287 Note that for the purpose of this example the menu items are available
288 in two languages, English and Dutch. The language code for Dutch is nl.
289
290 In the next example the company ShinyThings Inc. will add its own
291 submenu to the desktop application menu consisting of a "WebMirror"
292 menu item and a "WebMirror Admin Tool" menu item.
293
294 First the company needs to create two .desktop files that describe the
295 two menu items. Since the items are to be added to a new submenu it is
296 not necassery to include a Categories= line:
297
298 shinythings-webmirror.desktop:
299
300 [Desktop Entry]
301 Encoding=UTF-8
302 Type=Application
303
304 Exec=webmirror
305 Icon=shinythings-webmirror
306
307 Name=WebMirror
308 Name[nl]=WebSpiegel
309
310
311 shinythings-webmirror-admin.desktop:
312
313 [Desktop Entry]
314 Encoding=UTF-8
315 Type=Application
316
317 Exec=webmirror-admintool
318 Icon=shinythings-webmirror-admintool
319
320 Name=WebMirror Admin Tool
321 Name[nl]=WebSpiegel Administratie Tool
322
323
324 In addition a .directory file needs to be created to provide a title
325 and icon for the sub-menu itself:
326
327 shinythings-webmirror.directory:
328
329 [Desktop Entry]
330 Encoding=UTF-8
331
332 Icon=shinythings-webmirror-menu
333
334 Name=WebMirror
335 Name[nl]=WebSpiegel
336
337
338 These file can now be installed with:
339
340 xdg-desktop-menu install ./shinythings-webmirror.directory \
341 ./shinythings-webmirror.desktop ./shinythings-webmirror-admin.desktop
342
343
344 The menu entries could also be installed one by one:
345
346 xdg-desktop-menu install --noupdate ./shinythings-webmirror.directory \
347 ./shinythings-webmirror.desktop
348 xdg-desktop-menu install --noupdate ./shinythings-webmirror.directory \
349 ./shinythings-webmirror-admin.desktop
350 xdg-desktop-menu forceupdate
351
352
353 Although the result is the same it is slightly more efficient to
354 install all files at the same time.
355
356 The *.desktop and *.directory files reference icons with the names
357 webmirror, webmirror-admin and webmirror-menu which should also be
358 installed. In this example the icons are installed in two different
359 sizes, once with a size of 22x22 pixels and once with a size of 64x64
360 pixels:
361
362 xdg-icon-resource install --size 22 ./wmicon-22.png shinythings-webmirror
363 xdg-icon-resource install --size 22 ./wmicon-menu-22.png shinythings-webmirror-menu
364 xdg-icon-resource install --size 22 ./wmicon-admin-22.png shinythings-webmirror-admin
365 xdg-icon-resource install --size 64 ./wmicon-64.png shinythings-webmirror
366 xdg-icon-resource install --size 64 ./wmicon-menu-64.png shinythings-webmirror-menu
367 xdg-icon-resource install --size 64 ./wmicon-admin-64.png shinythings-webmirror-admin
368
369
371 Kevin Krammer, Jeremy White.
372 <kevin.krammer@gmx.at>
373 <jwhite@codeweavers.com>
374
375
376
377xdg-utils 1.0 06/24/2007 XDG-DESKTOP-MENU(1)