Help:Menus

From Openbox

Revision as of 03:19, 8 November 2007 by 202.70.201.34 (Talk)

Jump to: navigation, search

universal motion picture petite blonde anal top 100 cities population the great gatsby quotes mountain meadow 2nd fair grade science topic cheap lortab view earth from space policy frameworks in the uk and emu palauan legends play a mcdonalds game motorcycle rider training course equipping force rapid 3 film man spider miss you email cards new york weight loss spa eastern hemisphere current events ten week pregnant kid snow rac pool buy ativan pool game pc download social services benefits uk artificial plants australia john hennessey international convenant on luxury homes london 26 in flat panel lcd tv sims superstar white person jokes rival record translate french phrases into english most expensive homes in illinois integrity magazine sales instructions to make a web site lesson london ontario swimming analog clock code java not friends anymore lyrics interview nurse tip a 1 auto glass ont car rental songs downloading sites playstation roms free download ancient food from rome university of kentucky chemistry department uk horse racing tracks extreme foot job tag agency florida stephen kings it cast list likes me when im gone download retro ringtones atlantic electric and gas website nextel ringtones lightweight shipping cases keith nicholls 2006 can live large ranch floor plans electric wholesales import mysql database pubblico la county sheriffs dept mail security 8100 airway us visa photoshop watermark effect new homes in reno nevada add manufacturing off site url amber marie pics nri services in india mosaic store tile mountain view library california entertainment newcastle upon tyne installing insulation waste management recycling industry information center upholsterers tool school christmas plays muslim converted to christianity antiviruses comparison nike hates pictures of beyonce knowles adult brazil escort sql server stored procedure output lesson plan side story west simpsons halloween special anti racism bands buy the english garden restaurant london inner bank wall picture framing san diego news note discount hydrocodone 20th century advertising verizon ringtone starting line mp3s russian model engines image mixer sony software wish you were here chords lyrics 1 stop insurance africa south tour travel vacation air trans america pop ringtones unionization process Menus are not read out of the rc.xml configuration file, but rather out of files specified in the rc.xml. In the default configuration, the menu.xml file is used for all of the menus.

The menu.xml file is located in ~/.config/openbox/menu.xml or in the system-wide /etc/xdg/openbox/menu.xml.

Contents

Static menus

Syntax

A menu file must be entirely enclosed within <openbox_menu> tags, such as:

<openbox_menu>
  ...menu stuff here...
</openbox_menu>

Inside these tags, menus are specified as follows:

<menu id="ID" label="TITLE">
  <!-- this is a menu item, such as a program -->
  <item label="LABEL">
    ACTIONS
  </item>

  <!-- this is a menu header -->
  <separator label="La la" />

  <!-- this links to a sub menu -->
  <menu id="ID" />

  <!-- this is a small line separator -->
  <separator />

  <!-- this also links to a sub menu, which is defined inline -->
  <menu id="ID" label="TITLE">
    <item label="LABEL">
      ACTIONS
    </item>
  </menu>

  <separator />

  <item label="LABEL">
    ACTIONS
  </item>
</menu>

The syntax example above shows how to put entries into a menu (with <item>), and two methods to add submenus to a menu (with <menu>). It also shows how to put menu headers and separators (with <separator>) into the menu to group items together without submenus.

ID

Each menu must be given an ID which is a unique identifier for the menu. This ID is used to refer to the menu in a ShowMenu action.

TITLE

The TITLE of the menu is shown when you link to the menu as a submenu. The TITLE will appear in its parent menu.

LABEL

The LABEL in an <item> tag is the visible name of the menu item. In the <separator> tag, the LABEL transforms the separator from a small horizontal line to a menu header with the given text in it.

ACTIONS

The ACTIONS are 0 or more actions which are executed in order when you select the menu item. Typically, in menus, these are Execute actions, which run commands.

Pipe menus

Pipe menus are dynamic menus, built on-the-fly from scripts. These are referred to as "Pipe menus" since the script's output is piped back to Openbox and used for the menu. There are a number of pipe menus written by various people available through the Pipe menus page.

A pipe menu can be created by placing the following into a menu file, such as menu.xml:

<menu id="ID" label="TITLE" execute="COMMAND" />

Thereafter the pipe menu can be referenced just like any other menu.

COMMAND

The COMMAND is the script to be executed, which will create the pipe menu for Openbox. The output from this command is parsed and turned into the menu. The output from the script should be a menu, something like:

<openbox_pipe_menu>
  <item label="LABEL">
    ACTIONS
  </item>
</openbox_pipe_menu>

The Debian menu

Source installs or prepackaged .debs from openbox.org will not configure your setup to show the Debian menu. There are a few simple steps to get it working.

If you have already installed openbox with a working Debian menu

Add this line to your ~/.config/openbox/menu.xml:

 <menu id="Debian" />

You should place the line where you would like it to appear in the root menu. Location matters!

Add these lines to your ~/.config/openbox/rc.xml between the <menu> and </menu> tags:

   <file>/var/lib/openbox/debian-menu.xml</file>
   <file>debian-menu.xml</file>

The second line allows you to copy the debian-menu.xml file from /var/lib/openbox to your local ~/.config/openbox, where it becomes static (update-menus will not affect it). You can then edit it by hand and your changes will be permanent.

That's all you should have to do, though it's a good idea to run update-menus as root every now and then if you don't have a cron job assigned. It refreshes the list of currently installed apps.

Then choose "reconfigure" on your root menu and you should get a Debian menu.

If you haven't had a working debian menu

This is a little trickier, but no big deal. First do all the steps listed above.

Then there's this little humdinger: you'll need to get a copy of an executable script named "openbox" and copy it to /etc/menu-methods. (The script actually creates the Debian menu when you run "update-menus.")

The easiest way is to install an official debian openbox. This will normally ensure that you have all the packages required to create and use the Debian menu.

After installation you can copy that file, then let it get uninstalled by dpkg when you put in the openbox.org deb file. If you're installing from source, you can just "aptitude remove" the official deb and proceed as normal.

If you don't want to do that, download an official .deb and type the command dpkg-deb -x <officialopenbox.deb> <directory you want it in, usually . >

This will unpack a mini-filesystem that includes the script you need in localdir/etc/menu-methods. Copy that script to the real /etc/menu-methods and issue the command "update-menus" as root.

If you did not install an official openbox .deb, you should make sure you have the following packages installed:

  • menu
  • menu-xdg

As above, choose reconfigure from your root menu and at that point, you should have a brand new Debian menu.

Personal tools