I've written a menu-method script that generates menus for Ion using the
Debian menu system, which is also used by Mandrake.  This automatically
creates menu entries for each package on your system.  I've tested this
on Mandrake, but there is no reason it shouldn't work on Debian.

The "ionmenu" script is attached.  You may have to edit the prfix paths
to match your installation.  

The easiest way to use it is to place the script into "~/.menu-methods/"
and run "update-menus" as a normal user.  This will create the file
"~/.ion2/auto-menus.lua" containing menu entries.

Next, edit "~/.ion2/ion-menus.lua" to add the line
"include("auto-menus.lua")" and add a menuentry to an existing menu.
The menuentry should use the top submenu name (found near the end of the
"auto-menus.lua" file).  For Mandrake, the entry could be
"menuentry("Programs", "mandrake")".

Hope this is useful,
Doug.
#!/usr/sbin/install-menu
#
# Generates ion menus for all registered applications.
compat="menu-1"

!include menu.h

genmenu="auto-menus.lua"
rootprefix="/usr/local/ion-devel/etc/ion/"
userprefix=".ion2/"
treewalk=c(m)

function ltitle()=translate(lang(),title())
function esctitle()=esc(ltitle(), "\"")
function esccmd()=esc($command, "\"")
function menutitle()=esc(tolower(replacewith(replacewith(ltitle(),"/","_")," ","_")), 
"\"")

supported
    x11="    menuentry(\"" esctitle() "\", make_exec_fn(\"" esccmd() "\")),\n" 
    text="    menuentry(\"" esctitle() "\", make_exec_fn(\"xterm -T \\\"" esctitle() 
"\\\" -e " esccmd() "\")),\n"
endsupported

preoutput="-- Menu definitions\n\n"
postoutput=""

startmenu="defmenu(\"" menutitle() "\", {\n"
submenutitle="    submenu(\"" esctitle() "\", \"" menutitle() "\"),\n"
endmenu="})\n\n"

Reply via email to