udev: Simplify installation of udev rules

* Simplify installation of udev rules

Fixes #2263

* udev: Shorten udev installation description

Related #2263

* udev: Shorten udev installation description

Related #2263

* udev: Update installation of udev rules

Related #2263

* Update docs/installation.md

Co-authored-by: Peter F. Patel-Schneider <pfpschneider@gmail.com>

* Update Makefile

Co-authored-by: Peter F. Patel-Schneider <pfpschneider@gmail.com>

* Update Makefile

Co-authored-by: Peter F. Patel-Schneider <pfpschneider@gmail.com>

* Update docs/installation.md

Co-authored-by: Peter F. Patel-Schneider <pfpschneider@gmail.com>

* Update docs/installation.md

Co-authored-by: Peter F. Patel-Schneider <pfpschneider@gmail.com>

* Update docs/installation.md

Co-authored-by: Peter F. Patel-Schneider <pfpschneider@gmail.com>

---------

Co-authored-by: Peter F. Patel-Schneider <pfpschneider@gmail.com>
This commit is contained in:
MattHag 2024-02-13 00:08:40 +01:00 committed by GitHub
parent 10d65f0ca3
commit c66f3c3fe1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 35 additions and 12 deletions

21
Makefile Normal file
View File

@ -0,0 +1,21 @@
UDEV_RULE_FILE = 42-logitech-unify-permissions.rules
UDEV_RULES_SOURCE := rules.d/$(UDEV_RULE_FILE)
UDEV_RULES_SOURCE_UINPUT := rules.d-uinput/$(UDEV_RULE_FILE)
UDEV_RULES_DEST := /etc/udev/rules.d/
.PHONY: install_udev install_udev_uinput uninstall_udev
install_udev:
@echo "Copying Solaar udev rule to $(UDEV_RULES_DEST)"
sudo cp $(UDEV_RULES_SOURCE) $(UDEV_RULES_DEST)
sudo udevadm control --reload-rules
install_udev_uinput:
@echo "Copying Solaar udev rule (uinput) to $(UDEV_RULES_DEST)"
sudo cp $(UDEV_RULES_SOURCE_UINPUT) $(UDEV_RULES_DEST)
sudo udevadm control --reload-rules
uninstall_udev:
@echo "Removing Solaar udev rules from $(UDEV_RULES_DEST)"
sudo rm -f $(UDEV_RULES_DEST)/$(UDEV_RULE_FILE)
sudo udevadm control --reload-rules

View File

@ -99,20 +99,22 @@ For more information see [the rules page](https://pwr-solaar.github.io/Solaar/ru
### Installing Solaar's udev rule
Solaar needs to write to HID devices for receivers and devices.
To be able to do this without running as root requires a udev rule
that gives seated users write access to the HID devices for Logitech receivers and devices.
Solaar needs to write to HID devices and receivers.
To achieve this without Solaar running as root, which is not recommended, requires a udev rule. Run `make install_udev` in Solaar's root folder to
install Solaar's regular udev rule and put it into effect. You need sudo privileges to do this and will be asked for your password. If you are using Wayland instead of X11 you may want to instead `make install_udev_uinput` so that Solaar rules can simulate input in Wayland.
You can install this rule by copying, as root,
[`rules.d/42-logitech-unify-permissions.rules`](/rules.d/42-logitech-unify-permissions.rules) from Solaar repo to
`/etc/udev/rules.d`.
You will probably also have to tell udev to reload its rule via
`sudo udevadm control --reload-rules`.
<details>
<summary>Manual steps</summary>
For this rule to set up the correct permissions for your receivers and devices
you will then need to either disconnect your receivers and
any USB-connected or Bluetooth-connected devices and
re-connect them or reboot your computer.
You can install this rule manually by copying the file
[`rules.d/42-logitech-unify-permissions.rules`](/rules.d/42-logitech-unify-permissions.rules) as root from Solaar repo
to `/etc/udev/rules.d`.
Let udev reload its rules by running
`sudo udevadm control --reload-rules`.
</details>
Then disconnect your Logitech receivers and any USB- or Bluetooth-connected Logitech devices and
re-connect them for the udev rule to take effect. Alternatively, you can just reboot your computer.
## Running from the download directory