Mescalito
Mescalito

Reputation: 2068

detecting user idle (no user input) time globally on Linux or better cross platform

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

Answers (1)

agravier
agravier

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

Related Questions