mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-28 02:37:09 +00:00
add new option - system.keyboard.swapLeftCommandAndLeftAlt
This commit is contained in:
parent
2a60ef1956
commit
bf0ac204bd
2 changed files with 17 additions and 1 deletions
|
@ -32,6 +32,12 @@ in
|
|||
description = "Whether to remap the Tilde key on non-us keyboards.";
|
||||
};
|
||||
|
||||
system.keyboard.swapLeftCommandAndLeftAlt = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether to swap the left Command key and left Alt key.";
|
||||
};
|
||||
|
||||
system.keyboard.userKeyMapping = mkOption {
|
||||
internal = true;
|
||||
type = types.listOf (types.attrsOf types.int);
|
||||
|
@ -52,6 +58,14 @@ in
|
|||
(mkIf cfg.remapCapsLockToControl { HIDKeyboardModifierMappingSrc = 30064771129; HIDKeyboardModifierMappingDst = 30064771296; })
|
||||
(mkIf cfg.remapCapsLockToEscape { HIDKeyboardModifierMappingSrc = 30064771129; HIDKeyboardModifierMappingDst = 30064771113; })
|
||||
(mkIf cfg.nonUS.remapTilde { HIDKeyboardModifierMappingSrc = 30064771172; HIDKeyboardModifierMappingDst = 30064771125; })
|
||||
(mkIf cfg.swapLeftCommandAndLeftAlt {
|
||||
HIDKeyboardModifierMappingSrc = 30064771299;
|
||||
HIDKeyboardModifierMappingDst = 30064771298;
|
||||
})
|
||||
(mkIf cfg.swapLeftCommandAndLeftAlt {
|
||||
HIDKeyboardModifierMappingSrc = 30064771298;
|
||||
HIDKeyboardModifierMappingDst = 30064771299;
|
||||
})
|
||||
];
|
||||
|
||||
system.activationScripts.keyboard.text = optionalString cfg.enableKeyMapping ''
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
system.keyboard.remapCapsLockToControl = true;
|
||||
system.keyboard.remapCapsLockToEscape = true;
|
||||
system.keyboard.nonUS.remapTilde = true;
|
||||
system.keyboard.swapLeftCommandAndLeftAlt = true;
|
||||
|
||||
test = ''
|
||||
echo checking keyboard mappings in /activate >&2
|
||||
|
@ -14,6 +15,7 @@
|
|||
grep "\"HIDKeyboardModifierMappingDst\":30064771113" ${config.out}/activate
|
||||
grep "\"HIDKeyboardModifierMappingDst\":30064771125" ${config.out}/activate
|
||||
grep "\"HIDKeyboardModifierMappingDst\":30064771296" ${config.out}/activate
|
||||
grep "\"HIDKeyboardModifierMappingDst\":30064771298" ${config.out}/activate
|
||||
grep "\"HIDKeyboardModifierMappingDst\":30064771299" ${config.out}/activate
|
||||
'';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue