mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
Merge pull request #1023 from malko42/swap-ctrl-fn
(feature) Add swapLeftCtrlAndFn
This commit is contained in:
commit
91010a5613
2 changed files with 17 additions and 0 deletions
|
@ -38,6 +38,12 @@ in
|
||||||
description = "Whether to swap the left Command key and left Alt key.";
|
description = "Whether to swap the left Command key and left Alt key.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.keyboard.swapLeftCtrlAndFn = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Whether to swap the left Control key and Fn (Globe) key.";
|
||||||
|
};
|
||||||
|
|
||||||
system.keyboard.userKeyMapping = mkOption {
|
system.keyboard.userKeyMapping = mkOption {
|
||||||
internal = true;
|
internal = true;
|
||||||
type = types.listOf (types.attrsOf types.int);
|
type = types.listOf (types.attrsOf types.int);
|
||||||
|
@ -66,6 +72,14 @@ in
|
||||||
HIDKeyboardModifierMappingSrc = 30064771298;
|
HIDKeyboardModifierMappingSrc = 30064771298;
|
||||||
HIDKeyboardModifierMappingDst = 30064771299;
|
HIDKeyboardModifierMappingDst = 30064771299;
|
||||||
})
|
})
|
||||||
|
(mkIf cfg.swapLeftCtrlAndFn {
|
||||||
|
HIDKeyboardModifierMappingSrc = 30064771296;
|
||||||
|
HIDKeyboardModifierMappingDst = 1095216660483;
|
||||||
|
})
|
||||||
|
(mkIf cfg.swapLeftCtrlAndFn {
|
||||||
|
HIDKeyboardModifierMappingSrc = 1095216660483;
|
||||||
|
HIDKeyboardModifierMappingDst = 30064771296;
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
system.activationScripts.keyboard.text = optionalString cfg.enableKeyMapping ''
|
system.activationScripts.keyboard.text = optionalString cfg.enableKeyMapping ''
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
system.keyboard.remapCapsLockToEscape = true;
|
system.keyboard.remapCapsLockToEscape = true;
|
||||||
system.keyboard.nonUS.remapTilde = true;
|
system.keyboard.nonUS.remapTilde = true;
|
||||||
system.keyboard.swapLeftCommandAndLeftAlt = true;
|
system.keyboard.swapLeftCommandAndLeftAlt = true;
|
||||||
|
system.keyboard.swapLeftCtrlAndFn = true;
|
||||||
|
|
||||||
test = ''
|
test = ''
|
||||||
echo checking keyboard mappings in /activate >&2
|
echo checking keyboard mappings in /activate >&2
|
||||||
|
@ -17,5 +18,7 @@
|
||||||
grep "\"HIDKeyboardModifierMappingDst\":30064771296" ${config.out}/activate
|
grep "\"HIDKeyboardModifierMappingDst\":30064771296" ${config.out}/activate
|
||||||
grep "\"HIDKeyboardModifierMappingDst\":30064771298" ${config.out}/activate
|
grep "\"HIDKeyboardModifierMappingDst\":30064771298" ${config.out}/activate
|
||||||
grep "\"HIDKeyboardModifierMappingDst\":30064771299" ${config.out}/activate
|
grep "\"HIDKeyboardModifierMappingDst\":30064771299" ${config.out}/activate
|
||||||
|
grep "\"HIDKeyboardModifierMappingDst\":30064771296" ${config.out}/activate
|
||||||
|
grep "\"HIDKeyboardModifierMappingDst\":1095216660483" ${config.out}/activate
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue