/etc/menu-methods/
that can read the menu files. This script
will be executed by update-menus, which will feed the menu
entries to be installed to your script via standard input (stdin).
The scripts in /etc/menu-methods/
should be configuration
files, so the user can tune the behaviour of the script.
Good examples for these scripts of nearly all debian window managers
are included in the menu
package in
/usr/doc/menu/examples
.
Run update-menus (if it exists) in your postinst
script,
and remove the execute bit from the /etc/menu-methods/
script
in the postrm
when called with option ``remove.''
Here is an example of such a postrm
script using bash:
#!/bin/sh set -e inst=/etc/menu-methods/twm #or fvwm, ... whatever manager you're installing case "$1" in remove) chmod a-x $inst ;; purge) #remove the files that install-menu creates: rm /etc/X11/twm/{system.twmrc,menus.dat,menudefs.hook} #maybe also rm $inst, if dpkg doesn't do that itself. ;; upgrade);; *) echo "postrm called with unknown argument \`$1'" >&2 exit 0 ;; esacAnd here is a good example for a
postinst
script:
#!/bin/sh set -e inst=/etc/menu-methods/pdmenu #or fvwm, ... whatever manager you're installing if [ -x /usr/bin/update-menus ] ; then if [ -f $inst ]; then chmod a+x $inst update-menus; fi fi