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
|
#!/usr/sbin/install-menu
#I need menu-1.4!
#
#NOTE: the first line of this script _must_ be
# equal to "#!/usr/sbin/install-menu", otherwise update-menus
# will feed this script old-compat-mode data.
#
#More info: /usr/doc/menu/html.
#
# One of the great things about free software is that if someone else
# does it right, you don't have to do it again. The following is cribbed
# from the fvwm menu-method file, mostly by Julian Gilbey
!include menu.h
compat="menu-1"
outputencoding="ISO-8859-1"
function start($var,$com)=\
"+ \"" escfirst(title(),$hotkey,"&") \
cond_surr(icon(),"%","%") "\" " $var " " $com "\n"
supported
fvwm95module= start("Module", $command)
wm= start("Restart",$command)
x11fvwm2= start("Exec", $command)
x11fvwm= start("Exec", $command)
x11= start("Exec", $command)
text= start("Exec", term())
endsupported
# Ok, "startmenu" is a little wacky, and comes in 4 parts:
# 1. If this is running for a user, then we do a DestroyMenu to
# clear out the system one. Furthermore, if we're dealing with the
# top-level /Debian menu, then add a title for it (normally done in
# system.fvwm2rc), and re-read the main-menu-pre.hooks whose results
# we merrily blew away earlier. This is so that the
# main-menu-pre.hooks work for users as well as system-wide. Of
# course, none of this happens if we're running as root to produce the
# system-wide menudef.hook file.
# 2. We spit out an "AddToMenu /Foo/Bar/Baz" to start this menu.
# 3. We add a trailing newline to the lot.
startmenu= "DestroyMenu \"" replacewith($section," ","_") "\"\n" \
"AddToMenu \"" replacewith($section," ","_") "\" \"" title() "\" Title \n" \
ifeq($section, "/Debian", \
"Read /etc/X11/fvwm95/main-menu-pre.hook \n" \
"Read .fvwm95/main-menu-pre.hook \n")
endmenu= "\n"
submenutitle= "+ \"" escfirst(title(),$hotkey,"&") \
cond_surr(icon(),"%","%") "\" Popup " replacewith($section," ","_") "\n"
genmenu= "menudefs.hook"
rootprefix="/etc/X11/fvwm95/"
userprefix="/.fvwm95/"
treewalk="c(m)"
mainmenutitle="Main Menu"
hotkeycase="insensitive"
#If you want your fvwm95 sessions to be automatically restarted when you
#upgrade your debian menus, uncomment the next line:
#postrun="killall -USR1 /usr/bin/X11/fvwm95"
|