### Install as a systemd service Source: https://github.com/wez/evremap/blob/master/README.md Deploy the provided service unit file and enable it via systemctl. ```console $ sudo cp evremap.service /usr/lib/systemd/system/ $ sudo systemctl daemon-reload $ sudo systemctl enable evremap.service $ sudo systemctl start evremap.service ``` -------------------------------- ### Start OpenRC service Source: https://github.com/wez/evremap/blob/master/README.md Manually starts the evremap service. ```console rc-service evremap start ``` -------------------------------- ### Build evremap from source Source: https://github.com/wez/evremap/blob/master/README.md Install required system dependencies and compile the project using cargo. ```console $ sudo dnf install libevdev-devel # redhat/centos ## or $ sudo apt install libevdev-dev pkg-config # debian/ubuntu $ cargo build --release ``` -------------------------------- ### Configure as a Runit service Source: https://github.com/wez/evremap/blob/master/README.md Set up a Runit service directory and run script for evremap. ```console sudo mkdir /etc/sv/evremap sudo touch /etc/sv/evremap/run ``` ```sh #!/bin/sh set -e exec remap ``` ```console sudo ln -s /etc/sv/evremap /var/service ``` -------------------------------- ### Enable OpenRC service Source: https://github.com/wez/evremap/blob/master/README.md Adds the evremap service to the default runlevel. ```console rc-update add evremap ``` -------------------------------- ### Make service file executable Source: https://github.com/wez/evremap/blob/master/README.md Sets the execution permissions for the newly created init script. ```console chmod +x /etc/init.d/evremap ``` -------------------------------- ### Create OpenRC service file Source: https://github.com/wez/evremap/blob/master/README.md Defines the service configuration for evremap using supervise-daemon. ```console #!/usr/bin/openrc-run supervisor=supervise-daemon command="" command_args="remap " ``` -------------------------------- ### CLI Commands for Device and Key Discovery Source: https://github.com/wez/evremap/blob/master/README.md Commands to identify input devices and available key codes for configuration. ```bash sudo evremap list-devices ``` ```bash evremap list-keys ``` -------------------------------- ### Run evremap Source: https://github.com/wez/evremap/blob/master/README.md Execute the remapper with root privileges to ensure exclusive access to input devices. ```console $ sudo target/release/evremap remap my-config-file.toml ``` -------------------------------- ### Configure Ordered Remapping Rules Source: https://github.com/wez/evremap/blob/master/README.md Demonstrates how rule ordering affects output when multiple mappings overlap. ```toml [[remap]] input = ["KEY_LEFTALT", "KEY_F8"] # When our `input` is matched, our list of `output` is prevented from # matching as the `input` of subsequent rules. output = ["KEY_F8"] [[remap]] input = ["KEY_F8"] output = ["KEY_MUTE"] ``` -------------------------------- ### Define Simple Key Remappings Source: https://github.com/wez/evremap/blob/master/README.md Maps specific key combinations to different output keys. ```toml # This config snippet is useful if your keyboard has an arrow # cluster, but doesn't have page up, page down, home or end # keys. Here we're configuring ALT+arrow to map to those functions. [[remap]] input = ["KEY_LEFTALT", "KEY_UP"] output = ["KEY_PAGEUP"] [[remap]] input = ["KEY_LEFTALT", "KEY_DOWN"] output = ["KEY_PAGEDOWN"] [[remap]] input = ["KEY_LEFTALT", "KEY_LEFT"] output = ["KEY_HOME"] [[remap]] input = ["KEY_LEFTALT", "KEY_RIGHT"] output = ["KEY_END"] ``` -------------------------------- ### Configure user permissions for input devices Source: https://github.com/wez/evremap/blob/master/README.md Grant unprivileged users access to evdev and uinput devices via udev rules. ```console sudo gpasswd -a YOUR_USER input echo 'KERNEL=="uinput", GROUP="input"' | sudo tee /etc/udev/rules.d/input.rules ``` ```console echo 'KERNEL=="event*", NAME="input/%k", MODE="660", GROUP="input"' | sudo tee /etc/udev/rules.d/input.rules ``` -------------------------------- ### Configure Dual Role Keys Source: https://github.com/wez/evremap/blob/master/README.md Defines a key that acts as one input when tapped and another when held. ```toml # The name of the device to remap. # Run `sudo evremap list-devices` to see the devices available # on your system. device_name = "AT Translated Set 2 keyboard" # If you have multiple devices with the same name, you can optionally # specify the `phys` value that is printed by the `list-devices` subcommand # phys = "usb-0000:07:00.3-2.1.1/input0" # Configure CAPSLOCK as a Dual Role key. # Holding it produces LEFTCTRL, but tapping it # will produce ESC. # Both `tap` and `hold` can expand to multiple output keys. [[dual_role]] input = "KEY_CAPSLOCK" hold = ["KEY_LEFTCTRL"] tap = ["KEY_ESC"] ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.