#!/usr/sbin/install-menu
#
# Generates fluxbox menus for all registered applications.
# (taken from Blackbox)
compat="menu-1"

!include menu.h

genmenu="menudefs.hook"
examplercfile="system.menu.xml"
rcfile="notforuse.xml"
rootprefix="/etc/X11/xfce4/"
userprefix=".xfce4/"
preoutput="<!-- Automatically generated file. Do not edit (see /usr/share/doc/menu/html/index.html) -->\n"
treewalk=M)

function charreplace($str,$toreplace,$with,$lastchar)=replacewith(escwith($str,$toreplace,$with),$toreplace,$lastchar)
function xmlesc($str)= charreplace(charreplace(charreplace(replacewith(charreplace($str, \
  "&","amp",";"),"","&"), \
  "\"","&quot",";"), \
  "<","&lt",";"), \
  ">","&gt",";")

supported
    x11=   nstring(level(), "   ") "<app name=\"" xmlesc(title()) "\" cmd=\"" xmlesc($command) "\"/>\n" 
    text=  nstring(level(), "   ") "<app name=\"" xmlesc(title()) "\" cmd=\""xmlesc($command) "\" term=\"yes\" />\n"
    xfce4= nstring(level(), "   ") "<builtin name=\"" xmlesc(title()) "\" cmd=\"" xmlesc($command) "\"/>\n"
endsupported

startmenu= ""
submenutitle= nstring(level(), "   ") "<menu name=\"" xmlesc(title()) "\" visible=\"yes\">\n"
endmenu= ifneq( level(), "0",  nstring(level(), "   ") "</menu>\n" )
