Add key remap for macos
This commit is contained in:
parent
ca5e386200
commit
3d5883898f
2 changed files with 23 additions and 0 deletions
|
|
@ -3,6 +3,7 @@
|
|||
{
|
||||
imports = [
|
||||
../../modules/homebrew.nix
|
||||
../../modules/keyboard.nix
|
||||
nix-homebrew.darwinModules.nix-homebrew
|
||||
];
|
||||
|
||||
|
|
|
|||
22
modules/keyboard.nix
Normal file
22
modules/keyboard.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Key remapping using hidutil via launchd agent
|
||||
# This swaps Control and Caps Lock keys bidirectionally
|
||||
|
||||
launchd.user.agents.remap-keys = {
|
||||
serviceConfig = {
|
||||
ProgramArguments = [
|
||||
"/usr/bin/hidutil"
|
||||
"property"
|
||||
"--set"
|
||||
''{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x7000000E0},{"HIDKeyboardModifierMappingSrc":0x7000000E0,"HIDKeyboardModifierMappingDst":0x700000039}]}''
|
||||
];
|
||||
RunAtLoad = true;
|
||||
KeepAlive = false;
|
||||
Label = "org.nixos.remap-keys";
|
||||
StandardErrorPath = "/tmp/remap-keys.err";
|
||||
StandardOutPath = "/tmp/remap-keys.out";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue