From 2dc9ca62c6aeec8960dec93f69bd3269c1f5dafe Mon Sep 17 00:00:00 2001
From: Jesse Vincent
Date: Fri, 1 Mar 2024 13:59:48 -0800
Subject: [PATCH] Improve our linux udev rules
---
src/api/hardware/index.js | 2 ++
src/renderer/screens/Help/Connection.js | 12 +++++++-----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/api/hardware/index.js b/src/api/hardware/index.js
index 4037d5594..4294407ce 100644
--- a/src/api/hardware/index.js
+++ b/src/api/hardware/index.js
@@ -86,6 +86,7 @@ export const supportedDeviceVIDPIDs = () => {
result.push({
usbVendorId: device.usb.vendorId,
usbProductId: device.usb.productId,
+ productName: device.info.product,
});
// For bootloader vid/pid pair
@@ -93,6 +94,7 @@ export const supportedDeviceVIDPIDs = () => {
result.push({
usbVendorId: device.usb.bootloader.vendorId,
usbProductId: device.usb.bootloader.productId,
+ productName: device.info.product,
});
}
}
diff --git a/src/renderer/screens/Help/Connection.js b/src/renderer/screens/Help/Connection.js
index ea158b9a5..dbccefae9 100644
--- a/src/renderer/screens/Help/Connection.js
+++ b/src/renderer/screens/Help/Connection.js
@@ -22,7 +22,9 @@ const HelpConnection = () => {
const rules = supportedDeviceVIDPIDs().map((device) => {
return `SUBSYSTEM=="usb", ATTR{idVendor}=="${device.usbVendorId
.toString(16)
- .padStart(4, "0")}", ATTR{idProduct}=="${device.usbProductId.toString(16).padStart(4, "0")}", TAG+="uaccess"\n`;
+ .padStart(4, "0")}", ATTR{idProduct}=="${device.usbProductId.toString(16).padStart(4, "0")}", SYMLINK+="${
+ device.productName
+ }", ENV{ID_MM_DEVICE_IGNORE}:="1", ENV{ID_MM_CANDIDATE}:="0", TAG+="uaccess", TAG+="seat"\n`;
});
const linuxInstructions = (
<>
@@ -34,9 +36,9 @@ const HelpConnection = () => {
udev rules
file.
- As root, create a file called 50-kaleidoscope.rules
in the directory{" "}
- /etc/udev/rules.d/
with the following contents:
-
+ As root, create a file called 50-kaleidoscope.rules
in the directory{" "}
+ /etc/udev/rules.d/
with the following contents:
+
{rules}
@@ -55,7 +57,7 @@ const HelpConnection = () => {
- {isLinux && linuxInstructions}
+ {linuxInstructions}
Getting help
If that doesn't work, please drop us a line at help@keyboard.io and we can help figure out what's wrong.