evremap icon indicating copy to clipboard operation
evremap copied to clipboard

Using the same config for several keyboards

Open jbriales opened this issue 2 years ago • 8 comments

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

Ideally sth like:

  • I list Keyboards A and B in config.toml
  • I have Keyboards A and B connected, run evremap mapper config.toml and it starts acting on both A and B

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

jbriales avatar Sep 29 '22 13:09 jbriales

SGTM.

ChenKS12138 avatar Dec 10 '22 04:12 ChenKS12138

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

ChenKS12138 avatar Dec 11 '22 05:12 ChenKS12138

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.

KSaiAkshit avatar Jun 20 '23 11:06 KSaiAkshit

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

wez avatar Jul 10 '23 15:07 wez

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.

M8850 avatar Mar 22 '24 18:03 M8850

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.

wez avatar Jun 09 '24 14:06 wez

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.

stephanlamoureux avatar Jul 05 '24 21:07 stephanlamoureux

Just thought I would comment that after reading and needing the same solution the separate file approach worked well for me.

I have two toml files (evremap_int.toml & evremap_ext.toml), one for each of the keyboards. I then have two .service files (evremap_int.service and evremap_ext.service), with the internal service file pointing at the internal .toml file and likewise for the external file.

Then I enable and start up the two services with "sudo systemctl enable" and "sydo systemctl start".

I can confirm this works for me.

But all I want is the easiest way to remap my capslock to control without breaking the disable while typing functionality assoicated with a trackpad. evremap acheves this so thankyou! The other remapper I tried broke my disable while typing.

robertsbd avatar Aug 05 '24 12:08 robertsbd