Skip to content

Instantly share code, notes, and snippets.

@dimitropoulos
Forked from jchv/README.md
Last active August 7, 2018 14:50
Show Gist options
  • Save dimitropoulos/a16d9f79fe795bf92ab9b965ae546b59 to your computer and use it in GitHub Desktop.
Save dimitropoulos/a16d9f79fe795bf92ab9b965ae546b59 to your computer and use it in GitHub Desktop.
Installing evdevremapkeys

Open a terminal. (Ctrl+Alt+T)

Become root:

sudo -i

Install the Python package:

apt install -y python3-dev python3-pip gcc
pip3 install git+https://github.com/philipl/evdevremapkeys.git

Create the configuration directory:

mkdir -p /etc/xdg/evdevremapkeys

Create a configuration:

vim /etc/xdg/evdevremapkeys/config.yaml
devices:
- input_name: "Kensington Expert Wireless TB"
  output_name: remap-mouse
  remappings:
    BTN_MIDDLE:
    - KEY_LEFTCTRL
    - KEY_TAB
    BTN_SIDE:
    - BTN_MIDDLE

You can figure out the name of your devices with evdevremapkeys.py -l - note that this requires root privileges.

Create the systemd unit file:

vim /etc/systemd/system/evdevremapkeys.service
[Unit]
Description=evdevremapkeys

[Service]
ExecStart=/usr/bin/python3 /usr/local/bin/evdevremapkeys.py

[Install]
WantedBy=multi-user.target

Enable and start the systemd unit:

systemctl daemon-reload
systemctl enable evdevremapkeys
systemctl start evdevremapkeys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment