Debian Menu System - Menu from the viewpoint of a user

[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ next ]

# Debian Menu System
Chapter 2 - Menu from the viewpoint of a user

## 2.1 How/when do the window manager startup files get created?

Basically, users don't need to know any of how and when the startup files are created, but they might be interested to know anyway.

When a package that wants to add something to the menu tree gets installed, it will run `update-menus` in its `postinst` script. Update-menus then reads in all menu files in `/etc/menu/`, `/usr/lib/menu`, `/usr/share/menu` and `/usr/share/menu/default`, and stores the menu entries of all installed packages in memory. Once that has been done, it will run the menu-methods in `/etc/menu-methods/*`, and pipe the information about the menu entries to the menu-methods on stdout, so that the menu-methods can read this. Each window-manager or other program that wants to have the Debian menu tree, will supply a menu-method script in `/etc/menu-methods/`. This menu-method then knows how to generate the startup-file for that window manager. To facilitate this task for the window-manager maintainers, menu provides a `install-menu` program. This program can generate the startupfiles for just about every window manager.

## 2.2 Tuning of the generated window manager startup files

In principle this is a very window-manager specific business. But for all window managers (and others) applies:

The file to attack is the menu-method in `/etc/menu-methods/$wm`, with `$wm` the name of your window manager. However, if this menu-method `!include`-s the `menu.h` file (as it should), you can also edit that file, to make your changes work for every installed window manager.

If the menu-method file of your window manager does `!include` the `menu.h` file, and makes proper use of the definitions in there, then you can look at the comments in that `menu.h` file to see how you can make minor adjustments to the look of your menus in your window manager.

To generally change the menu tree, see the next section.

## 2.3 Optimization of menu tree: hints

If `hint_optimize=true` has been set in a menu-method script (actually, that definition should appear in the `!include`-ed `menu.h` file), then install-menu will try to alter the menu tree, to make every submenu have about the optimum number of menu entries (as specified by `hints_nentry=...`). It will do that by removing under-full submenus (only if the `parent' of that submenu isn't itself already overfull), and by possibly creating new submenus, using hints. Note, however, that the optimization of the tree takes in principle exponential time, so menu speeds up the process, at the expense of occasionally not finding the best tree. So, the tree you are presented with may not be optimal. For tuning variables, see the hint_* variables in the last chapter.

[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ next ]

Debian Menu System