From ArchWiki
Revision as of 04:53, 17 August 2010 by Infiniteh (Talk | contribs) (overall cleanup; added more info about command output + a longer example config)

Jump to: navigation, search

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n links end


Xbindkeys is a program that enables us to bind commands to certain keys or key combinations on the keyboard. Xbindkeys works with multimedia keys and is window manager / DE independent, so if you switch much, xbindkeys is very handy.


Xbindkeys is available in the extra repository:

# pacman -S xbindkeys

There is also a GUI for xbindkeys [1] which is in AUR.


Create a file named Template:Filename in your home directory:

touch ~/.xbindkeysrc

Now you can either edit Template:Filename to set keybindings, or you can do that with the GUI.


To see the format of a configuration file entry, enter the following command:

xbindkeys -k

A blank window will pop up. Press the key(s) to which you wish to assign a command and xbindkeys will output a handy snippet that can be entered into Template:Filename. For example, while the blank window is open, press Alt + o to get the following output (results may vary):

"(Scheme function)"
    m:0x8 + c:32
    Alt + o

The first line represents a command. The second contains the state (0x8) and keycode (32) as reported by Template:Codeline. The third line contains the keysyms associated with the given keycodes. To use this output, copy the three lines to Template:Filename and replace "(Scheme function)" with the command you wish to perform. Here is an example configuration file that binds Fn key combos on a laptop to Template:Codeline commands that adjust sound volume. Note that pound (#) symbols can be used to create comments.

# Increase volume
"amixer set Master playback 1+"
    m:0x0 + c:123

# Decrease volume
"amixer set Master playback 1-"
    m:0x0 + c:122

# Toggle mute
"amixer set Master toggle"
    m:0x0 + c:121
Tip: Use xbindkeys -mk to keep the key prompt open for multiple keypresses. Press q to quit.

GUI method

If you installed the xbindkeys_config package, just run:



Once you're done configuring your keys, edit your Template:Filename and place

xbindkeys &

before the line that starts your window manager or DE.