You are not logged in.
From https://wiki.archlinux.org/title/Users_ … emd_groups
Before arch migrated to systemd, users had to be manually added to these groups in order to be able to access the corresponding devices. This way has been deprecated in favour of udev marking the devices with a uaccess tag and logind assigning the permissions to users dynamically via ACLs according to which session is currently active. Note that the session must not be broken for this to work (see General troubleshooting#Session permissions to check it).
How I understand it is that I don't have to do anything in order to access the input devices. I have already done the session broken check. Nevertheless, I still get a permission denied error when trying to access a device:
$ cat /dev/input/event0
cat: /dev/input/event0: Permission denied
So eventually I still had to add myself to the "input" group. What is the correct way to give myself access to these devices?
Last edited by minhduc0711 (2022-01-15 15:55:36)
Offline
$ cat /dev/input/event0 cat: /dev/input/event0: Permission denied
Why are you attempting to access those nodes? What are you trying to do?
So eventually I still had to add myself to the "input" group.
What was not working when your user was not in the input group?
See also https://xyproblem.info/
Offline
Sorry for being unclear.
I use way-displays to manage my display configuration. It needs access to /dev/input/event* nodes in order to detect laptop lid closing/opening.
Turns out I have no permission to access /dev/input/event*, and thus this functionality did not work. Adding myself to the "input" group grants me permission. However, the "input" group was listed in the "presystemd groups" in the mentioned wiki article, which leds me to believe I should have permission without needing to do anything.
Last edited by minhduc0711 (2022-01-15 13:38:32)
Offline
As far as I know, access to input devices has been further restricted. Only the "session owner" (usually your compositor) is able to request access through a dbus interface now. This was probably done to make keylogging harder.
Edit: Anything else has to be manually configured, you might be able to create a custom udev rule to allow access to the lid switch only instead of just allowing generall access to all input. (uaccess or simply a user group)
Edit: This article details the process used now: https://github.com/KillingSpark/HowLogindWorks
Last edited by progandy (2022-01-15 14:26:06)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Ah, thanks for your explanation. I read https://wiki.archlinux.org/title/Udev#udev_rule_example and now I have this udev rule that only allows access to the lid switch:
KERNEL=="event[0-9]*", SUBSYSTEM=="input", ATTRS{name}=="Lid Switch", TAG+="uaccess"
Offline