Skip to content

Commit f1e02d8

Browse files
committed
fix issue when not able to connect with receiver (added udev rule)
1 parent 461b0d7 commit f1e02d8

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,15 @@ This is a Visual Basic script that is just a wrapper around switch_to_2.bat. If
3131
From the **Linux** folder, copy both files (switch_to_1.sh & hidapitester) to: **/usr/bin**
3232
```
3333
cd linux
34-
sudo cp * /usr/bin
34+
sudo cp hidapitester /usr/bin
35+
sudo cp switch_to_1.sh /usr/bin
36+
sudo cp 42-logitech-unify.rules /usr/lib/udev/rules.d
37+
chmod +x /usr/bin/hidapitester
38+
chmod +x /usr/bin/switch_to_1.sh
3539
```
40+
If you have Solaar installed copying the 42-logitech-unify.rules file is not needed. If you don't have Solaar installed you will probably notice that hidapitester does not work without root permissions (e.g. via sudo). This is because non-root users do not have raw access to the hid devices by default.
41+
So the 42-logitech-unify.rules file is a udev rule that allows raw access to the Logitech Unify receiver for non-root users. You might have to unplug your receiver and plug it in again.
42+
3643
Now in your desktop environment of choice, define a custom shortcut. In my case I have used the "Menu" key on my keyboard and assigned it to execute **/usr/bin/switch_to_1.sh**.
3744

3845
## 3.1 - switch_to_1.sh

linux/42-logitech-unify.rules

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This rule to allow users (non-root) to have raw access to Logitech receiver
2+
3+
ACTION != "add", GOTO="endrule"
4+
SUBSYSTEM != "hidraw", GOTO="endrule"
5+
6+
# USB-connected Logitech receivers and devices
7+
ATTRS{idVendor}=="046d", GOTO="applyrule"
8+
9+
# Lenovo nano receiver
10+
ATTRS{idVendor}=="17ef", ATTRS{idProduct}=="6042", GOTO="applyrule"
11+
12+
# Bluetooth-connected Logitech devices
13+
KERNELS == "0005:046D:*", GOTO="applyrule"
14+
15+
GOTO="endrule"
16+
17+
LABEL="applyrule"
18+
19+
# Allow any seated user to access the receiver.
20+
# uaccess: modern ACL-enabled udev
21+
# udev-acl: for Ubuntu 12.10 and older
22+
TAG+="uaccess", TAG+="udev-acl"
23+
24+
# Grant members of the "plugdev" group access to receiver (useful for SSH users)
25+
#MODE="0660", GROUP="plugdev"
26+
27+
LABEL="endrule"
28+
# vim: ft=udevrules

0 commit comments

Comments
 (0)