Debian Codegraph @

debian/awesome.menu-method

raw
1 #!/usr/bin/install-menu
2 # default generate /etc/xdg/awesome/menu.lua
3 # you need to require("debian-menu") to use debian-menu.Debian_menu
4
5 compat="menu-1"
6
7 !include menu.h
8
9 compat="menu-2"
10 outputencoding= "UTF-8";
11
12 function q($s) = "\"" esc($s,"\\\"") "\"";
13 function s($s) = replacewith(replacewith($s,"/","_"), " ", "_");
14 function findicon($filename)=
15 ifelsefile($filename, q($filename),
16 iffile("/usr/share/pixmaps/" $filename,
17 q("/usr/share/pixmaps/" $filename)));
18 function x11menu()= "\t{"q(title())","q($command) ifnempty($icon, ","findicon($icon))"},\n";
19 function textmenu()= "\t{"q(title())", \"x-terminal-emulator -e \".."q($command) ifnempty($icon,
20 ","findicon($icon))"},\n";
21 function wmmenu()= "\t{"q(title())",function () awesome.exec("q($command)") end" ifnempty($icon, ","findicon($icon))"},\n";
22
23 supported;
24 x11= x11menu();
25 text= textmenu();
26 wm= wmmenu();
27 endsupported;
28
29 startmenu= "Debian_menu[\""s($section)"\"] = {\n";
30 endmenu= "}\n";
31 submenutitle= "\t{ "q(title())", Debian_menu[\""s($section)"\"] },\n";
32 genmenu= "debian/menu.lua";
33 rootsection= "Debian";
34 rootprefix= "/etc/xdg/awesome/";
35 userprefix= shell("echo -n /${XDG_CONFIG_HOME-.config}") "/awesome/";
36 preoutput= "-- automatically generated file. Do not edit (see /usr/share/doc/menu/html)\n\nlocal awesome = awesome\n\nDebian_menu = {}\n\n";
37 postoutput= "\ndebian = { menu = { Debian_menu = Debian_menu } }\nreturn debian"