xbindkeys man page

xbindkeys — a grabbing keys program for X


xbindkeys [ options ]


XbindKeys is a program that grab keys and mouse button events  in X and starts associated shell command.

Command Line Options

Available command line options are as follows:

-d, --defaults

Print a default rc file

-f, --file

Use an alternative rc file

-h, --help

Short help on options plus version/author info.

-X, --display

Set X display to use

-v, --verbose

More information on xbindkeys when it run

-k, --key

Identify one key pressed (useful to fill the configuration file)

-mk, --multikey

Identify multi key pressed (useful to fill the configuration file)

-g, --geometry

size and position of window with -k|-mk option

-n, --nodaemon

don't start as daemon

If guile support have not been disabled:

-dg, --defaults-guile

Print a default guile configuration file

-fg, --file-guile

Use an alternative guile configuration file


XBindKeys uses a configuration files.  This file is $HOME/.xbindkeysrc, used only for one user. All whitespace is ignored in the files except for within  the commands names double quotes.

The configuration file consists of commands names in double quotes, and associated keys in the next line.

Comments are started with a pound (#) and extend to the end of the line.

You can see a default file with the --defaults option or create a default $HOME/.xbindkeysrc with

 'xbindkeys --defaults > $HOME/.xbindkeysrc'.


The program expects combinations of keysyms to be used by using plus(+)  characters to combine them together.

The format of a command line is:

    "command to start &"
       associated key

To specify an associated key, you can use 'xbindkeys --key' or
'xbindkeys --multikey' and put one of the two lines in the  configuration file.

A list of keys is in /usr/include/X11/keysym.h and in /usr/include/X11/keysymdef.h. The XK_ is not needed.

List of modifiers:

    Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock),
    Mod3 (CapsLock), Mod4, Mod5 (Scroll).

The release modifier is not a standard X modifier, but you can use it if you want to catch release events instead of press events.

By defaults, xbindkeys does not pay attention with the modifiers NumLock, CapsLock and ScrollLock. Add the lines above in the configuration file, if you want to pay  attention to them.

   keystate_numlock = enable

    keystate_capslock = enable
    keystate_scrolllock= enable


# control+shift+d starts an xterm (it's a comment)

  control+shift + q

# Menu key starts xbindkeys_show

# Control + mouse button 1 starts an xterm
  Control + b:1

# Control+Shift+a  release event starts rxvt
  release+control+shift + a

# Control + mouse button 2 release event starts rxvt
  Control + b:2 + Release

Scheme Configuration Style

If the guile support have not been disabled, you can use an alternate configuration file written in scheme. xbindkeys read first the scheme configuration file, and if this file doesn't exist, it read the standard configuration file.

For more details, please see here


Note: The guile configuration file is the prefered way if you have a non trivial
configuration like for example double click, timed click or keys combinations.

The defaults is ~/.xbindkeysrc.scm

Use xbindkeys --defaults-guile for more details.

And xbindkeys --defaults-guile > ~/.xbindkeysrc.scm to use this method.


xbindkeys reload its configuration file each time it has changed. But if you want to force it reloading its configuration file, you can send a HUP signal:

killall -HUP xbindkeys

When HUP signal is send to xbindkeys, changes in $HOME/.xbindkeysrc  takes effect only after moving mouse.


If you find a bug, please send a mail to <hocwp@free.fr>




Philippe Brochard <hocwp@free.fr>

Marcello Mathias Herreshoff for the guile support <marcello@hummer.stanford.edu>


        The users configuration file.

        The users configuration file in scheme style (if guile support have not been disabled).

See Also

    Utility for showing the actual keybinding with xbindkeys
    Utility for modifying keymap & button mappings in X.
    Print contents of X events.
    X11 KeySym definitions.

Referenced By


Wed Apr 18 2007