#!/usr/bin/install-menu
#
# debian menu method for the fvwm-crystal desktop environment
# Author: Michael Stilkerich <ms@mike2k.de>
# Modified by Vincent Bernat <bernat@debian.org>
#
compat="menu-1"

!include menu.h

compat="menu-2"

outputencoding="LOCALE";

supported;
  x11=  "x11|*|" $command "|*|" title() "|*|" $basesection "|*|" icon() "\n";
  text= "text|*|" $command "|*|" title() "|*|" $basesection "|*|" icon() "\n";
endsupported;

# generate a file name in the fvwm-crystal appdb format.
# do nothing for sections
genmenu=ifeqelse($needs, "", "", "fvwm-crystal.debian-menu");
startmenu="";
endmenu="";

# the root of the menu is debian
rootsection="/debian";
rootprefix="/var/lib/fvwm-crystal/Applications";

# runnable as user, but will exit with error if debian Application subdir not
# writeable (masked out by user)
userprefix=".fvwm/Applications");

treewalk="M";

# remove the whole Debian menu and rebuild from scratch
prerun="rm -rf " prefix() rootsection();

# all menu files must be executable to show up in the menu
postrun="python3 /usr/share/fvwm-crystal/debian/createmenu.py --install " prefix();

# executed upon update-menus --remove
removemenu="python3 /usr/share/fvwm-crystal/debian/createmenu.py --remove " prefix();
