While working on scripts, I execute it hundreds of times while iterating on it (big fan of baby steps approach).
To run my script, I usually have to switch focus to my terminal & run the last command, which makes me lose a bit of focus after the 10th+ time.
One solution is to use a file monitor that runs a command everytime a file gets modified, but in my experience, for most scripts I want to decide when to rerun the script.
After buying a USB foot pedal, I was wondering how can I use it to automate this small inconvenience.
Run an arbitrary terminal command everytime we detect a USB device event in Python.
Python Code below
Explanation Video on https://www.youtube.com/watch?v=VaVcv8CMePw