There doesn't seem to be a Debian version of Obmenu-generator, so installation requires a little ingenuity (See Addendum below.). The easiest way is to first make sure that build-essential, cpanminus and git are installed: sudo apt-get install build-essential cpanminus git. Follow with the following sequence of terminal commands:
git clone git://github.com/trizen/obmenu-generator
sudo cp obmenu-generator/obmenu-generator /usr/bin
sudo cp -r obmenu-generator/schema.pl ~/.config/obmenu-generator/
sudo cpanm Linux::DesktopFiles
sudo cpanm Data::Dump
sudo chmod 777 /usr/bin/obmenu-generator .
To set a dynamical version of the Root Menu, put the following in the terminal:
obmenu-generator -p -i .
Leave out "-i" if you want an icon-less menu.
Obmenu-generator works by creating an upfront schema file, which replaces menu.xml as the file for editing the menu. I've tried distros in the past that created a schema file to make a dynamic openbox root menu, but found them lacking simplicity and being overly restrictive in what kind of static entries could be made. Obmenu-generator is different in both instances. Configuring ~/.config/obmenu-generator/schema.pl is for the most part very easy, and I have found everything possible with a static root menu is still possible with the dynamical obmenu-generator root menu. I will next relay details for configuring each of the sections identified in the picture on the right.
Now a regular static Openbox Root Menu can be configured to include a catch-all "Applications" category, which in turn consists of a dynamical sub-category list. See any of the following: Lxlinux - Menu, Openbox Menu, After Openbox for details. Not much different from the situation here. However, there is something appealing, not to mention slightly faster, about just right clicking the desktop and having a complete set of dynamical categories open-up to slide the tool-tip through just once, instead of having to do it twice, to reach an app launch point.
If there are not many applications in the category, then it is easiest to just make an item entry for each app between the category introduction and exit tags. For the scrot category in the above menu, it looks like the following:
It happens that sometimes a user has a long special submenu (*.xml file) all scribed out. Can it be added to the obmenu-generator menu without re-scribing it to fit the format described in the previous section? The answer is "yes", which is the main reason that I now so heartedly embrace the obmenu-generator approach. I have several such menus which can be added to the classical static Openbox Root Menu with one line, and wanted something similar here. The recipe that I use follows.
Among Openboxes features is the ability to creat keybindings for any menu that follows the freedesktop standard. All that is required is making 2 simple edits in rc.xml for each menu. For example, to set up the Bash Menu (~/.config/openbox/bash.xml), which at the moment has over 40 entries and only gets bigger, I added to the menu section of ~/.config/openbox/rc.xml the following line:
and to the section <!-- Keybindings for running applications --> of rc.xml, I added the following:
We can now launch the Bash Menu by pressing the key combination: Ctrl+Alt+b. For more information and discussion about menu keybindings in Openbox, see Openbox Menu.
Openbox Config is a special category built into the exec file, /usr/bin/Obmenu-generator. The items in it can be edited by editing Obmenu-generator. A slightly edited version, which is what you get if you download obmenu-generator from this site (wget http://lxlinux.com/obmenu-generator), is pictured on the right. Here is where the user chooses the nature of the general menu and can launch the main editing files. My addition was to add the 2 openbox GUI's, obconf and lxappearance, and duplicate (accidently) 2 openbox restarts, so that all the main openbox editing tools were together in the same category.
Since the main point of Obmenu-generator is to create a dynamical menu and that is done with the terminal command given above, I'm not sure what the point is of the "Generate..." section. To go back to a static menu, the user needs only to replace the menu.xml generated by Obmenu-generator by any menu.xml constructed for a static root menu.
Obmenu-generator is now in the Sparky Linux Repository, which has a large number of useful special tools. The Sparky Linux Repository can be
added to your sources directory by creating a sparky.list file:
sudo geany /etc/apt/sources.list.d/sparky.list .
Type the following into sparky.list:
deb http://sparkylinux.org/repo testing main .
Save the file and leave the editor. Update package list, install the public key via the package manager and install obmenu-generator using apt-get (or synaptic):
sudo apt-get update
sudo apt-get install sparky-keyring
sudo apt-get update
sudo apt-get install obmenu-generator .
The new "Root Menu" will probably be the Obmenu-generator static one, so bring it up and click "Advanced Settings>Obmenu-Generator>Generate a pipe menu ..." to get a dynamical one. The original static root menu is saved as ~/.config/openbox/menu.xml.ba . Configuring the new dynamical menu is done in ~/.config/obmenu-generator/schema.pl as described above. In order to eliminate potential future update problems, you may want to inactivate the Sparky repo after installing obmenu-generator, if your system is not based upon Debian Testing.
You can download the complete Sparky Linux Repository (58.4 MB) with:
git clone git://git.code.sf.net/p/sparkylinux/code sparkylinux-code .
Installation of Obmenu-generator can be then achieved directly from the files in the obmenu-generator folder in that download.