Add udev rules for Keychron C2

Without these, the function keys don’t work as function keys, but only
as media keys.
This commit is contained in:
fruchti 2023-03-12 12:55:59 +01:00
parent a4b0edf7f0
commit 44c073c07c
2 changed files with 8 additions and 0 deletions

View file

@ -7,5 +7,6 @@
./packages.nix ./packages.nix
./users.nix ./users.nix
./locale.nix ./locale.nix
./hardware.nix
]; ];
} }

7
base/hardware.nix Normal file
View file

@ -0,0 +1,7 @@
{ pkgs, ... }:
{
services.udev.extraRules = ''
# Keychron C2 function key fix
SUBSYSTEMS=="input", ATTRS{name}==Keychron C2", RUN+="${pkgs.coreutils}/bin/echo 0 | ${pkgs.coreutils}/bin/tee /sys/module/hid_apple/parameters/fnmode"
'';
}