Don't use hidraw device paths for unique IDs
<!-- Found a bug? Something isn't working as expected? To help us keep track of the requests please start the title with [Bug Report] But before that, first you should check it out with the latest pipeline. --> ### Description of Bug <!-- Please describe the bug. Explain any steps taken to reproduce the bug and what you expect the correct behavior to be. --> 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 <!-- Please attach a verbose log, you can do it by running the exe from cmd with '--loglevel 6' flag. You can locate them using the Settings tab and click the 'Open Settings Folder' button. Important!! Please upload the logs made with the latest pipeline build of OpenRGB. --> ### Operating System <!-- Please write down which OS and which version did you encounter the issue with. --> CalcProgrammer1/OpenRGB~11151880 Ubuntu 22.04 ### Hardware Configuration <!-- Please list the RGB hardware that you are using with OpenRGB. If your bug does not relate to any one particular device or device type, or if the bug is in a part of the code not directly interacting with hardware, this is optional. --> MSI X570 Gaming Edge WIFI's Mystic Light
issue