Debian Codegraph @

debian/blackbox.menu-method

raw
1 #!/usr/bin/install-menu
2 #
3 # Generates blackbox menus for all registered applications.
4
5 !include menu.h
6 compat="menu-1"
7 outputencoding="LOCALE"
8
9 genmenu="blackbox-menu"
10 rootprefix="/etc/X11/blackbox/"
11 userprefix=".blackbox/"
12 treewalk="M)"
13
14 # formatting fonctions
15 function bbindent()=nstring(level(), " ")
16 function bbquote($expr)=esc($expr, "()")
17
18 function bbit($it)=" [" bbquote($it) "] "
19 function bblab($lb)=ifnempty($lb, " (" bbquote($lb) ") ")
20 function bbcom($cm)=ifnempty($cm, " {" bbquote($cm) "} ")
21
22 # [item] (opt-label) {opt-command}
23 function bbitem($item,$label,$com)=bbindent() "[" bbquote($item) "]" bblab($label) bbcom($com) "\n"
24
25 # blackbox specific menu commands (workspaces, configuration...)
26 function bbcommand($item,$label)=bbitem($item, $label, "none")
27
28 supported
29 x11= bbitem("exec", title(), $command)
30 wm= bbitem("restart", title(), $command)
31 text= bbitem("exec", title(), term())
32 blackbox= bbcommand($longtitle, $description)
33 endsupported
34
35 preoutput= \
36 "# Automatically generated file. Do not edit (see /usr/share/doc/menu/README)\n\n[begin] (Debian)\n"
37
38 startmenu= ""
39 submenutitle= bbitem("submenu", title(), $longtitle)
40 endmenu= bbindent() "[end]\n"
41