检测键盘,在linux下鼠标活动鼠标、键盘、linux

2023-09-12 04:21:29 作者:待我强大给我媳妇一片天下

我需要一些方法来检测鼠标/键盘活动在Linux上。类似于任何IM程序会做什么,如果没有actiivty是dected的发言权5分钟,它将把你的IM状态为我现在不在这里。 对任何帮助是AP preciated。 谢谢

I need some way to detect mouse/keyboard activity on Linux. something similar to what any IM program would do, if no actiivty is dected for say 5minutes, it will set your IM status to "I'm not here right now" Any help towards this is appreciated. Thanks

推荐答案

或者干脆用命令 xprintidle 返回空闲时间以毫秒为单位。

Or simply use the command xprintidle which returns the idle time in milliseconds.

据打包基于Debian的系统。 (来源是不提供任何更多的原始网站dtek.chalmers.se/~henoch,但你可以在packages.ubuntu.com)

It has been packaged for debian based systems. (the source is not available any more on the original site dtek.chalmers.se/~henoch but you can get it at packages.ubuntu.com)

在freshmeat.net 更多信息