#! crunchbang openbox menus

#! default menu opens with a right click on desktop. This menu is static and needs to be maintained by the user. Middle click opens an auto-populated window/desktop menu. Left click has no associated menu.

Debian menu, although installed, is not configured/enabled. This is what I target: Left click -> Debian menu.

I kept the right click and middle click menus undisturbed, but added the debian-menu to the left click.

Confirm debian-menu exists.
$ dpkg -l menu

$ vi .config/openbox/rc.xml

First, we enable the Debian menu. Look for this section, and uncomment the following lines, as under:

<!-- default menu file (or custom one in $HOME/.config/openbox/) -->
<!-- system menu files on Debian systems -->
<file>/var/lib/openbox/debian-menu.xml</file>
<file>debian-menu.xml</file>
<file>menu.xml</file>


Next, we trigger the Debian menu on Left click. In the same file, look for this section, and add entry for left click, as under.

<context name="Root">
  <!-- Menus -->
  <mousebind button="Left" action="Press">
    <action name="ShowMenu">
      <menu>/Debian</menu>
    </action>
  </mousebind>
  <mousebind button="Middle" action="Press">
    <action name="ShowMenu">
      <menu>client-list-combined-menu</menu>
    </action>
  </mousebind>
  <mousebind button="Right" action="Press">
    <action name="ShowMenu">
      <menu>root-menu</menu>
    </action>
  </mousebind>
</context>


Save the file, and restart Openbox. Or
$ openbox --reconfigure

Left click anywhere on the desktop... Voila!

We can also configure a Keyboard Shortcut, like the other menus activated by Super (aka Windows) key combinations.
Super+Space Main Menu
Super+Tab Client Menu


Super+Menu Debian Menu
We will use the Menu key, found to the right of SpaceBar among the right AltGr/Ctrl keys on my GB keyboard. Your keyboard might have a slightly different layout. If you can't find the Menu key, or don't want to use the Menu key, simply substitute your preferred key wherever I mention the Menu key.

So, we reopen the same file again.
$ vi .config/openbox/rc.xml

And look for the following section, to add an entry for Debian Menu among the othe menu keybindings, as under:

<keybind key="W-Menu">
  <action name="ShowMenu">
    <menu>/Debian</menu>
  </action>
</keybind>
<keybind key="W-Tab">
  <action name="ShowMenu">
    <menu>client-list-combined-menu</menu>
  </action>
</keybind>
<keybind key="W-space">
  <action name="ShowMenu">
    <menu>root-menu</menu>
  </action>
</keybind>


Now save the file and restart OpenBox. Hit Super+Menu from anywhere, not just in front of an empty desktop, but even when your desktop might be hidden under various windows. No need to minimise all windows to find some space to click to get your Menu!

Have fun...!

No comments:

Post a Comment

most viewed