Skip to content

Commit 587ee8c

Browse files
committed
docs(evdev): add uinput-access.md
1 parent e12f48d commit 587ee8c

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
order: 7
3+
title: UInput Access Setup
4+
description:
5+
Configure permissions so Lua programs can create virtual input devices with
6+
uinput.
7+
---
8+
9+
# UInput Access Setup
10+
11+
Creating virtual input devices requires `/dev/uinput` to exist and be writable
12+
by the current user.
13+
14+
## Group setup
15+
16+
1. Create a `uinput` group:
17+
18+
```bash
19+
sudo groupadd --system uinput
20+
```
21+
22+
1. Add your user to it:
23+
24+
```bash
25+
sudo usermod -aG uinput "$USER"
26+
```
27+
28+
## Udev setup
29+
30+
1. Create a udev rule:
31+
32+
```bash
33+
echo 'KERNEL=="uinput", GROUP="uinput", MODE="0660",' \
34+
'OPTIONS+="static_node=uinput"' \
35+
| sudo tee /etc/udev/rules.d/99-uinput.rules
36+
```
37+
38+
1. Load the kernel module:
39+
40+
```bash
41+
sudo modprobe uinput
42+
```
43+
44+
1. Reload udev rules:
45+
46+
```bash
47+
sudo udevadm control --reload-rules
48+
sudo udevadm trigger
49+
```
50+
51+
1. Start a new login session, or refresh the current shell group list:
52+
53+
```bash
54+
newgrp uinput
55+
```
56+
57+
> [!TIP]
58+
>
59+
> Logging out and back in is the cleanest way to pick up the new group.
60+
61+
## Verify
62+
63+
- Confirm the node exists and the group is correct:
64+
65+
```bash
66+
ls -l /dev/uinput
67+
```
68+
69+
- Expected shape:
70+
71+
```text
72+
crw-rw---- 1 root uinput 10, <minor> <MMM DD HH:MM> /dev/uinput
73+
```

0 commit comments

Comments
 (0)