fix: don't show the udev setup info if udev v2 setup available (#943)

This commit is contained in:
Róbert Kiss
2019-04-30 03:05:03 +02:00
committed by László Monda
parent 20e2c8bbbc
commit 1b59d96296
3 changed files with 10 additions and 1 deletions

View File

@@ -328,9 +328,11 @@ export class UhkHidDevice {
} }
const expectedUdevSettings = await getFileContentAsync(path.join(this.rootDir, 'rules/50-uhk60.rules')); const expectedUdevSettings = await getFileContentAsync(path.join(this.rootDir, 'rules/50-uhk60.rules'));
const v2UdevSettings = await getFileContentAsync(path.join(this.rootDir, 'rules/50-uhk60_v2.rules'));
const currentUdevSettings = await getFileContentAsync('/etc/udev/rules.d/50-uhk60.rules'); const currentUdevSettings = await getFileContentAsync('/etc/udev/rules.d/50-uhk60.rules');
if (isEqualArray(expectedUdevSettings, currentUdevSettings)) { if (isEqualArray(expectedUdevSettings, currentUdevSettings) ||
isEqualArray(v2UdevSettings, currentUdevSettings)) {
this._udevRulesInfo = UdevRulesInfo.Ok; this._udevRulesInfo = UdevRulesInfo.Ok;
return UdevRulesInfo.Ok; return UdevRulesInfo.Ok;
} }

6
rules/50-uhk60_v2.rules Normal file
View File

@@ -0,0 +1,6 @@
# Ultimate Hacking Keyboard rules
# These are the udev rules for accessing the USB interfaces of the UHK as non-root users.
# Copy this file to /etc/udev/rules.d and physically reconnect the UHK afterwards.
SUBSYSTEM=="input", GROUP="input", MODE="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", MODE:="0666", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="612[0-7]", MODE="0666", GROUP="plugdev"

View File

@@ -77,6 +77,7 @@ if (process.platform === 'darwin') {
artifactName += '-${arch}.${ext}'; artifactName += '-${arch}.${ext}';
extraResources.push('rules/setup-rules.sh'); extraResources.push('rules/setup-rules.sh');
extraResources.push('rules/50-uhk60.rules'); extraResources.push('rules/50-uhk60.rules');
extraResources.push('rules/50-uhk60_v2.rules');
} else { } else {
console.error(`I dunno how to publish a release for ${process.platform} :(`); console.error(`I dunno how to publish a release for ${process.platform} :(`);
process.exit(1); process.exit(1);