Linux: xbindkeys Tutorial

By Xah Lee. Date: . Last updated: .

xbindkeys is a tool to let you create keyboard shortcuts to run shell commands, globally.

xbindkeys can bind almost any key or key combination. Example: CapsLock, ScrLk, Pause, F2, number pad keys, multimedia keys, and special app launch buttons, and also standard modifier key combinations such as ▤ Menu, 【Ctrl+3】, 【Super+3】, etc.

Install xbindkeys

# install xbindkeys
sudo apt-get install xbindkeys

xbindkeys config file

Create a file at


Add the following content:

# sample xbindkeys config
# place this file at ~/.xbindkeysrc

# make F8 launch Google Chrome browser

# make F3 do Ctrl+c
"xvkbd -no-jump-pointer -xsendevent -text '\Cc'"

Mouse button example:

# mouse button 9 sends Control + PageUp
"xvkbd -xsendevent -text '\C\[Page_Up]'"

# mouse button 8 sends Control + PageDown
"xvkbd -xsendevent -text '\C\[Page_Down]'"

For each keybinding in this example, the xbindkeys config takes 2 lines.

Reload the Config File

Reload the config file:

# make xbindkeys reload config
killall -s1 xbindkeys

Start xbindkeys:

# start xbindkeys daemon
xbindkeys -f ~/.xbindkeysrc


To fully use xbindkeys, you need to know what shell scripts to call.

Sending Keys

To have shell command send keys, you need to install xvkbd.

[see Linux: xvkbd tutorial]

Launching App

Use the app's command name directly. For example,

For GUI app command names or how to find the name, see:

Open File

Call xdg-open to open file.

xdg-open ~/todo.txt

Switch Windows

Linux: Add Keyboard Shortcut to Switch App

Control Sound

Linux: Change Volume by Command

Linux Keybinding How-to

  1. Keyboard Software Guide
  2. Swap Control Alt Keys
  3. Set F2 F3 F4 to Cut Copy Paste
  4. CapsLock → Escape
  5. CapsLock → Home
  6. Shift Lock
  7. Key to Switch App
  8. Key Repeat Rate
  9. System Keyboard Layout
  10. Switch Keyboard Layout
  11. Change Volume
  12. xmodmap
  13. xbindkeys
  14. xvkbd
  15. Find Keyboard Key Scancode
  16. X11 Keyboard Key Names
  17. 2 Layouts for 2 Keyboards
  18. Chinese Input Setup


  1. Mouse Hover to Auto-Raise Window
  2. Mouse Hover-Click
  3. Set Mouse Single-Click to Open File
  4. How to Set Mouse Speed
  5. How to Swap Mouse Buttons
  6. Set Trackball/Mouse Do Scroll
  7. Setup Accelerated Scroll and AutoScroll
  8. X11 Mouse Button Numbering

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