udev Rules Should be Included in Master & Reworked

I've been maintaining the AUR package openrgb-git. In doing so, I've noticed many users requesting additions to the udev rules. These additional rules should probably reside upstream in the repository so everyone can share improvements across all distributions.

With regards to this, I've noticed your rules all contain the plugdev group. While this isn't an issue per se, many distributions don't add users to this group by default. For example; fedora, openSUSE, archlinux, et al. don't & won't as the method is now regarded obsolete upstream by systemd. The solution I've run into in other software projects suggests keeping the plugdev group definition & adding a uaccess tag (i.e., TAG+="uaccess"). This preserves backwards compatibility with non-systemd distributions & older udev versions while also giving user access to distributions with newer udev versions without needing to add a user to the plugdev group (i.e., for distributions with older udev or without systemd, the user must still be added to plugdev).

On archlinux, I tested the HyperX Alloy Elite keyboard with the following rule: SUBSYSTEM=="usb", ATTR{idVendor}=="0951", ATTR{idProduct}=="16be", GROUP="plugdev", MODE="0666", TAG+="uaccess"

With this I was successful, the only annoyance is the warning spam in the systemd journal: systemd-udevd[439]: /usr/lib/udev/rules.d/99-openrgb.rules:29 Unknown group 'plugdev', ignoring

The warnings can be safely ignored though as functionality isn't impaired. I've removed GROUP assignment on the openrgb-git AUR package as it is unnecessary. The i2c rules lacked a MODE attribute which was needed for the uaccess method thus permitting users which aren't in the i2c group access. EDIT: I just tested again some XPG/Adata RAM & the MODE attribute on i2c is unnecessary for uaccess method (but the MODE attribute for i2c access should still help non-systemd & legacy distributions so they won't need a chmod on i2c devices). Lastly, permissions can probably be tightened to MODE="0660" as owner & group access should be sufficient (i.e., it worked on the HyperX Alloy Elite & XPG RGB RAM). Here is the most compatible udev rule I can offer:

# Asus Aura Addressable RGB Header
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18a3", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# AMD Wraith Prism                                                 
SUBSYSTEM=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0051", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# Corsair Commander Pro                                            
SUBSYSTEM=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c10", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# Corsair k70 RGB                                                  
SUBSYSTEM=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b13", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# Corsair k70 RGB LUX                                              
SUBSYSTEM=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b33", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# Corsair k95 RGB                                                  
SUBSYSTEM=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b11", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# Corsair Lighting Node Pro                                        
SUBSYSTEM=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c0b", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# Corsair m65 RGB Elite                                            
SUBSYSTEM=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b5a", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# Corsair mm800 RGB Polaris                                        
SUBSYSTEM=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="1b3b", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# HyperX Alloy Elite                                               
SUBSYSTEM=="usb", ATTR{idVendor}=="0951", ATTR{idProduct}=="16be", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# i2c User Access
KERNEL=="i2c-[0-9]*", GROUP="i2c", MODE="0660", TAG+="uaccess"

# msi 3-zone Keyboard
SUBSYSTEM=="usb", ATTR{idVendor}=="1770", ATTR{idProduct}=="FF00", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# NZXT Hue 2                                                       
SUBSYSTEM=="usb", ATTR{idVendor}=="1e71", ATTR{idProduct}=="2001", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# NZXT Smart Device v2                                             
SUBSYSTEM=="usb", ATTR{idVendor}=="1e71", ATTR{idProduct}=="2006", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# NZXT Kraken                                                      
SUBSYSTEM=="usb", ATTR{idVendor}=="1e71", ATTR{idProduct}=="170e", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# Redragon k556                                                    
SUBSYSTEM=="usb", ATTR{idVendor}=="0c45", ATTR{idProduct}=="5004", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# Redragon m711                                                    
SUBSYSTEM=="usb", ATTR{idVendor}=="04d9", ATTR{idProduct}=="fc30", GROUP="plugdev", MODE="0660", TAG+="uaccess"

# Thermaltake Poseidon Z RGB                                       
SUBSYSTEM=="usb", ATTR{idVendor}=="264a", ATTR{idProduct}=="3006", GROUP="plugdev", MODE="0660", TAG+="uaccess"

Related issues: #283 (closed) #204 (closed)

Edited by Myrddin Wyllt