Don't use hidraw device paths for unique IDs
Description of Bug
I run OpenRGB on Ubuntu 22.04. I want it to handle my MSI X570 Gaming Edge WIFI's Mystic Light support, which shows up as a /dev/hidrawX device.
However I have other hidraw devices attached, and USB enumeration happens in random order, so the Mystic Light device doesn't always get the same number assigned.
Unfortunately it looks like all configurations (profiles, and the Hardware Sync plugin's JSON config file) refer to specific devices via the device path for the hidraw device. E.g.:
> grep -r hidraw0 .config/OpenRGB/
.config/OpenRGB/plugins/settings/MeasureSettings.json: "location": "HID: /dev/hidraw0",
.config/OpenRGB/plugins/settings/MeasureSettings.json: "location": "HID: /dev/hidraw0",
.config/OpenRGB/plugins/settings/MeasureSettings.json: "location": "HID: /dev/hidraw0",
grep: .config/OpenRGB/Default.orp: binary file matches
grep: .config/OpenRGB/White.orp: binary file matches
But that means that whether OpenRGB will work on a particular boot is random.
I set up an udev rule to add a mystic_light symlink in /dev for the appropriate device, and created a script to search-and-replace the device path in files before starting the program:
#!/bin/fish
sed -E -i -e 's:/dev/hidraw[0-9]+:/dev/'(readlink /dev/mystic_light)':' ~/.config/OpenRGB/*.orp ~/.config/OpenRGB/plugins/settings/*.json
exec /usr/bin/openrgb --startminimized --profile "Default"
But that is a hack. It'd be better if OpenRGB (and its plugins) could use something more stable (perhaps the device id) to identify specific devices, or at least provided a way to manually select a named symlink from /dev.
Attached Log
Operating System
Ubuntu 22.04
Hardware Configuration
MSI X570 Gaming Edge WIFI's Mystic Light