I would like to write a simple script that should work as a daemon. The only thing this daemon has to do, is to check if for a given period neither a key has been hit, nor a mouse moved, nor a touchpad touched, and if it is so, it should switch off the pc.
I realize it is quite a simple program, because it consists of only one condition and one action, but I am clueless how to check this condition of idleness.