The Debian Project

previous | Contents | 1 | 2 | 3 | 4 | 5 | | 7 | 8 | 9 | next

The Debian Maintenance HOWTO
Chapter 6 - Menus

Debian (or Joost Witteveen to be precise) has developed a mechanism that enables packages to update the system menu for every windowmanager. This even works for KDE and GNOME. You'll find a detailed description by Joost in /usr/doc/menu/.

As an administrator you are free to add new items to the menu that will automatically appear in all menus. Menu files that are shipped together with the installed packages are put into /usr/lib/menu. To add new items to the menu system, just copy one file from there to /etc/menu, edit it and run the program update-menus. This will update all menu files in question.

This even works on a per user basis. As user you need to copy such a menu file to ˜/.menu, edit it and then run update-menus.

6.1 Menu files

A menu file is a plain text file (did you expect anything else?). It is edited with any editor you want to use. A menu file is only processed in the way that a new menu item appears in the Debian menu if the referring package is installed as well. This is done by the statement ?package(pkg) where pkg is the name of the package that has to be installed for this menu item to be generated.

For example, if you want to provide a new system aumix call, this item should only be generated if aumix is available which means that the package aumix has to be installed. In this case you would write ?package(aumix) at the top of the menu entry. You can divert your menu entries to be available under X11 only, under any real virtual text console or using a text console (i.e. xterm). You have to add :needs=vc if the program requires a text console, :needs=x11 if the program requires X11 and :needs=text if the program only requires a text terminal, which can be an xterm as well.

Below please find a comprehensive example that makes use of this technique.

       ?package(aumix):needs=vc section=Apps/Sound title="aumix"\
     	  longtitle="aumix audio mixer" command="/usr/bin/aumix"
       ?package(aumix):needs=x11 section=Apps/Sound title="aumix"\
           icon=/usr/X11R6/include/X11/pixmaps/aumix.xpm\
     	  longtitle="aumix audio mixer" command="/usr/X11R6/bin/xaumix"

The Debian Maintenance HOWTO

November 23rd, 2014

Joey Schulze, joey@infodrom.org