(menu.info)Section 7.2


Next: Section 7.3 Prev: Section 7.1 Up: Chapter 7
Enter node , (file) or (file)node

7.2 The install-menu program
============================

The files '/etc/menu-methods/$wm' are executable config files that start
with the line

       #!/usr/bin/install-menu

and thus start that program, handing it the configuration file for the
specific window manager in the first command line argument.  This
configuration consists of:

  1. the compatibility mode ("menu-1" or "menu-2").

  2. where the various files should be stored/read.

  3. what "needs" are supported, and what wrapper files should be used
     for each "type".

  4. how to remove the generated menu files.

See '/usr/share/doc/menu/examples/' of the menu package for more
comments.

Options to 'install-menu':

       --remove  Remove the menu files instead of generating them.
       --verbose Output outline of operations that are performed.

Some window managers don't support an 'include'-like statement in their
'system.*rc' files (like 'm4' or 'cpp' preprocessing); they cannot read
the 'menudefs.hook' file generated by install-menu from their
'system.*rc' config file.  To still be able to use them, 'install-menu'
will copy the file '$path/$examplercfile' to '$path/$rcfile' (with
'$examplercfile' and '$rcfile' defined in the 'install-menu' config
file, and '$path' either the '$rootprefix' or '${HOME}/$userprefix',
depending on whether root or user executed the file.), and replace all
occurrences of "install-menu-defs" with the '$genmenu' file it just
generated.

As an example, consider the following:
'examplercfile=system.foo-wm-example', 'rcfile=system.foo-wm',
'genmenu=menudefs.hook' and 'rootprefix=/var/lib/foo-wm/menu'.  Now, if
'install-menu' gets run, it will first generate the file
'/var/lib/foo-wm/menu/menudefs.hook'.  Next, it will line-by-line read
the file '/var/lib/foo-wm/menu/system.foo-wm-example' and copy its
contents to '/var/lib/foo-wm/menu/system.foo-wm', replacing every
occurrence of the string 'install-menu-defs' with the contents of the
file '/var/lib/foo-wm/menu/menudefs.hook'.

To activate the file copying in this way, simply define the
'$examplercfile' and '$rcfile' variables in the 'install-menu'
configuration file (for example, see '/etc/menu-methods/fvwm'), and make
sure there is a '$path/$examplercfile' ('$path' being either
'$rootprefix', or '$userprefix'.)

If you are writing a menu method, you can use the following to make
debugging it somewhat more easily:

  1. use 'update-menus --stdout > /tmp/menu-stdin' to create a list of
     menu entries in '/tmp/menu-stdin' and then

  2. you can run just your menu-method with (if it's called wm):

            ./wm -v < /tmp/menu-stdin


automatically generated by info2www version 1.2.2.9