LinuxCommandLibrary

keyd

Remap keyboard keys and create macros

TLDR

Start and enable the keyd service

$ systemctl enable keyd --now
copy

Display keypress information
$ sudo keyd monitor
copy

Reset bindings and reload the configuration files in /etc/keyd
$ sudo keyd reload
copy

List all valid key names
$ keyd list-keys
copy

Create a temporary binding
$ sudo keyd bind "[pressed_key] = [output_key]
copy

SYNOPSIS

keyd [options]

PARAMETERS

-h, --help
    Show help message and exit.

-v, --version
    Show version information and exit.

-f, --foreground
    Run in the foreground (do not daemonize).

-c, --config
    Specify an alternate configuration file path.

-w, --watch
    Watch for config changes.

DESCRIPTION

keyd is a keyboard configuration daemon that provides a powerful and flexible way to customize keyboard layouts and behavior on Linux systems.

It allows users to remap keys, define custom macros, switch layers with customizable behavior on key press, hold or release and use advanced features like chorded key presses. Keyd differs from traditional keyboard configuration tools like Xmodmap by operating at a lower level, directly interacting with the input subsystem. This allows for greater precision and avoids compatibility issues with some applications.

Configuration is done via a configuration file, typically located in `/etc/keyd/`. The daemon monitors this file for changes and automatically reloads the configuration. Keyd aims to provide a robust and predictable keyboard experience across different applications and desktop environments.

CAVEATS

Keyd requires root privileges to run and directly interacts with the input subsystem. Incorrect configuration can lead to an unusable keyboard, so careful planning and testing are recommended. Graphical configuration is not provided.

CONFIGURATION FILE

The keyd configuration file uses a custom syntax to define keyboard layouts, key remappings, and other settings. See `man keyd` for full specifications.

HISTORY

Keyd was created to provide a robust and flexible alternative to existing keyboard configuration tools. It aims to address limitations and inconsistencies encountered when using tools like Xmodmap, especially in modern Linux environments. Development focuses on providing a low-level solution that integrates seamlessly with the Linux input subsystem.

SEE ALSO

xmodmap(1), loadkeys(1)

Copied to clipboard