ctucx.git: nixfiles

ctucx' nixfiles

commit e41e48d75afdba0642ea1dc7fcb2f8038eec02c9
parent 1666810fc7dbadb2c4ec07681c4ab5412d900a4f
Author: Leah (ctucx) <leah@ctu.cx>
Date: Thu, 9 Jun 2022 15:38:00 +0200

machines/blechbuechse/keyboard: match vendorID and productID
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/machines/blechbuechse/keyboard.nix b/machines/blechbuechse/keyboard.nix
@@ -39,7 +39,7 @@ let
       charsLen = lib.length chars;
     in lib.foldl (a: v: a + v) 0 (lib.imap0 (k: v: hexToInt."${v}" * (pow 16 (charsLen - k - 1))) chars);
 
-  commandList  = lib.forEach keyMappings (entry: ''hidutil property --matching '{"ProductID":0x${entry.ProductID}}' --set '{"UserKeyMapping":${builtins.toJSON entry.UserKeyMapping}}' > /dev/null'');
+  commandList  = lib.forEach keyMappings (entry: ''hidutil property --matching '{"VendorID":0x${entry.VendorID},"ProductID":0x${entry.ProductID}}' --set '{"UserKeyMapping":${builtins.toJSON entry.UserKeyMapping}}' > /dev/null'');
 
 in {
 

@@ -55,7 +55,7 @@ in {
         "${pkgs.writeScript "hidutil" ''
           #!/usr/bin/env bash
           osascript -e 'display notification "Load UserKeyMapping for ${entry.VendorID}:${entry.ProductID}" with title "hidutil"'
-          hidutil property --matching '{"ProductID":0x${entry.ProductID}}' --set '{"UserKeyMapping":${builtins.toJSON entry.UserKeyMapping}}'  > /dev/null
+          hidutil property --matching '{"VendorID":0x${entry.VendorID},"ProductID":0x${entry.ProductID}}' --set '{"UserKeyMapping":${builtins.toJSON entry.UserKeyMapping}}'  > /dev/null
         ''}"
       ];
       LaunchEvents = {