This is a small utility that makes a short press of the Control-key act as a press of the Escape-key. It can significantly ease the development workflow when using a text editor such as Vim. Because it is written in C, this program is also very performant with minimal memory overhead.
🚀 Now automatically detects hotplugging of keyboards!
An APT repository will soon be availabe so that the latest version can be easily installed.
If you trust it, evcape is available on the AUR:
paru -Suy evcapeEnable on boot with sudo systemctl enable --now evcape.
Assuming your NixOS itself runs on flakes, you need to add two lines to your configuration.
/etc/nixos/flake.nix
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
inputs.evcape.url = "github:samvv/evcape"; # Add this line
outputs = { self, nixpkgs, evcape }: { # Modify this line
nixosConfigurations.xana = nixpkgs.lib.nixosSystem {
modules = [
./configuration.nix
evcape.nixosModules.default # Add this line
];
};
};
}Make sure you have the right packages installed. On Debian/Ubuntu, this will look something like this:
sudo apt install libudev-dev libevdev-devEnsure Meson is installed on your system.
python3 -m pip install -U --user mesonTo install the package, simply run the following command:
Warning
This will install configuration files that are expected to run on standard Debian distros. When in doubt, build the service using the instructions below and review each file before installing it.
sudo make installThis will install the following files:
/etc/systemd/system/evcape.service/usr/bin/evcape
You might want to run the following commands to activate evcape immediately
and on startup:
sudo systemctl enable --now evcape
If you just want the binary, run the following commands:
meson setup build
ninja -C build evcapeThe binary will be available as build/evcape.
For GNOME, use the following command to copy Ctrl to CapsLock.
Warning
This command overrides existing configuration!
gsettings set org.gnome.desktop.input-sources xkb-options "['ctrl:nocaps']"Alternatively, the following command might work when working on Xwayland or X11:
setxkbmap -option "ctrl:nocaps"Simply run evcape with sudo privileges and you're good to go!
evcape needs sudo privileges because it intercepts and then injects raw key events from/to the keyboard subsystem. Because Wayland does not offer a standard protocol to do the same, the driver is where we need to be.
The following environment variables can be set to influence the behavior of evcape:
| Name | |
|---|---|
EVCAPE_LOG_LEVEL |
An integer from 0 (no logging) to 6 (log everything) |
- A Python implementation of evcape
- Interception Tools and in particular caps2esc
This code is generously licensed under the MIT license.