To utilize the browser-based Via or Keychron Launcher applications on Linux, you need to adjust some permission settings. By default, your user account lacks the permissions to transmit arbitrary commands via USB. This limitation has its benefits, as Firefox also does not support WebUSB due to security concerns. However, these browser-based applications depend on this functionality.
Giving permissions
The recommended approach to grant user permissions is to use udev rules that can target specific devices. These rules are maintained in the directory /etc/udev/rules.d/. We will create a new rule for Via with the following content:
sudo nano /etc/udev/rules.d/70-via-usb.rules
# keychron
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="3434", ATTRS{idProduct}=="0a31", TAG+="uaccess"
Note that the file name must be less then 73-seat-late.rules, which evaluates the tags.
If you’re using a different keyboard, you can identify its idVendor and idProduct by executing lsusb, which will output a line such as:
Bus 001 Device 024: ID 3434:0a31 Keychron Keychron K3 Max
Although you could just omit the ATTRS filter, doing so would grant the browser access to all HID devices, which poses security risks.
However, if you own multiple keychron devices, lets say also a mouse, you can leave out idProduct selector, so the rule applies to all of them.
To apply the new rules run:
sudo udevadm control --reload-rules && sudo udevadm trigger
You can verify that everything is working as expected by visiting chrome://device-log/ after trying to connect to the device and check for access denied message.
Keychron additions
For users of the Keychron launcher, you should also incorporate the following line:
# keychron k3 max stm bootloader
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess"
This line enables firmware updates when the keyboard is in bootloader mode.
Similarly, add this line to allow the browser to access the 2.4GHz dongle:
# keychron link
SUBSYSTEM=="usb", ATTRS{idVendor}=="3434", ATTRS{idProduct}=="d030", TAG+="uaccess"
Lifesaver! Thank you so much!
Thanks, this was really helpful for getting Keychron Launcher to work. But I wanted to point out that your permissions are unnecessarily lax. You assigned it to the users group, so MODE=”0660″ is sufficient. It’s not necessary to give write access to daemon processes. Granted, on the average Linux desktop it probably doesn’t matter that much, but limiting permissions to what’s necessary is just a good habit.
thanks for the hint. tightened the rules.
Thank you very much for this solution
Thank your for this solution.
Pardon, how were you able to identify the Vendor and Product id for the keychron launcher?
I’m on Arch Linux are just received my Keychron Q6 HE I’m attempting to setup.
lsusb