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: xvkbd tutorial]

<!-- 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

  1. How to Switch to LXDE, Xfce
  2. LXDE Keyboard Shortcuts
  3. LXDE/Openbox, Change Keyboard Shortcuts
  4. LXDE Set Key Repeat Rate
  5. LXDE/OpenBox, Disable Mouse Scroll Wheel Hide Window
  6. Xfce Keyboard Shortcuts
  7. Xfce Good Themes
  8. xmonad Keybinding
  9. Why Tiling Window Manager Sucks
  10. Set Default App
  11. Shell Commands for GUI Apps
  12. Image Viewers
  13. Move File to Trash by Command

If you have a question, put $5 at patreon and message me.