File: menu-method

package info (click to toggle)
jwm 2.4.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,752 kB
  • sloc: ansic: 22,514; makefile: 130; sh: 59; sed: 16
file content (71 lines) | stat: -rwxr-xr-x 2,214 bytes parent folder | download | duplicates (2)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/install-menu
#
# This file is located in /etc/menu-methods/jwm
# See "Debian Menu System" /usr/share/doc/menu/html/index.html
#
# FOR THE DEBIAN DEVELOPER
#
# 1) copy content from the jwm source (example.jwmrc)
#    - Remember to make "postoutput" where Debian menus are inserted.
#    - Use x-terminal-emulator, not xterm, rxvt etc.
#
# 2) Substitute all quotes with backslash+quote
#
# 3) Substitute all newlines with "\n\"
#
# To test:
#
#       update-menus --stdout > /tmp/menu-stdin
#       cd  debian/
#   [1] cp menu-method /etc/menu-methods/jwm
#   [2] /etc/menu-methods/jwm -v < /tmp/menu-stdin
#       ls -la /etc/jwm/
#       cat /etc/jwm/jwm.debian
#
#   Run 1 & 2 if you modify the menu-method file and want to see results
#
# To test desktop:
#
#     cp jwm.desktop /usr/share/jwm/xsessions/jwm.desktop

compat="menu-1"

# /etc/menu-methods/menu.h
!include menu.h

rootprefix="/etc/jwm/"
genmenu="debian-menu"
outputencoding="UTF-8"
userprefix="jwmrc"
treewalk="(M)"
#rcfile="system.jwmrc";
#examplercfile="system.jwmrc-menu";

function q($com)=esc($com,"\"")
#function f($com)="  \"" q(title()) "\"    f.exec  \"" q($com) " &\"\n"

function xml_escape($s) = replace(replace(replace(replace($s, \
"&",  "&amp;"), \
">",  "&gt;"), \
"<",  "&lt;"), \
"\"", "&quot;"))

# If there's an icon() then return a string like icon="/some/dir/foo.xpm".
# jwm scales the icon as necessary to fit the menu so the 32x32 vs 16x16
# preference in icon() has no effect.
function jwm_icon_attr()=ifnempty(icon(), " icon=\"" xml_escape(icon()) "\"")

supported
    x11=     nstring(level(), "  ") "    <Program label=\"" xml_escape(title()) "\"" jwm_icon_attr() " confirm=\"false\">" xml_escape($command) "</Program>\n"
    text=    nstring(level(), "  ") "    <Program label=\"" xml_escape(title()) "\"" jwm_icon_attr() " confirm=\"false\">" xml_escape(term()) "</Program>\n"
endsupported

startmenu=nstring(level(), "  ") "    <Menu label=\"" q(title()) "\">\n"
endmenu=nstring(level(), "  ") "    </Menu>\n"

# submenutitle= nstring(level(), "   ") "  \"" q(title()) q($section) "\"\n"

preoutput="<JWM>\n<!-- Automatically generated and updated. Do not touch -->\n"
postoutput="</JWM>\n"

# End of file