I would like to know if it's possible to setup special trigger events for devices when plugged in and/or unplugged from the system on the fly without needing to configure it every time the device is plugged in or removed. A trigger that watches
so it knows when the device is connected or not connected and it either starts or kills the daemon for that device while in use.
Here's what I'm aiming to use trigger events for;
I have a gamepad controller I like to use for playing games, and everytime I go to use it, I always have to mess around with the configuration for it everytime I plug it in to make it work for specific configuration for the controller. But also in some case events where the controller randomly disconnects and reconnects it resets and ignores the configuration I set for it, meaning I got to re-configure it again. So my aim is to have it re-run my configurations by calling it from a script when it detects the device is plugged in to pre-set the config file for it. Would there be something in
I could create to make it do that as a rule? The configuration file for my gamepad is stored in
and can also be called in
I'd like to be able to make it check and apply that configuration file every time it detects the gamepad is plugged in or unplugged. The config has option for running a daemon which can lock a PID file inside of
when it's running. Make it pre-check if the daemon process is currently running, if not, start it and apply the configuration from the config file upon detecting the gamepad device. It can sometimes mess with Steam games when playing and make me have to re-check the box to enable controller, which can be a lot of faffing about when you just want it to continue where it left off if the controller loses connection for a moment before reconnecting and not reading from the config file.