summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2020-10-24 19:26:23 +0200
committerGitHub <noreply@github.com>2020-10-24 19:26:23 +0200
commitb346a283a8b04d8ca2a73c86c6fde53a5383f852 (patch)
tree9fdb9bd0ba9e079cd8a74b03e0edc702be4bf0fe /modules/system
parent2a60ef1956ed7d000d3941d720e17a25450c6923 (diff)
parentbf0ac204bdf3d5b023ac039a661f9fd7c17d835c (diff)
Merge pull request #238 from c4710n/feature/swap-command-alt
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 ''