File: e16.menu-method

package info (click to toggle)
e16 1.0.0-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 7,884 kB
  • ctags: 6,655
  • sloc: ansic: 70,548; sh: 9,928; xml: 2,606; perl: 479; makefile: 394; sed: 16
file content (42 lines) | stat: -rw-r--r-- 1,216 bytes parent folder | download | duplicates (2)
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";