kfreestyle2d icon indicating copy to clipboard operation
kfreestyle2d copied to clipboard

Use systemd instance template for device dependencies

Open samiconductor opened this issue 5 years ago • 1 comments

I think I've got something working for #8. I was having to unplug / plug in the keyboard to get it working after reboot or power cycle. But with this it picks it up on startup! I was excited anyway.

It changes up things a bit though and the service bypasses sort-and-run.sh which could be cleaned up if you're good with the approach in this PR. Also it runs two separate instances of kfreestyle2d, one for each device. You can get the status with systemctl status [email protected] for example. AFAIK two instances are fine?

Changes:

  • Udev uses the systemd tag and SYSTEMD_WANTS to kick off the service
  • The service is now an instance template that takes the kinesis device name as a parameter
  • The service depends on the kinesis device

Here's a good example of putting it all together. It's also where I got the idea to depend on user session service. (edit: works fine without waiting for systemd-user-sessions.service)

samiconductor avatar Aug 06 '20 15:08 samiconductor

Thank you for putting this together! I will try to look at it this weekend!

whereswaldon avatar Aug 06 '20 17:08 whereswaldon