Skip to content

Instantly share code, notes, and snippets.

@danielres
Last active March 8, 2024 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielres/10f3a62c0fa4fb391a583d9ec75b18d3 to your computer and use it in GitHub Desktop.
Save danielres/10f3a62c0fa4fb391a583d9ec75b18d3 to your computer and use it in GitHub Desktop.
xremap as a service

Place the files

mv config.yml /home/daniel/.config/xremap/config.yml
mv service.sh /home/daniel/.config/xremap/service.sh
sudo mv xremap.service /etc/systemd/system/xremap.service

Start the service

sudo systemctl daemon-reload
sudo systemctl enable xremap.service
sudo systemctl start xremap.service

Useful commands

Diagnostics:

systemctl status xremap.service 
journalctl -fu xremap.service

Restart service:

sudo systemctl restart xremap.service  
# /home/daniel/.config/xremap/config.yml
modmap:
- name: terminal
application:
only: [/.*tilix.*/]
remap:
CapsLock:
held: CapsLock
alone: esc
alone_timeout_milis: 50
#!/bin/bash
# /home/daniel/.config/xremap/service.sh
/home/daniel/.local/bin/xremap /home/daniel/.config/xremap/config.yml --watch=config #--device /dev/input/event7
# /etc/systemd/system/xremap.service
[Unit]
Description=Daniel's xremap service
After=graphical.target
[Service]
Restart=always
User=daniel
Environment="DISPLAY=:0" "XAUTHORITY=/home/daniel/.Xauthority"
ExecStart=/bin/bash /home/daniel/.config/xremap/service.sh
RestartSec=60
StartLimitInterval=30
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment