Keyd : Migrate from KbdIntercept, thanks to lowlife.

This commit is contained in:
Dmitry Voronin 2024-04-24 03:32:59 +03:00
parent 632dd69d8a
commit e4cbc297fd
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
2 changed files with 22 additions and 11 deletions

View file

@ -1,11 +0,0 @@
{ 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" ];
}];
};
}

22
module/common/Keyd.nix Normal file
View file

@ -0,0 +1,22 @@
{ ... }: {
services.keyd = {
enable = true;
keyboards.default = {
ids = [ "*" ];
settings = {
main = {
capslock = "overload(control, esc)";
compose = "layer(compose)";
esc = "capslock";
rightalt = "layer(rightalt)";
rightcontrol = "layer(rightcontrol)";
rightshift = "layer(rightshift)";
};
rightalt = {};
rightcontrol = {};
rightshift = {};
compose = {};
};
};
};
}