1fvwm-menu-desktop(1) Fvwm Modules fvwm-menu-desktop(1)
2
3
4
6 fvwm-menu-desktop - builds GNOME and KDE menus and style commands for
7 fvwm
8
9
11 fvwm-menu-desktop [ --help|-h|-? ] [ --version|-v|-V ] [ --install-pre‐
12 fix DIR ] [ --desktop NAME ] [ --type NAME ] [ --fvwmgtk-alias NAME ] [
13 --title NAME ] [ --name NAME ] [ --merge-user-menu ] [
14 --enable-mini-icons ] [ --enable-tran-mini-icons ] [ --mini-icons-path
15 DIR ] [ --png-icons-path DIR ] [ --tran-mini-icons-path DIR ] [
16 --check-mini-icons PATH ] [ --icon-toptitle
17 micon:law:place:side_pic:color ] [ --icon-title
18 micon:law:place:side_pic:color ] [ --icon-folder micon:law:place ] [
19 --icon-app micon:law:place ] [ --wm-icons ] [ --enable-style ] [
20 --enable-tran-style ] [ --icon-style micon:icon:law ] [ --icons-path
21 DIR ] [ --tran-icons-path DIR ] [ --check-icons PATH ] [ --sub‐
22 menu-name-prefix name ] [ --dir DIR ] [ --destroy-type FLAG ] [ --xterm
23 CMD ] [ --lang NAME ] [ --utf8 ] [ --uniconv charset ] [ --uniconv-exec
24 exec ] [ --menu-style name ] [ --no-check-app ] [ --time-limit NUM ]
25
26
28 This is a perl script which parses GNOME or KDE menus definitions to
29 build corresponding fvwm or FvwmGtk menus. The script can also build
30 icon and mini-icon style commands for the applications.
31
32
34 There are a lot of options. However the defaults are, I hope, good
35 enough. If you want the KDE system menu in the menu "Utilities" add
36 the following lines in your .fvwm2rc file:
37 ...
38 AddToMenu Utilities "KDE System Menu" Popup kde-sys
39 ...
40 PipeRead 'fvwm-menu-desktop --desktop kde-sys'
41 For KDE2 you may have to add --utf8 or --uniconv "charset" (see below).
42 Moreover, with KDE2 you can add --merge-user-menu. If you use KDE ver‐
43 sion 1 (see below for KDE2) and you want mini-icons in the menu and if
44 the KDE mini-icons are in "mini/" relative to your fvwm ImagePath add
45 the option --enable-mini-icons. (if the KDE mini-icons are in some
46 other place use the --mini-icons-path option, e.g., they are in your
47 ImagePath plus --mini-icons-path). If you want to build Icon and Mini‐
48 Icon style commands for KDE applications, add the option --enable-
49 style. If you want to have the KDE user menu replace "sys" by "user".
50 If you use the KDE menu editor, you may want to pop this menu up dynam‐
51 ically. Then, put this into your .fvwm2rc file (note the destroy-
52 type).
53 AddToMenu Utilities "KDE User Menu" Popup kde-user
54 ...
55 AddToMenu kde-user
56 + DynamicPopupAction PipeRead 'fvwm-menu-desktop --desktop kde-user --enable-mini-icons [--destroy-type dynamic] [other options]'
57
58 For GNOME it is natural to use FvwmGtk menus. The following example
59 builds "all" GNOME menus (with some mini-icons in the system menu). You
60 need to specify the GNOME installation prefix if it is not /usr (with
61 the option --install-prefix). Moreover, the GNOME icons need to be in
62 your ImagePath and the non .png mini-icons you use for the user-menu
63 need to be in mini/ (if not, use the --png-icons-path option and the
64 --mini-icons-path option, respectively).
65
66 Module FvwmGtk
67 *FvwmGtk: Destroy gnome-all
68 *FvwmGtk: Menu gnome-all
69 *FvwmGtk: Title "Gnome Menus"
70 *FvwmGtk: Separator
71 *FvwmGtk: Destroy gnome-sys
72 *FvwmGtk: Submenu "System" gnome-sys
73 *FvwmGtk: Destroy gnome-user
74 *FvwmGtk: Submenu "User" gnome-user
75 *FvwmGtk: Destroy gnome-redhat
76 *FvwmGtk: Submenu "RedHat" gnome-redhat
77
78 PipeRead 'fvwm-menu-desktop --type gtk --enable-mini-icons --icon-folder :re --icon-app :re --icon-title :re --icon-toptitle :re'
79
80 PipeRead 'fvwm-menu-desktop --type gtk --desktop gnome-user --enable-mini-icons'
81
82 PipeRead 'fvwm-menu-desktop --type gtk --desktop gnome-redhat --enable-mini-icons'
83
84 # To obtain the menu above with Alt-button1 on the root window
85 Mouse 1 R M SendToModule FvwmGtk gnome-all
86
87 You can specify FvwmGtk alias: Module FvwmGtk MyGnomeMenu. In this
88 case you must pass an additional parameter to fvwm-menu-desktop:
89 --fvwmgtk-alias MyGnomeMenu.
90
91 Of course you can build fvwm (i.e., no FvwmGtk) GNOME menus. GNOME and
92 KDE2 use PNG icons which are not supported by fvwm menu. However, if
93 you have XPM version of the GNOME or of the KDE2 (mini-)icons you can
94 build fvwm menus and style commands with these icons using the option
95 --enable-tran-mini-icons and --enable-tran-style. The Fvwm Themes pack‐
96 age (http://fvwm-themes.sourceforge.net/) contains an utility, fvwm-
97 themes-images, which can convert automatically (with the help of
98 ImageMagick) all GNOME and KDE2 icons to XPM icons.
99
100 You can build sub menus using the --dir options. However, if you want
101 to use more than one submenu it is better to build the "all" menu and
102 to use the submenu names. See the option --submenu-name-prefix for
103 information on submenu names. Nevertheless, you may put the menu in a
104 tmp file using redirection to see the submenu names.
105
106 If you think that fvwm-menu-desktop slows your startup too much do not
107 use PipeRead. Instead run fvwm-menu-desktop and redirect the menu to
108 a file and Read that file in your .fvwm2rc file. Another possibility
109 is to use DynamicPopupAction (with fvwm menu), the menu (and the
110 styles) will be built only if you pop up the menu. The following menu
111 creates a "kde-all" menu which contains the user menu which is built
112 each time you pop up "kde-all" and contains a pop up to the system menu
113 which is built only the first time you pop it up.
114 AddToMenu kde-all
115 + DynamicPopupAction FuncRecreateKdeAll
116
117 AddToMenu kde-sys
118 + DynamicPopupAction PipeRead 'fvwm-menu-desktop \
119 --desktop kde-sys [options, but --destroy-type d* or n*]'
120
121 AddToFunc FuncRecreateKdeAll \
122 I PipeRead 'fvwm-menu-desktop \
123 --desktop kde-user --enable-mini-icons --name kde-all \
124 --destroy-type dynamic [options you like]'
125 + I AddToMenu "kde-all" "" Nop
126 + I AddToMenu "kde-all" "Kde System%mini/mini-k.xpm%" Popup kde-sys
127
128 fvwm-menu-desktop takes into account your $LANG environment variable,
129 which may be overwritten using the --lang option.
130
131 Hint, if you need a different menu font or item format from the ones
132 used in the default MenuStyle, you may use the --menus-style option to
133 assign a non-default MenuStyle name to menus built by this script.
134 Don't forget to create a new menu style in your .fvwm2rc, using Copy‐
135 MenuStyle and MenuStyle commands.
136
137
139 Main Options
140
141
142 --help Show the help and exit.
143
144 --version
145 Show the version and exit.
146
147 --install-prefix DIR
148 The prefix of GNOME or KDE installation. Default is /usr for
149 GNOME (other common prefixes: /usr/local, /opt/gnome). For KDE
150 the default is $KDEDIR and you probably do not need to use this
151 option.
152
153 --desktop NAME
154 Use gnome-sys for the GNOME system menu (this is the default),
155 gnome-user for the GNOME user menu, gnome-redhat for the Anoth‐
156 erLevel menu of Red Hat, gnome-mandriva for Mandriva menudrake
157 menus, kde-sys for the KDE system menu and kde-user for the KDE
158 user menu. It may be useful to use KDE or GNOME as a flag with
159 the --dir option.
160
161 --type NAME
162 If NAME is fvwm, a native fvwm menu will be built (this is the
163 default). If NAME is gtk, a FvwmGtk menu will be built.
164
165 --fvwmgtk-alias NAME
166 The name for then FvwmGtk module to use instead of default
167 FvwmGtk.
168
169 --title NAME
170 Define the menu title of the top menu. Default is "Gnome System
171 Menu" for gnome-sys, "Gnome User Menu" for gnome-user, "Gnome
172 Red Hat Menu" for gnome-redhat, "Gnome Mandriva Menu" for
173 gnome-mandriva. For KDE the default is given by KDE itself (or
174 are similar to GNOME title).
175
176 --name NAME
177 Define the menu name of the top menu. Default is the --desktop
178 name if you use one above.
179
180 --merge-user-menu
181 this option tries to merge the user menu with the system menu
182 (gnome-sys or kde-sys, based on the --desktop option) and takes
183 into account changes to the system menu that it is now possible
184 to do in the "user directory" (at least with KDE version 2 menu
185 editor).
186
187
188
189 Icons Options
190
191 By default, fvwm-menu-desktop builds mini-icon free menus. To
192 enable mini-icons use one of the two following options.
193
194
195 --enable-mini-icons
196 This option enables mini-icons in the menu. The desktop hints
197 are used if it is possible (fvwm menu can't use .png icons). Use
198 the --mini-icons-path and the --png-icons-path to specify the
199 good paths. By using the --icon-* options below you can control
200 mini-icons in menus.
201
202 --enable-tran-mini-icons
203 This option applies only to fvwm menus and is useful to build
204 GNOME or KDE2 menus with mini-icons (and if you have XPM version
205 of the GNOME or KDE2 PNG icons). If this option is used any
206 icon hint foo.png is translated to path/foo.xpm where path is
207 determined by the --tran-mini-icons-path option (xpm icons are
208 used as with the previous option).
209
210 --mini-icons-path DIR
211 Define the directory of the .xpm mini-icons (relative to your
212 ImagePath). Default is "mini/".
213
214 --png-icons-path DIR
215 Define the directory of .png icons. Default is "" (i.e., in your
216 ImagePath). Useful only with FvwmGtk menus.
217
218 --tran-mini-icons-path DIR
219 Define the directory of the mini-icons for the
220 --enable-tran-mini-icons option. Default is mini/. It is prefer‐
221 able to give the complete path so that fvwm-menu-desktop can
222 check if the translated mini-icons exists (and the "re" law will
223 apply in a good way).
224
225 --check-mini-icons PATH
226 Where PATH is a list of directories with ":" as a separator.
227 Then, fvwm-menu-desktop checks that the mini icons actually
228 exist in one of these directories (this check is not done for
229 the translated mini icons).
230
231
232 Comments
233
234 To control mini-icons in menus you can use the 4 following
235 options which work similarly.
236
237 In these options law may be no, dh, re or ow. no means "do not
238 use mini-icon" (this does not affect side pic). dh means "use
239 only the mini-icons GNOME/KDE hints". re means "use mini-icons
240 GNOME/KDE hints but if it is empty use the specified mini-icon".
241 ow means "override the mini-icons GNOME/KDE hints by the speci‐
242 fied mini-icon".
243
244 The path to the specified icons is given by the options
245 --mini-icons-path, --png-icons-path or --tran-mini-icons-path
246 (i.e., you just have to specify the icon, the path is computed).
247 For the sidepic you need to give the complete relative path from
248 your ImagePath.
249
250 Note that for the fvwm menu (without the
251 --enable-tran-mini-icons option) a .png icon hint is considered
252 as an empty hint, so for the system menu use no=dh and re=ow
253 (you may use .xpm icons in a user menu). If the
254 --tran-mini-icons-path option is set with a complete path, then
255 if the .xpm icon which corresponds to a .png icon hint does not
256 exist, the icon hint is considered as empty.
257
258
259 place, sidepic and color apply only with fvwm menus. place is
260 either left or up. left means that the icon will be placed on
261 the left of the label. up means that the icon will be placed
262 above the label. sidepic needs to be nothing or an icon (for a
263 picture in the bottom left of the menu). color applies only if a
264 sidepic icon is given and it is the color for the region of the
265 menu containing the sidepic picture.
266
267 When you use an option below, if an icon, a law ...etc is not
268 specified (i.e., empty) the default is used (e.g, if you want,
269 for an fvwm menu, the icon folder.xpm on the left of the top
270 title and the sidepic fvwm2.xpm on the left of this menu use the
271 following: --icon-toptitle :ow::fvwm2.xpm).
272
273
274 --icon-toptitle micon:law:place:sidepic:color
275 Mini-icon for the top title and sidepic for the top menu.
276 Default for fvwm menus: folder.xpm:no:left::. Default for fvwm
277 menus with --enable-tran-mini-icons: gnome-logo-icon-transpar‐
278 ent.xpm:no:left:. Default for gtk menus: gnome-logo-icon-trans‐
279 parent.png:no.
280
281 --icon-title micon:law:place:sidepic:color
282 Use the option below for submenus. Default for fvwm menus:
283 folder.xpm:dh:left::. Default for fvwm menus with
284 --enable-tran-mini-icons: gnome-folder.xpm:dh:left::. Default
285 for gtk menus: gnome-folder.png:dh
286
287 --icon-folder micon:law:place:sidepic:color
288 Mini-icons for pop up item. Default for fvwm menus:
289 folder.xpm:dh:left. Default for fvwm menus with
290 --enable-tran-mini-icons: gnome-folder.xpm:dh:left. Default for
291 gtk menus: gnome-folder.png:dh.
292
293 --icon-app micon:law:place
294 Mini-icon for applications item. Default for fvwm menus:
295 mini-x.xpm:dh. Default for fvwm menus with
296 --enable-tran-mini-icons: gnome-default.xpm:dh. Default for gtk
297 menus: gnome-default.png:dh
298
299
300 --wm-icons
301 This is a shortcut, which can be used if you plan to use icons
302 from the wm-icons package. Currently this is equivalent to:
303 --enable-mini-icons --mini-icons-path '' --icon-toptitle
304 menu/folder-open.xpm:ow --icon-title menu/folder-open.xpm:ow
305 --icon-folder menu/folder.xpm:ow --icon-app menu/utility.xpm:ow.
306
307
308 Style Options
309
310
311 --enable-style mini-icon:icon:law:addstyle
312 Build icons and mini-icons style commands for the applications
313 in the built menu.
314
315 --style-tran
316 Only useful with FvwmGtk GNOME or KDE2 menus. Make translation
317 as the enable-tran-mini-icon option but only for style (not for
318 mini-icons menus).
319
320 --icon-style mini-icon:icon:law:addstyle
321 This option is similar to the options --icon-* above. Default
322 law is "dh" (there is no "no" law). Default mini-icon is
323 mini-x.xpm and default icon is x.xpm. You can add a style to all
324 applications with addstyle. If you use the enable-tran-mini-icon
325 options the translated (mini-)icons will be used (if translation
326 is needed) and the default icons are gnome-default.xpm. If you
327 use the --enable-tran-style options above the default icons are
328 gnome-default.xpm. The paths to mini-icons are the same as
329 those for the menus. The path to the icons is computed from the
330 mini-icons path: they are one directory up to the corresponding
331 mini-icons path (so the "defaults" are "" and this is consistent
332 with KDE1 and XPM icons builded by fvwm-themes-images).
333
334 --icons-path DIR
335 Not useful in a normal situation. Define the directory of the
336 icons. Default is one directory up from the path given by the
337 --mini-icons-path option. To set the path to "" you need to use
338 "inpath".
339
340 --tran-icons-path DIR
341 Similar to the above option.
342
343 --check-icons PATH
344 Where PATH is a list of directories with ":" as a separator.
345 Then, fvwm-menu-desktop checks that the icons actually exist in
346 one of these directories (this chack is not done for the trans‐
347 lated icons, use a full path in --tran-icons-path to do so).
348
349
350 Other Options
351
352
353 --submenu-name-prefix NAME
354 May be useful in some unfortunate cases. By default the name of
355 a sub menu is of the form prefix-adirname-level where prefix is
356 the desktop flag, adirname is the name of the directory of the
357 description of the sub menus (not a complete path) and where
358 level is an integer equal to the number of "cd"s you need to do
359 to go from the root to the directory of the description of the
360 sub menus. You may change the prefix using the present option.
361
362 --dir DIR
363 Set the directory where fvwm-menu-desktop looks for a GNOME/KDE
364 menu description to DIR. The name of the menu is 'desktop-name'
365 and the title is 'desktop' name where 'desktop' is either GNOME
366 or KDE (if fvwm-menu-desktop can't find which desktop is con‐
367 cerned, you can help with the --desktop option) and where 'name'
368 is the name of the right directory of DIR (or a hint of the
369 desktop for the title). Note that if this option is not set,
370 the description directory is install-prefix/share/gnome/apps if
371 --desktop is gnome-sys, $HOME/.gnome/apps if --desktop is
372 gnome-user, $HOME/.gnome/apps-redhat if --desktop is gnome-red‐
373 hat, $HOME/.gnome/apps-mdk if --desktop is gnome-mandriva,
374 $KDEDIR/share/applink if --desktop is kde-sys and
375 $HOME/.kde/share/applnk if--desktop is sys-user.
376
377 --destroy-type flag
378 flag may be "y(es)", "no", "d(ynamic)". Default is "yes" with
379 fvwm menus, "no" with FvwmGtk menus and dynamic applies only
380 with fvwm menus. If "yes" is used the top menu will be
381 destroyed (DestroyMenu "name"), if "no" is used the top menu
382 will not be destroyed (useful for FvwmGtk menus called by
383 another menu via FvwmGtkSubMenu or to give the same name to two
384 or more menus built by fvwm-menu-desktop). If dynamic is used
385 the menu will be destroyed/recreated (may be useful with Dynam‐
386 icPopupAction). Note that all the built sub menus are always
387 destroyed.
388
389 --xterm CMD
390 Define complete X terminal command to run applications in it if
391 needed. Default is 'xterm -e'.
392
393 --lang NAME
394 Default is the value of $LANG. Useful if your language is not
395 GNOME/KDE compliant and you prefer a non-English compliant lan‐
396 guage. Also useful if fvwm-menu-desktop gives bad result with
397 your language.
398
399 --utf8 Assume that the desktop entries used UTF-8 encoding. This is the
400 case with KDE version 2 and will be probably the case with GNOME
401 version 2. At the present time this option work only if you
402 have perl version 5.6 or better and if your language use latin-1
403 font. If one of these conditions is not satisfied, then this
404 option is equivalent to --lang en. For other languages/charsets
405 use the --uniconv option. The advantage of this option as com‐
406 pared to the following option is that it is fast.
407
408 --uniconv charset
409 Use iconv, uniconv or internal method to translate utf8 desktop
410 entries into an appropriate "charset". You can choose between
411 one of the supported tools using --uniconv-exec option. iconv
412 comes with glibc >= 2.1.1 and uniconv comes with the utf8 editor
413 yudit. Type "iconv --list" or "man uniconv" for the list of sup‐
414 ported charsets. Of course you must also use the appropriate
415 font using the MenuStyle command. Also, $LANG (or --lang xx)
416 must be compatible with the charset. Note, if you don't use an
417 internal method, fvwm-menu-desktop is very slow with this
418 option: you probably need to use the --time-limit option and you
419 should redirect the result into a file and read this file in
420 your fvwm configuration.
421
422 --uniconv-exec exec
423 Where exec is either iconv or uniconv or internal. Allows to
424 choose the program which perform the UTF8 translation in the
425 case of the --uniconv option. The internal method is only avail‐
426 able with perl 5.8.0 and better. The default is either internal
427 (if available) or iconv.
428
429 --menu-style name
430 By default the generated fvwm menus use the default MenuStyle
431 (i.e., the MenuStyle "*"). You can specify another MenuStyle
432 name using this option.
433
434 --[no]check-app
435 Either check or don't check that applications to execute are in
436 your path. Default is --check-app.
437
438 --time-limit NUM
439 Change the internal limit (15 seconds) for running this script
440 to NUM seconds, 0 means unlimited running. This limiting may be
441 useful to cut mistakes with the --dir or --install-path options.
442
443
445 This script needs more testing to see if all options work well (note
446 that the script does not check for inconsistency of the given options).
447 If Desktop menu hints are changed the script may not work as expected.
448 I have tested the script with gnome-core-1.0.3, kde-1.1, kde-1.2 and
449 kde-2.0.
450
451
453 Olivier Chapuis <olivier.chapuis@free.fr>
454
455 Mikhael Goikhman <migo@homemail.com> - some changes
456
457
459 The script is distributed by the same terms as fvwm itself. See GNU
460 General Public License for details.
461
462
463
4643rd Berkeley Distribution 24 November 2007 (2.5.24) fvwm-menu-desktop(1)