Debian Codegraph @

bin/fvwm-menu-desktop.1.in

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 .\" t
2 .\" @(#)@PACKAGE@-@VERSION@ @RELDATELONG@
3 .de EX \"Begin example
4 .ne 5
5 .if n .sp 1
6 .if t .sp .5
7 .nf
8 .in +.5i
9 ..
10 .de EE
11 .fi
12 .in -.5i
13 .if n .sp 1
14 .if t .sp .5
15 ..
16 .ta .3i .6i .9i 1.2i 1.5i 1.8i
17 .TH fvwm-menu-desktop 1 "@RELDATELONG@ (@VERSION@)" Fvwm "Fvwm Modules"
18 .UC
19 .SH NAME
20 fvwm-menu-desktop \- Reads XDG menu files and creates Fvwm menus
21
22 .SH SYNOPSIS
23 fvwm-menu-desktop
24 [ \fB\-\-help\fR|\fB\-h\fR ]
25 [ \fB\-\-version\fR ]
26 [ \fB\-\-install\-prefix\fR \fIDIR\fR ]
27 [ \fB\-\-desktop\fR \fINAME\fR ]
28 [ \fB\-\-menu\-type\fR \fINAME\fR ]
29 [ \fB\-\-theme\fR \fINAME\fR ]
30 [ \fB\-\-with\-titles\fR|\fB\-w\fR ]
31 [ \fB\-\-without\-titles\fR ]
32 [ \fB\-\-enable\-mini\-icons\fR ]
33 [ \fB\-\-size\fR|\fB\-s\fR \fINUM\fR ]
34 [ \fB\-\-mini\-icon\-dir\fR \fIDIR\fR ]
35 [ \fB\-\-app\-icon\fR \fINAME\fR ]
36 [ \fB\-\-dir\-icon\fR \fINAME\fR ]
37 [ \fB\-\-title\fR|\fB\-t\fR \fINAME\fR ]
38 [ \fB\-\-insert\-in\-menu\fR \fINAME\fR ]
39 [ \fB\-\-get\-menus\fR \fIall\fR|\fIdesktop\fR ]
40 [ \fB\-\-set\-menus\fR \fImenu_paths\fR ]
41 [ \fB\-\-all\-menus\fR ]
42 [ \fB\-\-include\-items\fR \fINAME\fR ]
43 [ \fB\-\-regen\-cmd\fR \fICMD\fR ]
44 [ \fB\-\-term\-cmd\fR \fICMD\fR ]
45 [ \fB\-\-dynamic\fR ]
46 [ \fB\-\-menu-error\fR|\fB\-e\fR ]
47 [ \fB\-\-verbose\fR|\fB\-v\fR ]
48
49
50 .SH DESCRIPTION
51 This is a python script which parses XDG menus definitions to build
52 corresponding fvwm menus. This script depends on python-xdg to run.
53
54
55 .SH OPTIONS
56
57 .IP "Main Options"
58
59 .IP "\fB\-\-help\fR"
60 Show the help and exit.
61
62 .IP "\fB\-\-version\fR"
63 Show the version and exit.
64
65 .IP "\fB\-\-get\-menus\fR \fIall\fR|\fIdesktop\fR"
66 Prints a space separated list of full menu paths found on the system.
67 \fIall\fR will print all menus found on the system except empty ones.
68 \fIdesktop\fR will print the menu(s) that would be generated by the script.
69
70 No menu generation is done.
71
72 .IP "\fB\-\-desktop\fR \fINAME\fR"
73 Optional parameter to set the \fINAME\fR of the desktop XDG .menu
74 file(s) to use. This option will override any default menus
75 set via \fBFvwmForm-XDGMenu-Config\fR and cause the script
76 to find menus in which \fINAME\fR is a part of the file name.
77 Possible names are: \fIgnome\fR, \fIkde\fR, \fIxfce\fR, \fIlxde\fR,
78 \fIdebian\fR, etc.
79
80 This option can be used in conjunction with \fB\-\-menu\-type\fR
81 to control which .menu file(s) are used.
82
83 .IP "\fB\-\-menu\-type\fR \fINAME\fR"
84 Optional parameter to set the \fINAME\fR of the XDG menu type
85 to use. This option will override any default menus
86 set via \fBFvwmForm-XDGMenu-Config\fR and cause the script
87 to find menus in which \fINAME\fR is a part of the file name.
88 Possible \fINAME\fR types could be: \fIapplications\fR, \fIsettings\fR,
89 \fIpreferences\fR, etc.
90
91 When used in conjunction with \fB\-\-desktop\fR, only menus whose file
92 name matches '*destkop*menutype*' are found. If no menus are found,
93 the script exits with an error.
94
95 .IP "\fB\-\-all\-menus\fR"
96 This option will build all menus found on the system. If used in
97 conjunction with \fB\-\-desktop\fR or \fB\-\-menu\-type\fR this will
98 build all menus matching those settings.
99
100 .IP "\fB\-\-install-prefix\fR \fIDIR\fR"
101 Optional parameter to override the standard locations for XDG menu
102 definitions. Tells \fBfvwm-menu-desktop\fR to look in \fIDIR\fR for .menu
103 files instead of the standard locations /etc/xdg/menus (and
104 $HOME/.config/menus if it exists).
105
106 .IP "\fB\-\-with\-titles\fR|\fB\-w\fR"
107 If this option is set menus are generated with titles. This is the default.
108 This option can be used to override the \fBFvwmForm-XDGMenu-Config\fR
109 default setting.
110
111 .IP "\fB\-\-without\-titles\fR"
112 If this option is set menus are generated without titles. The default
113 is to generate with titles.
114
115 .IP "\fB\-\-title\fR|\fB\-t\fR \fINAME\fR "
116 Option to define the menu title \fINAME\fR of the top menu used by Fvwm's
117 \fBMenu\fR or \fBPopup\fR commands. Default is "XDGMenu".
118
119 .IP "\fB\-\-include\-items\fR \fINAME\fR "
120 This option controls if the additional menu items 'Regenerate' and 'Configure'
121 are included in the top level menu. \fINAME\fR can be one of \fIregenerate\fR,
122 \fIconfig\fR, \fIboth\fR, or \fInone\fR. The default is \fIboth\fR.
123
124 .IP "\fB\-\-regen\-cmd\fR \fICMD\fR "
125 This option sets the fvwm command \fICMD\fR that is run when the menu item
126 \&'Regenerate' is selected. The default is "PipeRead `fvwm-menu-desktop`".
127
128 .IP "\fB\-\-term\-cmd\fR \fICMD\fR "
129 This option sets the terminal emulator command \fICMD\fR that is used to
130 to run terminal applications in. \fICMD\fR needs to end with an execute
131 option, such as xterm's -e option, which will run the command that is
132 appended to \fICMD\fR. The default is "xterm -e".
133
134 .IP "\fB\-\-dynamic\fR "
135 This option is to be used with creating dynamic menus using
136 \fBDynamicPopUpAction\fR and \fBDynamicPopDownAction\fR. This adds
137 a 'recreate' to the \fBDestroyMenu\fR command on the top level menu
138 so those actions are not Destroyed when the menu is regenerated.
139
140 .IP "\fB\-\-insert\-in\-menu\fR \fINAME\fR"
141 Option to insert generated menu(s) \fBIN\fR a menu \fINAME\fR (its
142 top title). This option makes it so the top level menu is not
143 Destroyed and the items are added to the end.
144
145 Note menus regenerated with this option will append the menu items
146 at the end of the existing menu. Each time the menu is regenerated
147 new menu items appear giving a growing menu of duplicate items.
148 You have to regenerate the whole menu via a function or restart
149 fvwm. See \fBEXAMPLES\fR below for some solutions.
150
151 .IP "\fB\-\-set\-menus\fR \fImenu_paths\fR"
152 Generates all menus listed in a space separated list of full menu paths.
153 This option overrides any defaults and \fB\-\-desktop\fR|\fB\-\-menu\-type\fR
154 settings.
155
156 .IP "\fB\-\-menu-error\fR |\fB\-t\fR"
157 If this option is present and python-xdg is not found, the script
158 will print the error in the generated menu. Used in the default-config.
159
160 .IP "\fB\-\-verbose\fR"
161 Enables additional information printouts on STDERR.
162
163 .IP "Icons Options"
164
165 By default, fvwm-menu-desktop builds menus without mini\-icons. To enable
166 mini\-icons use the following options.
167
168 If ImageMagick is installed on the system, the script will resize and copy
169 the icons to $FVWM_USERDIR/.icons. This can take awhile. You should be
170 prepared to wait the first time you generate the icons. Once the icons
171 have been generated the script should run faster. If it is still to slow
172 using icons, see \fBEXAMPLES\fR for ways to limit how often
173 the menu is generated to speed things up.
174
175 .IP "\fB\-\-enable\-mini\-icons\fR"
176 This option enables mini\-icons in the menus. If set, 24x24 mini-icons
177 are used. If the specified icon isn't that size it will be converted
178 if \fBImageMagick\fR is installed and saved in $HOME/.fvwm/icons or to
179 the directory specified with \-\-mini\-icon\-dir option. Otherwise no icon
180 appears in the menu for that entry.
181 With most distributions, all the menu entries will have mini-icons
182 appropriate to the application.
183
184 .IP "\fB\-\-theme\fR \fINAME\fR"
185 Defines the used icon theme. Default is \fIgnome\fR but all others
186 found in /usr/share/icons could be used except the \fIhicolor\fR theme
187 because it's the default fallback theme if no icon is found.
188
189 .IP "\fB\-\-size\fR|\fB\-s\fR \fINUM\fR"
190 If \-\-enable\-mini\-icons is used the \fIsize\fR of the icons can
191 changed with this parameter. Default is 24.
192
193 .IP "\fB\-\-mini\-icon\-dir\fR \fIDIR\fR"
194 When the right size mini-icon isn't available,
195 fvwm-menu-desktop creates icons with the right size in $HOME/.fvwm/icons.
196 If you don't want to use the default directory, $HOME/.fvwm/icons,
197 use this option to specify a different folder.
198
199 .IP "\fB\-\-app\-icon\fR \fINAME\fR"
200 Sets the default application icon if no others are found. Default is
201 \&'gnome-applications'.
202
203 .IP "\fB\-\-dir\-icon\fR \fINAME\fR"
204 Sets the default directory icon if no others are found. Default is
205 \&'gnome-fs-directory'.
206
207 .SH USAGE
208 \fBfvwm-menu-desktop\fR outputs XDG .menu files in the syntax of fvwm
209 menus. When \fBfvwm-menu-desktop\fR is run with no options, it will load
210 defaults from the \fBFvwmForm-XDGMenu-Config\fR file (see below) then
211 search your system for suitable menu file(s). To see which menus are
212 available on your system run:
213
214 .RS
215 .EX
216 fvwm-menu-desktop --get-menus all
217 .EE
218 .RE
219
220 If no menus are found you may not have any installed on your
221 system. By default menus are stored as *.menu files in /etc/xdg/menus,
222 $HOME/.config/menus or the location set in $XDG_MENU_PREFIX. You can
223 use \fB\-\-install\-prefix\fR to specify another location search for menus.
224
225 Though a combination of command line options and the \fBFvwmForm-XDGMenu-Config\fR
226 settings, \fBfvwm-menu-desktop\fR can generate any combination of the menus
227 found. To get a list of what menu(s) would be generated use the
228 \fB--get-menus\fR \fIdesktop\fR option. The following will list all menus
229 generated if \fBfvwm-menu-desktop\fR was run with no options.
230
231 .RS
232 .EX
233 fvwm-menu-desktop --get-menus desktop
234 .EE
235 .RE
236
237 \fBfvwm-menu-desktop\fR determines which menu(s) to generate as follows
238
239 .RS
240 If no config file is found, all menus will be weighted and the script
241 will generate the best (highest weight) menu found.
242
243 If a config file is found (and override options are not used) the script
244 will generate all menus selected in \fBFvwmForm-XDGMenu-Config\fR.
245
246 \fB--desktop\fR, \fB--menu-type\fR, \fB--set-menus\fR and \fB--all-menus\fR
247 will override any menus selected in \fBFvwmForm-XDGMenu-Config\fR.
248
249 \fB--desktop\fR and \fB--menu-type\fR will only include menus whose name
250 matches '*desktop*menutype*'. If used with \fB--all-menus\fR, all matching
251 menus are generated. If used without \fB--all-menus\fR, only the highest
252 weighted menu is generated.
253
254 \fB--set-menus\fR generates menus from the list of full path menu file names.
255
256 \fB--all-menus\fR by itself will generate all menus found.
257 .RE
258
259 By default \fBfvwm-menu-desktop\fR will generate a menu whose
260 top level name is "XDGMenu". To tell fvwm to read the output
261 of \fBfvwm-menu-desktop\fR to create the menu XDGMenu add the following
262 to your fvwm config file:
263
264 .RS
265 .EX
266 PipeRead 'fvwm-menu-desktop'
267 .EE
268 .RE
269
270 \fBWarning:\fR Depending on the options used this command may be
271 slow and fvwm will pause until this command is complete. See
272 \fBEXAMPLES\fR below for more details and possible workarounds.
273
274 Once the menu is generated you can open the menu by using the
275 command "Menu XDGMenu". You can also include this in the MenuFvwmRoot
276 menu by:
277
278 .RS
279 .EX
280 AddToMenu MenuFvwmRoot "XDG Menu" Popup XDGMenu
281 .EE
282 .RE
283
284 \fBfvwm-menu-desktop\fR can be configured though both command line
285 options and a \fBFvwmForm\fR GUI to customize the menu(s) that get
286 generated.
287
288 .SH GUI
289 \fBFvwmForm-XDGMenu-Config\fR is a \fBFvwmForm\fR interface that can
290 be used to configure the defaults for \fBfvwm-menu-desktop\fR. You
291 can access this from the "Configure" item in the top level menu that
292 is generated or run the following from within \fBFvwmConsole\fR
293
294 .RS
295 .EX
296 Module FvwmPerl -l fvwm-menu-desktop-config.fpl
297 .EE
298 .RE
299
300 This form can be used to select which menu(s) get generated by default
301 along with setting many (but not all) of the available options. When
302 you click "Save Settings" the form will write a config file located at
303 $FVWM_USERDIR/.FvwmForm-XDGMenu-Config that \fBfvwm-menu-desktop\fR
304 will parse for defaults when run.
305
306 See the help inside of \fBFvwmForm-XDGMenu-Config\fR for more information.
307
308
309 .SH EXAMPLES
310 There are many ways to setup when fvwm runs \fBfvwm-menu-desktop\fR
311 to generate the menu. One method is to just generate the menu when
312 fvwm loads and then use the GUI config tool to change any options.
313 To do this you only need to add the following to the fvwm config file:
314
315 .RS
316 .EX
317 AddToMenu MenuFvwmRoot "XDG Menu" Popup XDGMenu
318 PipeRead 'fvwm-menu-desktop'
319 .EE
320 .RE
321
322 The menu is created once when fvwm loads. Since menu creation can
323 sometimes be slow, this could cause fvwm to take longer to load than
324 one wants.
325
326 The menu is only generated when fvwm starts. If software
327 is installed or removed you will have to select the 'Regenerate' option
328 to rebuild the menu.
329
330 One way to speed things up is to save the menu in a file and only generate
331 the menu when 'Regenerate' is selected. To do this use \fB--regen-cmd\fR
332 to call a custom function and write the menu to a file using a command like
333
334 .RS
335 .EX
336 fvwm-menu-desktop --regen-cmd XDGRegen > $FVWM_USERDIR/.XDGMenu
337 .EE
338 .RE
339
340 Then add the following to the fvwm config file to define the function
341 XDGRegen. The second to last line will generate the menu if the menu
342 file doesn't exist when fvwm starts.
343
344 .RS
345 .EX
346 DestroyFunc XDGRegen
347 AddToFunc XDGRegen
348 + I PipeRead 'fvwm-menu-desktop --regen-cmd XDGRegen > \\
349 $[FVWM_USERDIR]/.XDGMenu; echo "Nop"'
350 + I Read $[FVWM_USERDIR]/.XDGMenu
351
352 Test (!f $[FVWM_USERDIR]/.XDGMenu) XDGRegen
353 Read $[FVWM_USERDIR]/.XDGMenu
354 .EE
355 .RE
356
357 Besides creating a top level menu, \fBfvwm-menu-desktop\fR can insert the
358 menu into an existing menu using the \fB--insert-in-menu\fR option. For example
359 one could create the menu MenuFvwmRoot and include the XDG items at the end.
360
361 .RS
362 .EX
363 DestroyMenu MenuFvwmRoot
364 AddToMenu MenuFvwmRoot "Fvwm" Title
365 + "Item1" Action1
366 ...
367 + "ItemN" ActionN
368 + "" Nop
369 PipeRead 'fvwm-menu-desktop --insert-in-menu MenuFvwmRoot'
370 .EE
371 .RE
372
373 In this case the menu items are inserted at the end of the MenuFvwmRoot menu.
374 If no items are in the menu, this menu becomes MenuFvwmRoot. The problem
375 here is, that you have to restart fvwm or rebuild the whole menu
376 to Regenerate it because menu items cannot be removed.
377 To do this you could use a function like
378
379 .RS
380 .EX
381 DestroyFunc XDGRegen
382 AddToFunc XDGRegen
383 + I DestroyMenu MenuFvwmRoot
384 + I AddToMenu MenuFvwmRoot "Fvwm" Title
385 + I AddToMenu MenuFvwmRoot "Item1" Action1
386 ...
387 + I AddToMenu MenuFvwmRoot "ItemN" ActionN
388 + I AddToMenu MenuFvwmRoot "" Nop
389 + I PipeRead 'fvwm-menu-desktop --insert-in-menu MenuFvwmRoot \\
390 --regen-cmd XDGRegen'
391 .EE
392 .RE
393
394 Fvwm can also create menus dynamically by using \fBDynamicPopUpAction\fR
395 and/or \fBDynamicPopDownAction\fR. These commands when used with a Menu
396 will run a Function when the menu is opened. For example one could
397 create the menu XDGMenu when it is opened using
398
399 .RS
400 .EX
401 AddToMenu XDGMenu "XDGMenu" Title
402 + DynamicPopUpAction PipeRead 'fvwm-menu-desktop'
403 .EE
404 .RE
405
406 This will create the menu when it is opened. One issue here is it will only
407 create the menu the first time it is opened, and you still have to
408 Regenerate the menu to see any changes. To create the menu each time it
409 is open used the \fB--dynamic\fR option
410
411 .RS
412 .EX
413 AddToMenu XDGMenu "XDGMenu" Title
414 + DynamicPopUpAction PipeRead 'fvwm-menu-desktop \\
415 --dynamic --include-items config'
416 + DynamicPopDownAction DestroyMenu recreate XDGMenu
417 .EE
418 .RE
419
420 This will now Destroy the menu when it closed so it can be rebuilt the
421 next time it is opened. The recreate flag doesn't completely destroy
422 the menu keeping the DynamicPopUpAction and DynamicPopDownAction actions.
423 The \fB--dynamic\fR flag includes the recreate option in the generated menus.
424
425 To insert a menu into MenuFvwmRoot and still be dynamic you need to use
426 a function that generates the whole menu. For example
427
428 .RS
429 .EX
430 DestroyFunc GenRootMenu
431 AddToFunc GenRootMenu
432 + I DestroyMenu recreate MenuFvwmRoot
433 + I AddToMenu MenuFvwmRoot "Fvwm" Title
434 + I AddToMenu MenuFvwmRoot "Item1" Action1
435 ...
436 + I AddToMenu MenuFvwmRoot "ItemN" ActionN
437 + I AddToMenu MenuFvwmRoot "" Nop
438 + PipeRead `fvwm-menu-desktop --insert-in-menu MenuFvwmRoot \\
439 --include-items config`
440
441 AddToMenu MenuFvwmRoot "Fvwm" Title
442 + DynamicPopUpAction GenRootMenu
443 + DynamicPopDownAction DestroyMenu recreate MenuFvwmRoot
444 .EE
445 .RE
446
447 .SH BUGS
448 The whole process of creating menus from files is slow.
449 Otherwise report bugs to the
450 fvwm-workers mailing list <[email protected]>.
451
452
453 .SH AUTHORS
454 This script is based on fvwm-xdg-menu.py written by Piotr Zielinski
455 (http://www.cl.cam.ac.uk/~pz215/) who assigned Licence: GPL 2 Date:
456 03.12.2005.
457
458 The script was reworked to replace the existing fvwm-menu-desktop perl
459 script by the fvwm-workers.
460
461
462 .SH COPYING
463 The script is distributed by the same terms as fvwm itself. See GNU
464 General Public License for details.