1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
#!/usr/bin/install-menu
!include menu.h
compat="menu-2";
outputencoding="LOCALE";
treewalk="c(m)";
rootprefix="/var/lib/e16/";
userprefix=".e16/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() " | sh; rm -f " menu_sh();
function quote($text)= "\"" replacewith($text,"\"","'") "\"";
function tick($text)= "'" escwith($text,"'", "'\\'") "'";
function space()= " ";
function newline()="\n";
function entry($com)= quote(title()) space()
ifelse(icon(),quote(icon()),"NULL") space()
"exec" space()
$com;
supported;
wm= entry(quote("eesh -e " tick("exit exec " $command)) newline());
x11= entry(quote($command) newline());
text= entry(quote(term()) newline());
endsupported;
function etitle()= esc(tolower(replacewith(replace("/" $section,"//",""),"/ ","__") ".menu"),"()");
startmenu= "cat > " prefix() tick(etitle()) " << 'END'" newline() quote(title()) newline();
endmenu= "END" newline() newline();
submenutitle=quote(title()) " NULL menu " quote(prefix() etitle()) "\n";
genmenu="debian_menu_sh";
|