I would like to write a script to do an heavy network upload, in the background.
However, I would like it to pause when I am using my computer (either by detecting network activity or keyboard activity or that I am not idle).
What is the best way to detect that I am using the computer, on Python on Unix?
Stick a webcam on your computer that grabs an image every five seconds, then there's some python modules for image analysis that can check if you are still sitting in your seat.
Or get a microswitch wired into your chair, connect that to your PC serial port (or one of those modern USB ports) and read that from Python...
In Python on Unix, determine if I am using my computer? or idle?