[openbox] openbox 3 comments/questions

t3xplri02 at sneakemail.com t3xplri02 at sneakemail.com
Fri Oct 17 11:26:56 EDT 2003


On 10/17/03 14:37, Corey Wright undefined-at-pobox.com |openbox-dev| wrote:
> for the benefit of other debian users in the listening audience, could
> you mention where such a script can be found?

Well... here it is. I have attached it to this email. Adjust the path 
strings accordingly.

> i compiled the debian source packages from
> http://www.hetzi.at/thomas/debian (i run stable with several packages
> backported from unstable/testing) and i didn't see it include any
> script, and it definitely doesn't put anything into /etc/menu-methods. 
> i looked in the openbox3 rc tarballs and didn't see anything there
> either.

I did not include the menu script in the package because it is 
incomplete - every program containing "<", ">" or "&" in the command 
line is left non-functional. See xdiskusage for an example.

The problem is that these characters must be encoded as &lt;, &gt; and 
&amp; to be XML conformant. Unfortunately there is no such routine in 
the Debian menu system. If anyone has suggestions how to circumvent or 
solve this problem, please tell me! (The only solution which came to my 
mind was writing an external program which does the conversion for us, 
and calling this program for each program registered. This however is 
more than inefficient.)

Cheers,
Thomas
-- 
A: No.
Q: Should I include quotations after my reply?
-------------- next part --------------
#!/usr/sbin/install-menu
#   -*- mode: shell-script; -*-
#
# Openbox 3 compatible XML menu file.
compat="menu-1"

!include menu.h

genmenu="openbox-menu.xml"
rootprefix="/etc/X11/openbox/"
userprefix=".config/openbox/"
treewalk=(M)
#rootsection="/Debian"

function arg($key, $val)=$key"=\""$val"\""
function lvl()=nstring(level(), "  ")
function labelb($title)=lvl()"<item "arg("label", $title)">\n"
function labele()=lvl()"</item>\n"
# we have to replace some XML reserved chars with spaces,
# eventually breaking some registered apps
function exec($cmd)=lvl()"  <action "arg("name", "Execute")"><execute>"\
    replacewith($cmd, "<>&", "   ")"</execute></action>\n"

supported
   x11=labelb($title) exec($command) labele()
   #wm=lvl() "[restart] ("  esc($title, "()")  ")  {" esc($command, "()") "}\n"
   text=labelb($title) \
       exec("x-terminal-emulator -T \"" $title "\" -e " $command) \
       labele()
endsupported

preoutput="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
<!-- Automatically generated file.\n\
     Do not edit (see /usr/share/doc/menu/README) -->\n\n\
<openbox_menu xmlns=\"http://openbox.org/\"\n\
     xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\
     xsi:schemaLocation=\"http://openbox.org/\n\
             file:///usr/share/openbox/menu.xsd\">\n\n<menu\
id=\"debian-menu\" label=\"Debian Menu\">"
postoutput="</openbox_menu>\n"

startmenu=""
submenutitle=lvl()"<menu "arg("id", $title)" "arg("label", $title)">\n"
endmenu=lvl()"</menu>\n"



More information about the openbox mailing list