XCHAINKEYS(1)
๐ XCHAINKEYS(1) ๐
okay bestie, so this is the manual page for xchainkeys โ yes it's section 1, we love that for it ๐
โ and honestly? it's giving main character energy for your keyboard. let's get into it.
โจ NAME โจ
xchainkeys โ chained keybindings for X11. that's it. that's the vibe. ๐ฆ
โจ SYNOPSIS โจ
xchainkeys [options]
โจ DESCRIPTION โจ
so xchainkeys is a standalone X11 program that lets you create chained key bindings โ like the ones you already simp for in the ratpoison(1) window manager or the screen(1) terminal multiplexer. no cap, it just does that. ๐ฅ
โจ OPTIONS โจ
-f,--file<filename> โ load an alternative configuration file. (yes, you can have more than one. we stan options ๐)-k,--keysโ interactively show valid keyspecs for key combinations. basically a little keyspec oracle, use it, fr fr.-d,--debugโ show debug messages onstdout. for when you're in your detective era ๐ต๏ธ-h,--helpโ show usage information. classic. iconic. never misses.-v,--versionโ show version information. ๐ซ
๐ธ CONFIGURATION ๐ธ
your config file lives at
~/.config/xchainkeys/xchainkeys.conf
and the XDG_CONFIG_HOME environment variable will be respected, in compliance with the XDG Base Directory Specification (see REFERENCES below, bestie, it's all linked up ๐ซถ).
an example configuration file has been installed to
/nix/store/bx08n3ddbz4b40z7ymwhrvdxymmqaal7-xchainkeys-0.11/share/doc/xchainkeys/example.conf
yes that whole path. copy it exactly. it's not a typo, it's just Nix being Nix ๐ญ
Syntax
every line may contain either a global setting or a keybinding definition. empty lines and lines starting with a numbersign (#) are ignored. so go ahead and comment your heart out, queen ๐
Global Settings
global settings are defined as key-value pairs, separated by whitespace. simple, clean, slay.
timeout <n>(default:3000) โ waitnmilliseconds for another key to be pressed before aborting an active keychain. a value of0will prevent automatic timeout. this value may be overridden by atimeoutargument supplied to an:enteraction โ see Actions below, iykyk โณfeedback <on|off>(default:on) โ show feedback in a small popup window. a literal little popup, adorable.delay <n>(default:1000) โ show current chain status afternmilliseconds of inactivity in an active chain.hold <n>(default:<delay>) โ show error messages fornmilliseconds after a chain has been aborted. if not set, the value ofdelaywill be used. (yes, it inherits. nepotism but make it config ๐)position <x|offset|mouse|center> [<y>](default:center) โ the position of the feedback window. an absolute position can be specified with thexandyarguments. a relative position can be specified using theoffsetportion of a standard X geometry string. the valuemousewill cause the window to appear centered around the current mouse pointer position. the valuecenterwill center the window on the default screen. go ahead, place it anywhere, be free ๐font <fontstring>(default:fixed) โ the X11 font to use for text in the feedback window. make it cute if you want idc.foreground <name|#rrggbb>(default:black) โ the foreground color of the text and the border of the feedback window.background <name|#rrggbb>(default:white) โ the background color of the feedback window. aesthetic is customizable, thank god ๐จ
Keybindings
keybindings are defined using the following syntax:
<keyspec> [<keyspec>...] :<action> ["<name>"] [<arguments>...]
a keyspec consists of one or more optional modifier names, followed by either a symbolic key name or a numeric keycode, each separated by a hyphen (-):
<mod>-[<mod>-...]<keyname|keycode>
modifier names, bestie, here's the cheat sheet ๐:
S,Shift= Shift keyC,Ctrl= Control keyA,M,Alt,Meta= Alt keyW,H,Super,Hyper,Windows= Super key
the generic modifier names Shift, Lock, Control, Mod1, Mod2, Mod3, Mod4 and Mod5 are recognized in addition to the above. so many names, all valid, we love a flexible icon โจ
key names correspond to the symbolic key names defined in /usr/include/X11/keysymdef.h (with their XK_ prefix removed).
numeric keycodes may be supplied in decimal, hexadecimal or octal format, e.g. 16 (decimal) = 0x10 (hexadecimal) = 020 octal. math girlies rise ๐งฎ
you can use xchainkeys -k to find the proper keyspec for key combinations. genuinely such a lifesaver, ngl.
Actions
:enter [timeout=<n>] [abort=<auto|manual>]โ enters a keychain. the keyboard will be grabbed exclusively until another keystroke has been processed, or until the chain times out afternmilliseconds. if the key is bound within this chain, the associated action will be invoked, otherwise the user will be notified that an unbound key has been pressed. (rude of them but okay ๐)
if the abort argument is set to manual, the chain prefix will remain activated and further keystrokes will be processed until the chain is manually aborted with the :abort action. if set to auto (the default), the chain will abort immediately after the first keystroke has been processed.
if the timeout argument is omitted, the global timeout setting will apply. a value of 0 disables the timeout for this chain.
:abortโ abort the current keychain, releasing any previous grab on the keyboard. if not explicitly bound,:abortwill be bound to prefixC-gby default. the panic button, but make it chic ๐:escapeโ send the prefix key key of this chain to the currently focused window and abort the chain. if not explicitly bound,:escapewill be bound to prefix prefix, e.g. for a chain prefixed withC-tthe:escapeaction will be bound toC-t C-tby default.
this feature is implemented using XSendEvent(3). note that applications may refuse to accept synthetic events generated with XSendEvent. yeah. that's a real caveat, don't come for me, it's in the source ๐ซ
:exec [abort=auto] <command>โ asynchronously executecommandas a shell command. ifabort=autois given, this binding will always abort the current chain after executing the command, even if the chain was entered withabort=manual. (overachiever behavior, honestly ๐):wait <command>โ ungrabs the keyboard, executescommandas a shell command, waits until the command has completed and grabs the keyboard again if necessary. use this action to run commands that also grab the keyboard (e.g.scrot --select). sharing is caring ๐ซถ:group ["<name>"] [abort=auto] <command>โ associate a binding with a named group and asynchronously executecommandas a shell command.
when a :group action is activated, timeout and automatic abort are disabled for the current chain prefix, and only bindings in the same group will be recognized for subsequent key presses. any other keys will abort the chain and revert the above changes.
if abort=auto is given for particular binding within a group, this binding will always abort the current chain after executing the command, effectively overriding the implied abort=manual option.
in addition, if the key used to abort the chain key is a toplevel chain prefix key, the corresponding chain will be entered immediately after this chain aborts. see EXAMPLES below for possible uses.
if no explicit name is given, the group name "default" is used.
:repeat <command>โ deprecated. equivalent to:group "default". it's giving legacy code, we still love her though ๐ฏ๏ธ:load [<filename>]:reload [<filename>]โ clear the current bindings and (re)load the configuration file specified byfilename. if no file is specified, the current configuration file is reloaded. refresh, restart, rebrand โจ
๐ฅ EXAMPLES ๐ฅ
bind the key sequence "Control-t Return" to run xterm:
C-t Return :exec xterm
this implies creating a default chain with the prefix key C-t, containing default bindings for the :abort and :escape actions, and is thus equivalent to
C-t :enter timeout=3000 abort=auto
C-t C-t :escape
C-t C-g :abort
C-t Return :exec xterm
note that the number of keys in a keychain is not limited, e.g
C-t x c h a i n k e y s :exec xmessage "xchainkeys!"
can be invoked by pressing C-t and then typing "xchainkeys". typing out a whole word as a shortcut, we love an extra queen ๐
the following example creates a named :group of bindings to implement a dedicated frame resize mode for the musca(1) window manager:
C-w i :group "resize" musca -c 'resize up'
C-w k :group "resize" musca -c 'resize down'
C-w j :group "resize" musca -c 'resize left'
C-w l :group "resize" musca -c 'resize right'
C-w ... (other bindings for window management)
invoke any of the above bindings (e.g. press C-w i) and then continue to press i, k, j or l to resize the current musca frame. since timeout and automatic abort are disabled, you can continue resizing until you are satisfied with the result. then simply press any other key to quit resize mode. if you want to invoke another window management command right away, you can use C-w to quit resize mode and immediately enter the C-w chain (or any other toplevel chain) again. it's giving seamless transitions, we're obsessed ๐ฆ
the benefit of using a named :group over a dedicated chain with timeout=0 and abort=manual is that you don't have to waste another prefix key. instead you can temporarily redefine an existing chain to contain only a specific subset of keys, behaving in the desired manner. efficiency slay ๐
๐ KNOWN ISSUES ๐
some window managers assume that no other program has grabbed any global key combinations before them, and may fail with a fatal error when trying to grab a key that has already been grabbed as a prefix key by xchainkeys. this situation is likely to occur when xchainkeys is started before the window manager in ~/.xinitrc. the audacity, honestly ๐ญ
in general, binding the same key combinations in xchainkeys and other programs should be avoided. just don't do it bestie, it's not worth the drama.
๐ BUGS ๐
this software is currently in beta state. please file bugs on the googlecode issue tracker.
http://code.google.com/p/xchainkeys/issues
use the email address below for questions, feature requests and comments. we're listening ๐ซถ
ยฉ๏ธ COPYRIGHT ยฉ๏ธ
Copyright (C) 2010-2012 Henning Bekel <h.bekel@googlemail.com>
๐ LICENSE ๐
xchainkeys is licensed under the GNU General Public License v3, see http://www.gnu.org/licenses/gpl.html. legal queen behavior, we respect it โ๏ธ
๐ REFERENCES ๐
- X11 key symbols โ
/usr/include/X11/keysymdef.h - XDG Base Directory Specification โ
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
๐ SEE ALSO ๐
Xorg(1) screen(1) ratpoison(1) musca(1)
okay that's the whole thing bestie, go forth and chain your keys ๐โจ
lowkey this page is from the Linux manual set, dated 2010-09-16 โ vintage but still iconic, like a good pair of jeans. mwah ๐ ๐ฆ ๐
๐ฆ where this page comes from
- nixos 26.05: xchainkeys 0.11
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms