21 lines
707 B
Nix
21 lines
707 B
Nix
{ config, pkgs, ... }:
|
|
|
|
{
|
|
# Key remapping using hidutil via launchd agent
|
|
# Swaps Caps Lock -> Left Control, Right Control -> Caps Lock
|
|
launchd.user.agents.remap-keys = {
|
|
serviceConfig = {
|
|
ProgramArguments = [
|
|
"/usr/bin/hidutil"
|
|
"property"
|
|
"--set"
|
|
''{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x7000000E0},{"HIDKeyboardModifierMappingSrc":0x7000000E4,"HIDKeyboardModifierMappingDst":0x700000039}]}''
|
|
];
|
|
RunAtLoad = true;
|
|
KeepAlive = false;
|
|
Label = "org.nixos.remap-keys";
|
|
StandardErrorPath = "/tmp/remap-keys.err";
|
|
StandardOutPath = "/tmp/remap-keys.out";
|
|
};
|
|
};
|
|
}
|