-
-
Notifications
You must be signed in to change notification settings - Fork 62
Description
Version Information:
- Distribution: NixOS
- swhkd version: Simple-Wayland-HotKey-Daemon 1.3.0-dev, built off ae372e0
Describe the bug:
This bug is similar to #162 (closed), but I believe the cause is different.
Note that the bug only occurs after at least one hotkey has been triggered.
Expected behavior:
swhkd
should be able to register hotkeys on a newly connected keyboard.
Actual behavior:
swhkd
does not grab newly connected devices and thus cannot handle their keypresses events.
To Reproduce:
- Start
swhkd
. - Trigger a hotkey first.
- Connect a keyboard (or disconnect yours before reconnecting it).
- Hotkeys will not work.
- swhkd will log:
Could not open evdev device at /dev/input/eventX: Permission denied (os error 13)
- swhkd will log:
Additional information:
While I have not did a git bisect, I believe it is caused by #270. This is deduced by running this command to observe UID of the swhkd process:
watch -n1 'sh -c "{ head -n1; grep -v sudo | grep -i \"swhk[sd]\"; } < <(ps -eo pid,ruid,euid,gid,cmd)"'
After step (2), we observe swhkd drop permissions as RUID and EUID turn from the root (0) to the user (e.g. 1000). As a result, it no longer has permissions to read newly connected files in /dev/input
.