#!/usr/sbin/install-menu

compat="menu-1";
!include menu.h

compat="menu-2";

onlyrunasroot=true;

# choose a terminal program here:
  function term_prog()="Eterm";
  #function term_prog()="rxvt";
  #function term_prog()="xterm";

treewalk=c(m);
rootprefix="/etc/enlightenment/menus/";
#userprefix="$HOME/.enlightenment/menus_debian/";
mainmenutitle="Debian Menu";

function menu_sh() = prefix() "debian_menu_sh";
prerun="set -e; rm -f " prefix() "debian*menu/" menu_sh();
postrun="set -e; cat " menu_sh() "| sed 's/_debian/debian/g' | sh; rm -f " menu_sh();

function quote($text)= "\"" $text "\"";
function tick($text)= "\'" $text "\'";

function space()= "   ";
function newline()="\n";

function entry($com)= quote(esc(title(),"\"")) space() 
                      quote(ifelse(icon(),icon(),"NULL")) space() 
		      quote("exec") space() 
		      $com;

function term($com)= term_prog() " -T " tick(title()) " -e " $com;

supported;
  wm=         entry(quote("eesh -e " tick("restart_wm " $command)) newline());
  x11=        entry(quote($command) newline());
  text=       entry(quote(term($command)) newline());
endsupported;

function etitle()= tolower(replacewith($section,"/","_") ".menu");

startmenu= "cat > " prefix() etitle() " << END" newline() quote(title()) newline();

endmenu= "END" newline() newline();

submenutitle="\""title()"\"  NULL   menu \"" prefix() etitle() "\"\n";

genmenu="debian_menu_sh";
