nix/module/common/KbdInterception.nix

12 lines
487 B
Nix
Raw Normal View History

2024-04-04 21:55:44 +03:00
{ pkgs, ... }: {
# Map CapsLock to Esc on single press and Ctrl on when used with multiple keys.
services.interception-tools = {
enable = true;
plugins = [ pkgs.interception-tools-plugins.caps2esc ];
udevmonConfig = builtins.toJSON [{
JOB = "${pkgs.interception-tools}/bin/intercept -g $DEVNODE | ${pkgs.interception-tools-plugins.caps2esc}/bin/caps2esc | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE";
DEVICE.EVENTS.EV_KEY = [ "KEY_CAPSLOCK" "KEY_ESC" ];
}];
};
}