I am looking to write a program that waits indefinitely for an event, in this case, for USB/s to be plugged in and to do some after action that.
I intend to write it in C or Python.
The question is, how can the program be notified when the event has happened (a USB device is plugged in)?
Secondly, if it were done in Python, is there a less resource-intensive way of waiting for the event besides looping?
udev
, it has some example rules./etc/udev
should a place to start or a directory where udev conf files is located.man udev
– Jetchisel Jan 28 '20 at 08:48