diff --git a/Documentation/UdevRules.md b/Documentation/UdevRules.md index 485aa9039..a1f72eec7 100644 --- a/Documentation/UdevRules.md +++ b/Documentation/UdevRules.md @@ -1,16 +1,30 @@ # Udev Rules -On Linux, OpenRGB provides a udev rules file to configure access permissions to supported devices. +On Linux, OpenRGB needs permission to access the hardware interfaces used for RGB control. These include USB and I2C interfaces. If you run OpenRGB as a background service, the service runs with root permissions and has access to all of these interfaces. However, if you do not use the background service and want to run OpenRGB standalone, you will need to give your user account permission to access the hardware that OpenRGB controls. This is done using a udev rules file. If you have installed OpenRGB using a distribution package (.deb, .rpm, from your distribution's package manager, or from AUR), the udev rules file should have been automatically installed. However, if you're using the AppImage, Flatpak, or self-compiled versions of OpenRGB, you will need to install the rules manually. -If you install OpenRGB through a distribution-specific package, whether provided by your distribution's official repositories, from packages downloaded from OpenRGB's website or GitLab CI, or from building packages yourself, the udev rules should be installed as part of that package. You should not need to manually install them. - -If you are using OpenRGB compiled from source (not as part of a package), using OpenRGB as an AppImage, or using OpenRGB from Flatpak, you will need to install the udev rules manually. - -## Installation +## Installing Udev Rules * If you have installed OpenRGB from a package then latest udev rules are installed locally at `/usr/lib/udev/rules.d/60-openrgb.rules` - * Udev rules are built from the source at compile time. When building locally they are installed with the `make install` step to `/usr/lib/udev/rules.d/60-openrgb.rules` - * If you need to install the udev rules file manually you can also download the [latest compiled udev rules](https://gitlab.com/CalcProgrammer1/OpenRGB/-/jobs/artifacts/master/raw/60-openrgb.rules?job=Linux+amd64+AppImage&inline=false) from Gitlab. - - Copy this 60-openrgb.rules file to `/usr/lib/udev/rules.d/` or to `/etc/udev/rules.d/` if you're on an immutable system. - - Then reload rules with `sudo udevadm control --reload-rules && sudo udevadm trigger` - * There is also a [udev rules installation script available at openrgb.org](https://openrgb.org/udev.html). + * Otherwise, if you are using either the AppImage, Flatpak, or self-compiled versions of OpenRGB, you need to install the udev rules manually. + * Starting with OpenRGB 1.0, the udev rules are now generated by OpenRGB itself. Use the `--generate-udev-rules ` or `--print-udev-rules` arguments to either save the udev rules to a file or print the contents to the terminal. Manually installed udev rules should be installed at `/etc/udev/rules.d/60-openrgb.rules` + * If using the AppImage, run the following commands to install the udev rules. Replace the OpenRGB.AppImage name to whatever AppImage version you're using. + ```shell + sudo mkdir -p /etc/udev/rules.d + sudo ./OpenRGB.AppImage --generate-udev-rules /etc/udev/rules.d/60-openrgb.rules + sudo udevadm control --reload-rules + sudo udevadm trigger + ``` + * If using OpenRGB from Flatpak, run the following commands to install the udev rules. + ```shell + sudo mkdir -p /etc/udev/rules.d + sudo sh -c 'flatpak run org.openrgb.OpenRGB --print-udev-rules > /etc/udev/rules.d/60-openrgb.rules' + sudo udevadm control --reload-rules + sudo udevadm trigger + ``` + * If using a standalone or self-compiled build, run the following commands to install the udev rules. + ```shell + sudo mkdir -p /etc/udev/rules.d + sudo ./openrgb --generate-udev-rules /etc/udev/rules.d/60-openrgb.rules + sudo udevadm control --reload-rules + sudo udevadm trigger + ```