Debian update-menus script for Openbox 3

Marcelo Ramos mramos at montevideo.com.uy
Sat Sep 6 21:48:00 EDT 2003


Hi!

Just to share a update-menus script I made today copying the Blackbox
script and modifying it to generate a valid Openbox menu file.

The script (attached) should be copied as /etc/menu-methods/openbox.
If you ran 'update-menus' a file /etc/X11/openbox/openbox-menu.xml
should be generated.

To integrate that menu file into the Openbox's menu:

1) Include openbox-menu.xml in  ~/.openbox/rc.xml :

<menu>
[...]

<!-- debian menu file -->
<file>/etc/X11/openbox/openbox-menu.xml</file>

[...]
</menu>

2) Add the menu with id "debian-menu" in menu.xml:

<menu id="root-menu" label="Openbox 3">
  <menu id="apps-menu" />
  <menu id="games-menu" />
  <separator />
  <menu id="debian-menu" />               <-------------
  <separator />
  <menu id="client-list-menu" />
  <separator />
  <item label="Restart">
     <action name="restart" />
  </item>
  <item label="Exit">
     <action name="exit" />
  </item>
</menu>


Well, the script is a 2 hour hack but it works fine here :)

TODO:

I don't know how to make a menu entry that switches to another window
manager so I couldn't convert the following (Blackbox syntax):

[submenu] (WindowManagers) {}
  [restart] (Blackbox)  {/usr/bin/blackbox}
  [exit] (Exit)
  [restart] (FluxBox)  {/usr/bin/fluxbox}
  [...]
  [reconfig] (Reconfigure)
  [restart] (Restart)
  [restart] (XFwm)  {xfwm4}
  [restart] (openbox)  {/usr/bin/openbox}
[end]

Is there a "restart" action that I can use to switch to another wm?



I hope the script will be useful to integrate Openbox into Debian.

That's all folks!

-- 
 _________________________________________________________
                                    ______  _____________
  Marcelo Ramos                    |      \/       __    |
  Debian Sid GNU/Linux 2.4.22      |              |_/    /
  Socio UYLUG Nro 125              |                     \
  Linux registered user #118109    |_____|\/|_____|\______\
-------------- next part --------------
#!/usr/sbin/install-menu
#
# Generates openbox menus for all registered applications.
compat="menu-1"

!include menu.h

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

supported
    x11=\
nstring(level(), "   ") "<item label=\""esc($title, "")"\">\n"nstring(level(), "   ")"  <action name=\"execute\"><execute>"esc($command, "")"</execute></action>\n"nstring(level(), "   ")"</item>\n"

    #wm=nstring(level(), "   ") "[restart] ("  esc($title, "()")  ")  {" esc($command, "()") "}\n" 
    
    text=\
nstring(level(), "   ") "<item label=\""esc($title, "")"\">\n"nstring(level(), "   ")"  <action name=\"execute\"><execute>x-terminal-emulator -T \"" esc($title, "") "\" -e "esc($command, "")"</execute></action>\n"nstring(level(), "   ")"</item>\n"

endsupported

preoutput= \
"<!--Automatically generated file. Do not edit (see /usr/share/doc/menu/README)-->\n<openbox_menu>\n<menu id=\"debian-menu\" label=\"Debian Menu\">\n"

startmenu= ""
submenutitle= nstring(level(), "   ") "<menu id=\""esc($title, "")"\" label=\""esc($title, "")"\">\n"
endmenu= nstring(level(), "   ") "</menu>\n"

postoutput="</openbox_menu>\n"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://icculus.org/pipermail/openbox/attachments/20030906/a304d078/attachment-0001.pgp>


More information about the openbox mailing list