gitmyhub

xkeysnail

★ 0 updated 2y ago ⑂ fork

Yet another keyboard remapping tool for X environment

A Linux keyboard remapping tool that lets you create complex, context-sensitive key mappings that change behavior depending on which app you're using, written as a Python config file.

PythonLinuxX11setup: moderatecomplexity 3/5

xkeysnail is a keyboard remapping tool for Linux systems running the X window system. It lets you change what your keys do — not just simple swaps like turning Caps Lock into Ctrl, but complex, context-sensitive remappings that behave differently depending on which application you're using. If you've ever wanted Emacs-style shortcuts everywhere, or wished a specific key combo did something different in Firefox versus your terminal, this is the kind of tool that makes that possible.

The tool works at a low level in the Linux input system, which means your remappings apply almost everywhere — not just in applications that explicitly support custom shortcuts. You write a Python configuration file that defines keymaps, each with a condition and a set of mappings. The condition can match a specific application (by its internal window class name), or you can set a global keymap that always applies. Mappings can remap a single key to another, chain multiple actions together, define two-step shortcuts like Ctrl-x then Ctrl-c, or even run arbitrary Python code when a key is pressed. The example config ships with Emacs-like bindings that work across most applications, which is a common use case.

This is primarily for power users on Linux who want fine-grained control over their keyboard layout — developers who live in Emacs-style keybindings but need to use other apps, people switching between different keyboard habits, or anyone who wants application-specific shortcut behavior. The tradeoff is that it requires root privileges to run, since it operates at the system input level. It also only works with X, not newer display servers like Wayland. The configuration is done entirely through a Python file, so some comfort with basic Python syntax helps, though the example config provides patterns you can adapt without deep programming knowledge.

Where it fits