开发者

Linux idle event In Python

How can I determine idle time in Python on Linux, meaning no keyboard or mouse activity for the past few seconds or minutes? All开发者_运维知识库 present links tell how to do it on windows but not on Linux.


Usually the screen saver daemon handles idle time reporting in Linux. If you are running XScreenSaver, you can use PyXSS. gnome-screensaver and kscreensaver have a GetSessionIdleTime method that you can call using D-Bus, but I'm not sure it does what I think it does (i.e. when is the system considered "idle"?).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜