Using Hotkeys with Openbox


2012-10-08

Openbox is a pretty minimalist window manager, so it's not always easy to configure. If you want to add a hot key preference to openbox (for opening a program with combination of keyboard keys), you will need to edit openbox's rc.xml file. This file is usually located in ~/.config/openbox/rc.xml.

Open rc.xml:

nano ~/.config/openbox/rc.xml

or

gedit ~/.config/openbox/rc.xml

Find a line that says <keyboard>. This is the section where keybindings or hotkeys go. To add a hotkey preference, include a section that looks like this, within the <keyboard> section:

<keybind key="W-w">
  <action name="Execute">
    <startupnotify>
      <enabled>true</enabled>
      <name>Web Browser</name>
    </startupnotify>
    <command>google-chrome</command>
  </action>
</keybind>

This example opens the Chrome web browser when you press the Meta key (Windows key on most machines) and the w key together. A few different keys can be used: the control key (replace W with C), or the alt key (A instead of W). For opening other programs replace the google-chrome between the <command> tags.