diff options
author | Bill Allombert <ballombe@debian.org> | 2011-11-16 12:33:27 +0100 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-03-05 16:39:28 +0000 |
commit | dd7279795c97aa356727d366a2149c9bc838b496 (patch) | |
tree | a87d19d2e5220f5b38aec3b5b036235a59f971c9 /examples/pdmenu | |
download | menu-debian/2.1.46.tar.gz |
Imported Debian version 2.1.46debian/2.1.46
Diffstat (limited to 'examples/pdmenu')
-rwxr-xr-x | examples/pdmenu | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/examples/pdmenu b/examples/pdmenu new file mode 100755 index 0000000..9ce82fb --- /dev/null +++ b/examples/pdmenu @@ -0,0 +1,68 @@ +#!/usr/bin/install-menu +# -*- mode: shell-script; -*- +# +# Written by Joey Hess. +# +# This generates a pdmenurc file that can be preprocessed by cpp to enable +# different types of displays. For example, you can -Dx11 -Xtext to display +# only the text and x11 entries, and not the vc ones. +# +# More info: /usr/share/doc/menu/html, /usr/doc/pdmenu/README.Debian + +# The verson of the menu package that can process this. +compat="menu-1" + +#include the local preferences, pdmenu only uses the defintion of title(). +!include menu.h + +compat="menu-2" + +# Filename of the pdmenurc file we will generate. +genmenu="pdmenurc_auto"; + +# Where the system wide generated file is placed. +rootprefix="/var/lib/pdmenu/"; + +# Title of the top level menu that is made. +mainmenutitle="Debian Menus"; + +# Don't ever use "q" as a hotkey in menus, becuase it is used to popdown +# submenus. +hotkeyexclude="q"; + +# Some text to go at the top of the autogenerated file. +preoutput="# Automatically generated pdmenurc file.\n# Do not edit (see /usr/doc/pdmenu/README.debian)\n\n"; + +# In what order we output the menus. +treewalk="c(m)"; + +# How to start a new menu in the rc file. +startmenu="menu:" esc($section,":") ":" esc(title(),":") "\n"; + +# How to add a submenu to a menu. +# Notice that thanks to cpp and some #defines, the submenu is only added if +# the submenu actually contains menu entries. +submenutitle= + "#ifdef " cppesc($section) "\n" + "#define " cppesc(parent($section)) "\n" + " show:" esc(escfirst(title(),$hotkey,"_"),":") "..::" esc($section,":") "\n" + "#endif\n"; + +# The supported display types, in order of preference. +supported; +x11= "#ifdef x11\n" + "#define " cppesc(parent($section)) "\n" + " exec:" esc(escfirst(title(),$hotkey,"_"),":") ":n:" $command " >/dev/null 2>&1 &\n" + "#endif\n"; +vc= "#ifdef vc\n" + "#define " cppesc(parent($section)) "\n" + " exec:" esc(escfirst(title(),$hotkey,"_"),":") "::" $command "\n" + "#endif\n"; +text= "#ifdef text\n" + "#define " cppesc(parent($section)) "\n" + " exec:" esc(escfirst(title(),$hotkey,"_"),":") "::" $command "\n" + "#endif\n"; +endsupported; + +# Pdmenu doesn't need anything special at the end of a menu. +endmenu= "\n"; |