DEV: [PLUGIN] MPD_OLED for x86 based systems

Hi @Wheaten

I looked at a udev rule. Plugging in the USB adapter I can see it is appearing as /dev/i2c-8, then

udevadm info /dev/i2c-8

Gives

DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/i2c-8/i2c-dev/i2c-8

Chopping the end off this and adding * gives the rule

SUBSYSTEM=="i2c-dev", DEVPATH=="/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/*", SYMLINK+="i2c-99"

Unplug the adapter, add the rule, reload the rules and plug in the device, and it can be accessed through /dev/i2c-99

sudo udevadm control --reload
ls /dev/i2c*
/dev/i2c-0  /dev/i2c-2  /dev/i2c-4  /dev/i2c-6  /dev/i2c-8
/dev/i2c-1  /dev/i2c-3  /dev/i2c-5  /dev/i2c-7  /dev/i2c-99

I guess this rule would work with any any USB adapter providing one I2C bus and plugged into the same port.

Adrian.