From e4d8f8b070cc108c9e841cfa1e64073b33632672 Mon Sep 17 00:00:00 2001 From: nat-418 <93013864+nat-418@users.noreply.github.com> Date: Thu, 7 Apr 2022 20:39:57 +0200 Subject: Update README with sudo alternative --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d2623e4..31ddbf1 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,19 @@ To run the remapper, invoke it *as root* (so that it can grab exclusive access t $ sudo target/release/evremap remap my-config-file.toml ``` +Or, grant an unprivileged user access to `evdev` and `uinput`. +On Ubuntu, this can be configured by running the following commands and rebooting: + +``` +sudo gpasswd -a YOUR_USER input +echo 'KERNEL=="uinput", GROUP="input"' | sudo tee /etc/udev/rules.d/input.rules +``` + +For some platforms, you might need to create an `input` group first and run: +``` +echo 'KERNEL=="event*", NAME="input/%k", MODE="660", GROUP="input"' | sudo tee /etc/udev/rules.d/input.rules as well. +``` + ## Systemd A sample system service unit is included in the repo. You'll want to adjust the paths to match @@ -124,5 +137,4 @@ $ sudo systemctl start evremap.service ## How do I make this execute a command when a key is pressed? -Since the remapper runs as root, it seems like a dangerous idea to have it -directly trigger commands, so that feature is not implemented. +That feature is not implemented. -- cgit v1.2.3