simplify WMWritePropListToFile()
[wmaker-crm.git] / debian / wmaker.menu-method
blob71158cd3cc6cacfd302f8e57fc361b39e725c287
1 #!/usr/bin/install-menu
3 # Generates Window Maker menus for all registered applications.
5 !include menu.h
6 compat="menu-1";
7 outputencoding="UTF-8"
9 genmenu="menu.hook"
10 rootprefix="/etc/X11/WindowMaker/"
11 userprefix=shell("echo -n /${GNUSTEP_USER_ROOT-GNUstep}") "/Library/WindowMaker/"
12 treewalk="(M)"
13 rootsection="/Debian"
16 function mytitle()=replacewith(title(),"\"","'")
18 function exec($action,$com)= \
19         "  \"" mytitle() "\" " ifnempty($shortcut, "SHORTCUT " $shortcut " ") $action " " esc($com,"*") "\n" 
21 supported
22 x11=    exec("SHEXEC",$command) 
23 wm=     exec("RESTART",$command) 
24 text=   exec("SHEXEC",term())
25 wmaker= exec("",$command ifnempty($arg," " $arg))
26 endsupported
28 preoutput= "/* Automatically generated file. Do not edit (see /usr/share/doc/menu/menu.txt.gz) */\n\n#include \"wmmacros\"\n"
30 mainmenutitle=""
31 submenutitle= ""
33 startmenu= "\n" \
34            ifelse( \
35                 title(), \
36                 "\"" mytitle() "\" MENU", \
37                 "Debian MENU\n\n#include <menu.prehook>" \
38            ) \
39            "\n"
40 endmenu=   ifelse( \
41                 title(), \
42                 "\"" mytitle() "\" END", \
43                 "\n#include <menu.posthook>\n\nDebian END" \
44            ) \
45            "\n"