#!/usr/sbin/install-menu
#
# Generates Openbox menus for all registered applications.
# copyright (c) Nick S. Grechukh
# this program is under GPL

compat="menu-1"

!include menu.h

rootprefix="/etc/X11/xdg/openbox"
userprefix=".config/openbox"
genmenu="menu.hook.xml"
examplercfile="menu-template"
rcfile="menu.xml"

treewalk=c(m)
rootsection="ALTLinux"

function ltitle()=translate(lang(),title())
sort=ifelse($command, "1", "0") ltitle()

supported
##    x11=   nstring(level(), "   ") "<item label=\"" ltitle() "\">\n" nstring(level(), "   ") "<execute>xterm -T \"" esc(ltitle(), "()") "\" -e " esc($command, "()") "</execute></action>\n</item>\n"
##    wm=   nstring(level(), "   ") "<item label=\"" ltitle() "\">\n" nstring(level(), "   ") <execute>" esc($command, "()") "</execute></action>\n</item>\n"
    x11=  "    " "<item label=\"" ltitle() "\">\n" "        " "<action name=\"Execute\"><execute>" esc($command, "()") "</execute></action>\n" "    " "</item>\n"
    text= "    " "<item label=\"" ltitle() "\">\n" "        " "<action name=\"Execute\"><execute>xterm -T \"" esc(ltitle(), "()") "\" -e " esc($command, "()") "</execute></action>\n" "    " "</item>\n"
#    wm=	   nstring(level(), "   ") "[restart] ("  esc(ltitle(), "()")  ")  {" esc($command, "()") "}\n" 
###    fluxbox= nstring(level(), "   ") "[" esc($command, "()") "] (" esc(ltitle(), "()") ")\n"
endsupported

preoutput= "<!-- this is autogenerated file. Do not edit it. edit menu-template, please, or maybe menu-method :-) -->"
postoutput= "<!-- end of autogenerated part -->"

startmenu= "<menu id=\"" replacewith($section,"/","/") "\" label=\"" ltitle() "\">\n"
submenutitle= "    " "<menu id=\"" replacewith($section,"/","/") "\" />\n"
endmenu= "</menu>\n"

