2023-09-30 14:20:45 +00:00
|
|
|
{ config, pkgs, ... }: {
|
2022-04-29 02:12:16 +00:00
|
|
|
|
2023-03-21 22:37:22 +00:00
|
|
|
config = {
|
2022-05-29 17:44:45 +00:00
|
|
|
|
2023-03-21 22:37:22 +00:00
|
|
|
services.xserver = {
|
2022-05-29 17:44:45 +00:00
|
|
|
|
2023-03-21 22:37:22 +00:00
|
|
|
layout = "us";
|
2022-04-29 02:12:16 +00:00
|
|
|
|
2023-03-21 22:37:22 +00:00
|
|
|
# Keyboard responsiveness
|
|
|
|
autoRepeatDelay = 250;
|
|
|
|
autoRepeatInterval = 40;
|
|
|
|
|
2023-06-06 03:50:01 +00:00
|
|
|
};
|
2023-03-21 22:37:22 +00:00
|
|
|
|
2023-06-06 03:50:01 +00:00
|
|
|
# Use capslock as escape and/or control
|
|
|
|
services.keyd = {
|
|
|
|
enable = true;
|
2023-07-25 03:16:48 +00:00
|
|
|
keyboards = {
|
|
|
|
default = {
|
|
|
|
ids = [ "*" ];
|
2023-10-07 12:58:34 +00:00
|
|
|
settings = {
|
|
|
|
main = { capslock = "overload(control, esc)"; };
|
|
|
|
|
|
|
|
# Fix: ctrl-click sends escape afterwards
|
|
|
|
# Suppresses escape if held for more than 500ms
|
|
|
|
# https://github.com/rvaiya/keyd/issues/424
|
|
|
|
global = { overload_tap_timeout = 500; };
|
|
|
|
};
|
2023-07-25 03:16:48 +00:00
|
|
|
};
|
|
|
|
};
|
2023-03-21 22:37:22 +00:00
|
|
|
};
|
|
|
|
|
2023-09-30 14:20:45 +00:00
|
|
|
# For some reason, keyd doesn't restart properly when updating
|
|
|
|
system.activationScripts.keyd.text =
|
|
|
|
"${pkgs.systemd}/bin/systemctl restart keyd.service";
|
|
|
|
|
2023-03-21 22:37:22 +00:00
|
|
|
# Enable num lock on login
|
|
|
|
home-manager.users.${config.user}.xsession.numlock.enable = true;
|
2022-05-29 17:44:45 +00:00
|
|
|
|
2022-04-29 02:12:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|