使用 xephyr 禁用 PyVirtualDisplay 的屏幕保护程序

使用 xephyr 禁用 PyVirtualDisplay 的屏幕保护程序

如何禁用 PyVirtualDisplay 和 xephyr 的屏幕保护程序?

我发现最接近的是https://unix.stackexchange.com/questions/608187/xephyr-server-does-not-have-extension-for-dpms-option它表示从命令行调用“xset s off”。我在 IDE 中运行 Python,因此不确定如何使用我的 Python 程序调用 xset。

我正在使用 CentOS 7、Python 3.9.7 和其余软件包的最新版本(例如,所有 CentOS 更新和 python 软件包的更新)。

我的代码如下:

disp=Display(visible=1, ).start()
#selenium tests
 

答案1

在 xephyr 命令行中添加“-s 0”。
在 Python 中: disp=Display(visible=1, extra_args=['-s', '0']).start()

相关内容