Intermediate difficulty - Only suitable for you if you feel comfortable:
By default, Linux prevents suspicious USB-behaviour, so it blocks applications from writing data to keyboards. This makes complete sense normally, but can cause problems if you have a reconfigurable keyboard, like Keychron, Nuphy, or keyboards running VIA firmware. Adding udev rules allows you to change this behaviour.
Steps:
lsusb is a command that lists connected USB devices, and show their Vendor ID and Product ID.
If the list that lsusb generates is too long for comfort, use grep to filter out the keyword you need.
For example, to find your Keychron keyboard lsusb | grep -i keychron
Example for my nuphy keyboard:
matt@desktop:~$ lsusb | grep -i NuPhy
Bus 003 Device 014: ID 19f5:3246 NuPhy NuPhy Air75 V2
My keyboard's Vendor ID is 19f5 and the Product ID is 3246.
Use lsusb and write down the Vendor ID and Product ID of your keyboard.
Create a udev rule by creating a text file in: /etc/udev/rules.d. I used this filename: /etc/udev/rules.d/99-mechanicalkeyboards.rules
This is a protected are, so we need to use root privileges.
For example, to do this with nano: sudo nano /etc/udev/rules.d/99-mechanicalkeyboards.rules
If you use the Kate text editor you can simply create the configuration file, and save it as 99-mechanicalkeyboards.rules under /etc/udev/rules.d
Below, the content of the .rules file. Add your Vendor ID and Product ID after ATTRS{idVendor}== and ATTRS{idProduct}== respectively.
# /etc/udev/rules.d/99-mechanicalkeyboards.rules
# NuPhy Air75 v2 2026 Keyboard
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="19f5", ATTRS{idProduct}=="3246", MODE="0660", GROUP="input", TAG+="uaccess"
Meaning:
KERNEL=="hidraw*" – Matches any device node with a name starting with “hidraw”. (Human Interface Device - RAW) SUBSYSTEM=="hidraw" – Applies the rule only to devices under the hidraw subsystem. ATTRS{idVendor}=="19f5" – Targets devices with the vendor ID 19f5 (NuPhy).ATTRS{idProduct}=="3246" – Targets devices with the product ID 3246 (specific NuPhy keyboard model).MODE="0660": – Sets file permissions to read/write for owner and group, none for others.GROUP="input": sets group ownership to the standard input device group on Linux; this avoids hardcoding usernames.TAG+="uaccess": Automatically grants access to the active logged-in user session via systemd-logind.For expert documentation, see: udev documentation and udev on the Arch Linux wiki
If you have multiple keyboards, you can simply add multiple entries in the same file. The example below includes the rules for two keyboards.
# /etc/udev/rules.d/99-mechanicalkeyboards.rules
# Keychron K3 Pro Keyboard
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="3434", ATTRS{idProduct}=="0230", MODE="0660", GROUP="input", TAG+="uaccess"
# NuPhy Air75 v2 2026 Keyboard
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="19f5", ATTRS{idProduct}=="3246", MODE="0660", GROUP="input", TAG+="uaccess"
Source of screenshots: DKMS project on GitHub