1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-28 02:37:09 +00:00

keyboard: add test for keyboard mappings

This commit is contained in:
Daiderd Jordan 2018-01-08 22:21:57 +01:00
parent d05229ca0d
commit 5303f80542
No known key found for this signature in database
GPG key ID: D02435D05B810C96
2 changed files with 17 additions and 0 deletions

View file

@ -96,6 +96,7 @@ let
tests.nixpkgs-overlays = makeTest ./tests/nixpkgs-overlays.nix;
tests.services-activate-system = makeTest ./tests/services-activate-system.nix;
tests.system-defaults-write = makeTest ./tests/system-defaults-write.nix;
tests.system-keyboard-mapping = makeTest ./tests/system-keyboard-mapping.nix;
tests.system-packages = makeTest ./tests/system-packages.nix;
tests.system-path-bash = makeTest ./tests/system-path-bash.nix;
tests.system-path-fish = makeTest ./tests/system-path-fish.nix;

View file

@ -0,0 +1,16 @@
{ config, pkgs, ... }:
{
system.keyboard.enableKeyMapping = true;
system.keyboard.remapCapsLockToControl = true;
system.keyboard.remapCapsLockToEscape = true;
test = ''
echo checking keyboard mappings in /activate >&2
grep "hidutil property --set '{\"UserKeyMapping\":.*}'" ${config.out}/activate
grep "\"HIDKeyboardModifierMappingSrc\":30064771129" ${config.out}/activate
grep "\"HIDKeyboardModifierMappingDst\":30064771296" ${config.out}/activate
grep "\"HIDKeyboardModifierMappingDst\":30064771113" ${config.out}/activate
'';
}