File: awesome.menu-method

package info (click to toggle)
awesome 4.3-8.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,468 kB
  • sloc: ansic: 14,508; sh: 526; makefile: 46
file content (37 lines) | stat: -rw-r--r-- 1,484 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/install-menu
# default generate /etc/xdg/awesome/menu.lua
# you need to require("debian-menu") to use debian-menu.Debian_menu

compat="menu-1"

!include menu.h

compat="menu-2"
outputencoding= "UTF-8";

function q($s) = "\"" esc($s,"\\\"") "\"";
function s($s) = replacewith(replacewith($s,"/","_"), " ", "_");
function findicon($filename)= 
       ifelsefile($filename, q($filename),
        iffile("/usr/share/pixmaps/" $filename,
                   q("/usr/share/pixmaps/" $filename)));
function x11menu()= "\t{"q(title())","q($command) ifnempty($icon, ","findicon($icon))"},\n";
function textmenu()= "\t{"q(title())", \"x-terminal-emulator -e \".."q($command) ifnempty($icon,
","findicon($icon))"},\n";
function wmmenu()= "\t{"q(title())",function () awesome.exec("q($command)") end" ifnempty($icon, ","findicon($icon))"},\n";

supported;
    x11= x11menu();
    text= textmenu();
    wm= wmmenu();
endsupported;

startmenu=      "Debian_menu[\""s($section)"\"] = {\n";
endmenu=        "}\n";
submenutitle=   "\t{ "q(title())", Debian_menu[\""s($section)"\"] },\n";
genmenu=        "debian/menu.lua";
rootsection=    "Debian";
rootprefix=     "/etc/xdg/awesome/";
userprefix=     shell("echo -n /${XDG_CONFIG_HOME-.config}") "/awesome/";
preoutput=      "-- automatically generated file. Do not edit (see /usr/share/doc/menu/html)\n\nlocal awesome = awesome\n\nDebian_menu = {}\n\n";
postoutput=     "\ndebian = { menu = { Debian_menu = Debian_menu } }\nreturn debian"