python - Linux 中的用户空闲时间

标签 python linux bash

我需要检查在 Linux (lucid - 10.4) 上自上次用户输入发生以来经过了多少时间(首选方式 - 在 python 中)

我知道这在正常情况下很容易(只需使用 XScreenSaverQueryInfo),但棘手的部分是我没有 x11/extensions/scrnsaver.h header ,我必须以其他方式做到这一点(即使我安装所需的包我无法在 100 台其他计算机上安装 packeges - 我没有这样做的权限)。

最佳答案

另一个基于 X 屏幕保护程序的替代方案是 xssstate from suckless-tools :

xssstate -i

关于python - Linux 中的用户空闲时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15068887/

相关文章:

python - flask 冷冻不起作用,而 flask 则可以

Python 2.6 : How can I compare two lists of same object types on one particular field, 有效吗?

linux - Linux 环境中的 Apex 数据加载器?

linux - 使用 rsync 进行增量备份的脚本

python - dask 数组分块如何适用于三个或更多维度?

linux - 关于共享库的问题

linux - 使用 linux shell 命令将多行输出合并为一行重新格式化报告文件

swift - 迪尔德 : Library not loaded; llbuild image not found

linux - 无法使用 find -exec 运行源命令

python - 使用请求将 CURL 命令转换为 Python