I blogged about this but as usual I was quite scarce on details.
You will need to have python-gmenu installed for this to work.
The package includes two scripts:
This script just needs to be run *once* it downloads the openbox xdg-pipemenu and copies it to ~/bin, it then backs up your menu.xml and writes a new menu.xml:
<?xml version="1.0" encoding="utf-8"?> <openbox_menu> <menu execute="cat ~/.config/openbox/rootmenu.xml" id="root-menu" label=""/> </openbox_menu>
The pipemenu is run to create a new file "rootmenu.xml" in ~./config/openbox. This menu is referenced as a pipe menu simply by cat'ting it, serving as a poor man's cached menu, removing the usual problem of writing a pipe menu on demand (it's quick). That is what the script does. (Id' probably back up your menu yourself first)
So far all that has happened is that we have created a static xdg menu that acts as your root openbox menu. Next we need to have it update. There are lots of ways to do this, I've included two examples. genmenu is a wrapper for inotifywait (included in inotify-tools), it watches your application folders and when it spots changes (menu edits, added removed applications etc) it writes a new menu. The alternative way is to use fsniper and use the configuration that is included in xdgopenboxmenu.sh. Either of these can be added to autostart.sh or .xinitrc (or somewhere)
Alternatively you can manually update your menu when you have made changes by running the script:
xdg-menu > ~/.config/openbox/rootmenu_tmp.xml && mv -f ~/.config/openbox/rootmenu_tmp.xml ~/.config/openbox/rootmenu.xml
This goes around the houses a bit by writing the script and them moving it, it just tries to reduce the time when the rootmenu.xml is unavailable ( a very, very short time anyway).
You will probably need to install an XDG menu editor such as Alacarte to organise your menus, you might need to create some extra .desktop files for programs that do not have them. After that it is plain sailing.
There are lots of way to do similar things, the important things are the using a pre-created menu to reference, over generating as a normal pipemenu and somehow keeping your menu uptodate...
I don't know anyone except me who is using this so i'd appreciate any feedback etc.
(yeah this could maybe have gone in another topic about pipemenus or some other menu related topic)
Edit: XDG menus are the standard menus that kde/xfce/rox/gnome/etc use you can read more about them here:
Last edited by david (2009-11-08 21:21:53)
Looks interesting and read the blog post but still a bit lost, don't know what an XDG menu is. What is this used for?
Last edited by jobester (2009-11-08 17:36:54)
It really nice information thread it is help me lot. I found many interesting thing about XDG openbox.
Nice one david - it took me a while to figure this out. I was irritated that it destroyed my menu.xml, but oh well should have looked at it better.
So here's what I did.
1. I copied xdg-menu to /usr/bin/crunchbang and renamed it to obpipemenu-xdg-menu
sudo cp xdg-menu /usr/bin/crunchbang/obpipemenu-xdg-menu
2. I reset my menu.xml back to normal and added the following lines to that.
- right above the root-menu at that top I added:
<menu execute="obpipemenu-xdg-menu" id="xdg-menu" label="Applications" /> <menu id="root-menu" label="Openbox 3">
3. I placed the pipemenu where I wanted
<separator label="Applications" /> <menu id="xdg-menu" />
here's a screenshot
Honestly, I think this should be a default with !# Statler Maybe
Last edited by jdcFuimus (2010-04-08 03:15:47)