Skip to content

Instantly share code, notes, and snippets.

@jchv
Created May 24, 2018 13:31
Show Gist options
  • Save jchv/e020e8e57a38ba546aaf295ce982b359 to your computer and use it in GitHub Desktop.
Save jchv/e020e8e57a38ba546aaf295ce982b359 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: "Logitech M705"
  output_name: remap-mouse
  remappings:
    BTN_RIGHT:
    - KEY_LEFTCTRL
    - KEY_A

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
@gee842
Copy link

gee842 commented Aug 18, 2021

HHHHHHhhhhhhhhHHHHJJJJJjjkjhkjgjgfjhhhhhhhhhhhhhhh

doesnt work :(

@jchv
Copy link
Author

jchv commented Sep 26, 2021

Sorry, it's been a while since I set this up. Do you have any idea what's going wrong? There's a lot of things about my setup from 3 years ago that might differ from your current setup, like the path to the Python 3 binary, the location of systemd system-wide unit files, and so forth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment