Skip to content

Instantly share code, notes, and snippets.

@peter-avila
Forked from komamitsu/systemd-xremap.md
Created May 5, 2025 19:53
Show Gist options
  • Select an option

  • Save peter-avila/6d33791cb9b259c2904a0c047cd92536 to your computer and use it in GitHub Desktop.

Select an option

Save peter-avila/6d33791cb9b259c2904a0c047cd92536 to your computer and use it in GitHub Desktop.
Execute xremap from systemd

Execute xremap as root user

Create /etc/systemd/system/xremap.service file

[Unit]
Description=xremap service
After=default.target

[Service]
ExecStart=/usr/bin/xremap /home/komamitsu/xremap.yml

[Install]
WantedBy=default.target

Register the service to systemd

sudo systemctl enable xremap.service

Start the service

sudo systemctl start xremap.service

Execute xremap as a normal user

(Thank you https://github.com/dcraig327!)

Allow the user to access input events

Add the user to input group if it's not added.

sudo gpasswd -a YOUR_USER input

Then, execute the following command if /etc/udev/rules.d/input.rules doesn't have the entry.

echo 'KERNEL=="uinput", GROUP="input", TAG+="uaccess"' | sudo tee /etc/udev/rules.d/input.rules

Create $HOME/.config/systemd/user/xremap.service file

[Unit]
Description=xremap
After=default.target

[Service]
ExecStart=%h/.cargo/bin/xremap %h/.config/xremap/config.yml
StandardOutput=journal
StandardError=journal
Restart=always

[Install]
WantedBy=default.target

Register the service to systemd

systemctl --user enable xremap.service

Start the service

systemctl --user start xremap.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment