-
Notifications
You must be signed in to change notification settings - Fork 129
Avoid using sudo on Linux
In Linux, kanata needs to be able to access the input and uinput subsystem to inject events. To do this, your user needs to have permissions. Follow the steps in this page to obtain user permissions.
NOTE: giving your login user input/uinput permissions puts you at risk of being keylogged or getting malicious key inputs sent into your system, if you choose to run malicious programs on your system. If you care a lot about that risk, you should follow the instructions below with a different user and start up kanata with that user, or use something like systemd to run kanata on startup. Never run untrusted code on your system though 😉.
sudo groupadd uinput
sudo usermod -aG input $USER
sudo usermod -aG uinput $USER
Make sure that it's effective by running groups
. You might have to logout and login.
Add a udev rule (in either /etc/udev/rules.d
or /lib/udev/rules.d
) with the following content:
KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"
You may need to run this command whenever you start kanata for the first time:
sudo modprobe uinput
The original text was taken and adapted from: https://github.com/kmonad/kmonad/blob/master/doc/faq.md#linux