File: menu-method

package info (click to toggle)
ratmenu 2.3.23
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 104 kB
  • sloc: ansic: 480; makefile: 32; sh: 2
file content (42 lines) | stat: -rw-r--r-- 1,219 bytes parent folder | download | duplicates (5)
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
#   -*- mode: shell-script; -*-
#
compat="menu-1";
!include menu.h
compat="menu-2";

outputencoding="ISO-8859-1";

treewalk="M";
rootprefix="/etc/X11/ratmenu/";
userprefix=".ratmenu/";
mainmenutitle="Debian Menu";
rootsection="Debian";

function space()=" ";
function newline()="\n";
function quote($text)="'" escwith($text,"'","'\\'") "'";

function section()=parent($section);
function file($sec)=tolower(replacewith($sec,"/ '","...") ".menu");

function ratprevious()=" -back " ifeqelse(section(), "Debian", "''", prefix() file(parent(section())));

function ratcmd()=firstentry("ratmenu -style dreary -label " quote("/" section()) ratprevious()) space();

function exec($com)=ratcmd() quote(title()) space() quote(ifeq($needs, "text", "x-terminal-emulator -T \\\"" esc($title,"\\\"")  "\\\" -e ") $com);

genmenu=file(parent($section));
removemenu="set -e; rm -f " prefix()  "/debian*menu";

supported;
  x11=        exec($command);
  text=       exec($command);
endsupported;

startmenu="";
endmenu="";
submenutitle=ratcmd() quote($section"/") space() "'" prefix() file($section) "'";

prerun="set -e; rm -f " prefix()  "/debian*menu";
postrun="set -e; chmod a+x " prefix() "/debian*menu";