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 Shell Basics

  1. Get System Info
  2. Shell Basics
  3. grep, cat, awk, uniq
  4. sort
  5. find, xargs
  6. diff Files/Dir
  7. dir size: du
  8. dir tree
  9. tar gzip bzip2 xz 7zip rar zip
  10. wget, curl, GET, HEAD
  11. rsync
  12. Install Packages

Sys Admin

  1. Job Control
  2. ps
  3. top
  4. htop
  5. RAM stat
  6. Users and Groups
  7. File Permission
  8. Opened Files: lsof
  9. shutdown, sleep

Bash/Terminal

  1. Bash Keys, Terminal Keys, Man Page Keys
  2. Bash Prompt Setup
  3. Bash Color Prompt
  4. .bashrc, .profile, .bash_profile
  5. Virtual Console
  6. Terminal Control Sequence Keys
  7. Reset Terminal
  8. tmux
  9. man page
  10. Bash Manual in Chapters
  11. BASH Shell Misc Tips
  12. Log Terminal Session

Linux Desktop

  1. Most Useful GUI Apps
  2. Set Default App
  3. Shell Commands for GUI Apps
  4. Image Viewers
  5. Music Players
  6. Move File to Trash by Command
  7. X11 Selection and Clipboard
  8. How to Switch to LXDE, Xfce
  9. LXDE Keyboard Shortcuts
  10. LXDE/Openbox, Change Keyboard Shortcuts
  11. LXDE Set Key Repeat Rate
  12. LXDE/OpenBox, Disable Mouse Scroll Wheel Hide Window
  13. Xfce Keyboard Shortcuts
  14. Xfce Good Themes
  15. xmonad Keybinding
  16. How to Restart X11
  17. Why Tiling Window Manager Sucks
  18. Standard Fonts
  19. How to Install Font

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