You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
600 B
Bash

#!/bin/bash
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
echo $SCRIPT_DIR
sudo tee /etc/systemd/system/xing-wei-remap.service <<EOF
[Unit]
Description=XING WEI USB KEY_BACK to KEY_ESC Remapper
After=systemd-modules-load.service
Wants=systemd-modules-load.service
[Service]
Type=simple
ExecStart=/usr/bin/python3 $SCRIPT_DIR/remap.py
Restart=always
RestartSec=2
User=root
# Allow access to input and uinput devices
PrivateDevices=no
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now xing-wei-remap.service
echo "done"