summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
authorc4710n <c4710n@users.noreply.github.com>2020-10-23 22:47:38 +0800
committerc4710n <c4710n@users.noreply.github.com>2020-10-23 22:47:38 +0800
commitbf0ac204bdf3d5b023ac039a661f9fd7c17d835c (patch)
tree9fdb9bd0ba9e079cd8a74b03e0edc702be4bf0fe /modules/system
parent2a60ef1956ed7d000d3941d720e17a25450c6923 (diff)
add new option - system.keyboard.swapLeftCommandAndLeftAlt
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/keyboard.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/system/keyboard.nix b/modules/system/keyboard.nix
index d4b7c8f..c637f04 100644
--- a/modules/system/keyboard.nix
+++ b/modules/system/keyboard.nix
@@ -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 ''