diff --git a/Documentation/UdevRules.md b/Documentation/UdevRules.md index d63604860..485aa9039 100644 --- a/Documentation/UdevRules.md +++ b/Documentation/UdevRules.md @@ -10,7 +10,7 @@ If you are using OpenRGB compiled from source (not as part of a package), using * 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+64+AppImage&inline=false) from Gitlab. - - Copy this 60-openrgb.rules file to `/usr/lib/udev/rules.d/` + * 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). diff --git a/scripts/openrgb-udev-install.sh b/scripts/openrgb-udev-install.sh index 15c5b800f..e96661d1e 100755 --- a/scripts/openrgb-udev-install.sh +++ b/scripts/openrgb-udev-install.sh @@ -1,34 +1,17 @@ #! /bin/bash -STEAMOS=0 -STEAMOS_READONLY=0 - -# Test for SteamOS and disable readonly mode if we're running on it -if command -v steamos-readonly >& /dev/null -then - # Test if SteamOS readonly mode is enabled - if sudo steamos-readonly status | grep 'enabled' - then - echo "steamos readonly mode is true" - STEAMOS_READONLY=1 - fi - - STEAMOS=1 - sudo steamos-readonly disable -fi - # Download udev rules file wget https://openrgb.org/releases/release_0.9/60-openrgb.rules -# Move udev rules file to udev rules directory -sudo mv 60-openrgb.rules /usr/lib/udev/rules.d +# If we don't have write permissions then we're running on an immutable distro +if sudo test -w /usr/lib/udev/rules.d; +then + # Move udev rules file to udev rules directory + sudo mv 60-openrgb.rules /usr/lib/udev/rules.d +else + sudo mv 60-openrgb.rules /etc/udev/rules.d +fi # Reload the rules sudo udevadm control --reload-rules sudo udevadm trigger - -if [ "$STEAMOS" = 1 ] ; then - if [ "$STEAMOS_READONLY" = 1 ] ; then - sudo steamos-readonly enable - fi -fi