Debian Codegraph @

debian/menu-method

raw
1 #!/usr/bin/install-menu
2 # -*- mode: shell-script; -*-
3 #
4 compat="menu-1";
5 !include menu.h
6 compat="menu-2";
7
8 outputencoding="ISO-8859-1";
9
10 treewalk="M";
11 rootprefix="/etc/X11/ratmenu/";
12 userprefix=".ratmenu/";
13 mainmenutitle="Debian Menu";
14 rootsection="Debian";
15
16 function space()=" ";
17 function newline()="\n";
18 function quote($text)="'" escwith($text,"'","'\\'") "'";
19
20 function section()=parent($section);
21 function file($sec)=tolower(replacewith($sec,"/ '","...") ".menu");
22
23 function ratprevious()=" -back " ifeqelse(section(), "Debian", "''", prefix() file(parent(section())));
24
25 function ratcmd()=firstentry("ratmenu -style dreary -label " quote("/" section()) ratprevious()) space();
26
27 function exec($com)=ratcmd() quote(title()) space() quote(ifeq($needs, "text", "x-terminal-emulator -T \\\"" esc($title,"\\\"") "\\\" -e ") $com);
28
29 genmenu=file(parent($section));
30 removemenu="set -e; rm -f " prefix() "/debian*menu";
31
32 supported;
33 x11= exec($command);
34 text= exec($command);
35 endsupported;
36
37 startmenu="";
38 endmenu="";
39 submenutitle=ratcmd() quote($section"/") space() "'" prefix() file($section) "'";
40
41 prerun="set -e; rm -f " prefix() "/debian*menu";
42 postrun="set -e; chmod a+x " prefix() "/debian*menu";