Linux: LXDE/Openbox, Change Keyboard Shortcuts

By Xah Lee. Date: . Last updated: .

This page shows you how to add or remove keyboard shortcuts for linux LXDE/Openbox.

Edit the file at

~/.config/openbox/lxde-rc.xml

or

~/.config/openbox/lubuntu-rc.xml

Toggle Maximize Window

For example, to make F12 key toggle maximize window, add the following

<!-- toggle maximize window -->
<keybind key="F12">
  <action name="ToggleMaximize"/>
</keybind>

Copy and paste the above inside the <keyboard>…</keyboard> tags.

Run Terminal Command

This example shows how to set a key to run any terminal command.

<!-- switch to Firefox -->
<keybind key="F8">
  <action name="Execute">
    <command>wmctrl -xa firefox</command>
  </action>
</keybind>

You need to install wmctrl for switching windows by name.

〔►see Linux: Add Keyboard Shortcut to Switch App

Resize/Move Window

Examples of resize window, move window, etc.

<!-- resize window. Control F1 -->
<keybind key="C-F1">
  <action name="Resize"/>
</keybind>

<!-- move window -->
<keybind key="C-F2">
  <action name="Move"/>
</keybind>

<keybind key="F1">
  <action name="Iconify"/>
</keybind>

<keybind key="F12">
  <action name="ToggleMaximize"/>
</keybind>

Switch to Next Window

This example switch to next window, like 【Alt+Tab】, but using the Pause key.

<!-- like alt+tab, use pause key -->
<keybind key="Pause">
  <action name="NextWindow">
    <dialog>yes</dialog>
    <interactive>yes</interactive>
    <raise>yes</raise>
  </action>
</keybind>

Send a Key

The next example shows you how to send a key. You need xvkbd installed.

〔►see Linux: Set F2 F3 F4 to Cut Copy Paste

<!-- prev tab -->
<keybind key="F11">
  <action name="Execute">
    <command>xvkbd -no-jump-pointer -xsendevent -text '\C\[ISO_Left_Tab]'</command>
  </action>
</keybind>

<!-- next tab -->
<keybind key="F12">
  <action name="Execute">
    <command>xvkbd -no-jump-pointer -xsendevent -text '\C\[Tab]'</command>
  </action>
</keybind>

<!-- close window. Ctrl+w -->
<keybind key="F14">
  <action name="Execute">
    <command>xvkbd -no-jump-pointer -xsendevent -text '\Cw'</command>
  </action>
</keybind>

Reload Config File

After you changed the config, reload it, by

# reload openbox key config
openbox-lxde --reconfigure

Key Syntax

Modifier key syntax

For example, if you want 【Alt+7】, use <keybind key="A-7">.

Special Key Syntax

Key syntax for function keys. page up/down, home/end, tab, enter, etc, are standard X11 “keysyms”.

〔►see Linux: X11 Keyboard Key Names

For example, if you want 【Alt+】, use <keybind key="A-Up">.

Remove Keys

To remove keys, just delete the proper section.

For example, i want to remove【Ctrl+Alt+】 (because i need it for emacs). I delete the following:

<keybind key="C-A-Left">
  <action name="DesktopLeft">
    <dialog>no</dialog>
    <wrap>no</wrap>
  </action>
</keybind>

<keybind key="C-A-Right">
  <action name="DesktopRight">
    <dialog>no</dialog>
    <wrap>no</wrap>
  </action>
</keybind>

<keybind key="C-A-Up">
  <action name="DesktopUp">
    <dialog>no</dialog>
    <wrap>no</wrap>
  </action>
</keybind>

<keybind key="C-A-Down">
  <action name="DesktopDown">
    <dialog>no</dialog>
    <wrap>no</wrap>
  </action>
</keybind>

Disable Mouse Scroll Wheel Shade Window

Linux: LXDE/OpenBox, Disable Mouse Scroll Wheel Hide Window

Reference

http://openbox.org/wiki/Help:Bindings

Linux Desktop Topic

  1. Linux: How to Switch to LXDE, Xfce
  2. Linux: LXDE Keyboard Shortcuts
  3. Linux: LXDE/Openbox, Change Keyboard Shortcuts
  4. Linux: LXDE Set Key Repeat Rate
  5. Linux: LXDE/OpenBox, Disable Mouse Scroll Wheel Hide Window
  6. Linux: Xfce Keyboard Shortcuts
  7. Linux: Xfce Good Themes
  8. Linux: xmonad Keybinding
  9. Why Tiling Window Manager Sucks (xmonad, ratpoison, dwm, …)


  1. Linux: Set Default App
  2. Linux: Shell Commands for GUI Apps
  3. Linux: Image Viewers
  4. Linux: Move File to Trash by Command