I'm trying to set xinput
properties for a USB input device whenever it is connected. I have seen solutions that require a script to run in the background and poll USB devices, but I would like to find a triggered approach rather than one involving user-space polling.
I have tried creating a udev
rule that runs a script on device connection, but it appears that the connected device is not yet visible to xinput
when the udev
add
rule is triggered. This appears to be a constant order of events rather than a race condition as adding a sleep
command to the script also delays the device being listed in xinput list
.
Is there any reliable method of setting xinput
properties for devices when they are connected?