kfreestyle2d
                                
                                 kfreestyle2d copied to clipboard
                                
                                    kfreestyle2d copied to clipboard
                            
                            
                            
                        Use systemd instance template for device dependencies
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 systemdtag andSYSTEMD_WANTSto kick off the service
- The service is now an instance template that takes the kinesis device name as a parameter
- See the note here for a good example of how parameters work
 
- The service depends on the kinesis device
- As explained in systemd.device above
 
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)
Thank you for putting this together! I will try to look at it this weekend!