File: blackbox.menu-method

package info (click to toggle)
blackbox 0.70.1-13
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,248 kB
  • sloc: cpp: 17,587; sh: 8,764; makefile: 1,051; awk: 25
file content (41 lines) | stat: -rw-r--r-- 1,198 bytes parent folder | download | duplicates (9)
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
#!/usr/bin/install-menu
#
# Generates blackbox menus for all registered applications.

!include menu.h
compat="menu-1"
outputencoding="LOCALE"

genmenu="blackbox-menu"
rootprefix="/etc/X11/blackbox/"
userprefix=".blackbox/"
treewalk="M)"

# formatting fonctions
function bbindent()=nstring(level(), "   ")
function bbquote($expr)=esc($expr, "()")

function bbit($it)=" [" bbquote($it) "] "
function bblab($lb)=ifnempty($lb, " (" bbquote($lb) ") ")
function bbcom($cm)=ifnempty($cm, " {" bbquote($cm) "} ")

# [item] (opt-label) {opt-command}
function bbitem($item,$label,$com)=bbindent() "[" bbquote($item) "]" bblab($label) bbcom($com) "\n"

# blackbox specific menu commands (workspaces, configuration...)
function bbcommand($item,$label)=bbitem($item, $label, "none")

supported
    x11=    bbitem("exec", title(), $command)
    wm=	    bbitem("restart", title(), $command)
    text=   bbitem("exec", title(), term())
blackbox=   bbcommand($longtitle, $description)
endsupported

preoutput= \
  "# Automatically generated file. Do not edit (see /usr/share/doc/menu/README)\n\n[begin] (Debian)\n"

startmenu= ""
submenutitle= bbitem("submenu", title(), $longtitle)
endmenu= bbindent() "[end]\n"