Reputation: 2068
Is there a way to detect no user input (mouse or keyboard) using Python in Linux. I've found some recipes for Windows and Mac but not something consistent. I am assuming there is no cross platform alternative or library unless I missed it.
Upvotes: 2
Views: 1677
Reputation: 224
There is no cross-platform solution, but I made a very simple python 2 module for X11 that specifically addresses your concern: http://pypi.python.org/pypi/actmon
actmon.get_idle_time()
returns the age of last user activity in milliseconds.
Upvotes: 3