wez / evremap

A keyboard input remapper for Linux/Wayland systems, written by @wez
MIT License
325 stars 28 forks source link

Using the same config for several keyboards #17

Open jbriales opened 1 year ago

jbriales commented 1 year ago

Is it possible to use the same configuration for several input devices?

Ideally sth like:

If the above was possible, I wonder how connecting/disconnecting either of A/B would affect the process?

ChenKS12138 commented 1 year ago

SGTM.

ChenKS12138 commented 1 year ago

I have the same question, and it seems worked to use GNU parallel to work with several input devices.

[Service]
WorkingDirectory=/
ExecStart=parallel --retries -1 /usr/bin/evremap remap {}; sleep 5 ::: /etc/evremap/evremap-k2-cable.toml /etc/evremap/evremap-k2-bth.toml
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
KSaiAkshit commented 1 year ago

I am just running two services, evremap1 and evremap2, one for external keyboard and another for laptop. The parallel's trick didn't work for me though.

wez commented 12 months ago

I think this is a reasonable feature request. I don't currently have time to work on this myself though.

M8850 commented 3 months ago

I can work on this. I just need to be told specificaly briefly how to do it the optimal way (so it can be added to the project).

Im the guy who did the GUI for the config files for fun.

wez commented 3 weeks ago

FWIW, it is now possible in main to override the device_name and/or phys via the command line. A single evremap process instantiation can still only process events from a single matching device.

Handling events from multiple devices in the same process needs a bit more thought; if we can avoid that, it will help keep things simpler overall.

stephanlamoureux commented 7 hours ago

I am just running two services, evremap1 and evremap2, one for external keyboard and another for laptop. The parallel's trick didn't work for me though.

this isn't working for me, are your service files identical except pointing to different toml files? My first service starts but the second one will not.

edit: Added an ExecStartPre=/bin/sleep 5 to the second service and all is well. You saved the day for me, I can't get the VIA app to work but now it's doing what I need 🍻

Except I needed to add a third service since the wired/wireless are separate. I can't hot swap between wired/wireless and need to reboot if I want the remapping to take effect when switching between wired/wireless but I'll take it.