如何在没有显示关联的情况下启动X11窗口

时间:2022-06-24 18:06:12

I'd like to start Firefox for example with no display associated and eventually take a screenshot with import.

我想启动Firefox,例如没有关联的显示,最终用导入截取屏幕截图。

Can I in fact make it periodically with cronjobs?

事实上,我可以定期使用cronjobs吗?

I'm now making a ssh -X connection, take the xwininfo for the window started in background and everything's OK. But I'd like to automate it.

我现在正在建立一个ssh -X连接,在背景中启动窗口的xwininfo,一切正常。但我想自动化它。

2 个解决方案

#1


You could start Firefox inside Xvfb.

你可以在Xvfb中启动Firefox。

If you gave Xvfb its -fbdir option then you would also have the option to take your screenshot from the Xvfb framebuffer file. You would probably want to specify the same geometry for Xvfb and Firefox.

如果您为Xvfb提供了-fbdir选项,那么您还可以选择从Xvfb framebuffer文件中截取屏幕截图。您可能希望为Xvfb和Firefox指定相同的几何体。

#2


How about starting firefox inside a vncserver?

如何在vncserver中启动firefox?

You can capture the value for $DISPLAY using grep

您可以使用grep捕获$ DISPLAY的值

e.g.

export DISPLAY=`vncserver 2>&1 | egrep --only-matching ":[0-9]+" | head -n1`

#1


You could start Firefox inside Xvfb.

你可以在Xvfb中启动Firefox。

If you gave Xvfb its -fbdir option then you would also have the option to take your screenshot from the Xvfb framebuffer file. You would probably want to specify the same geometry for Xvfb and Firefox.

如果您为Xvfb提供了-fbdir选项,那么您还可以选择从Xvfb framebuffer文件中截取屏幕截图。您可能希望为Xvfb和Firefox指定相同的几何体。

#2


How about starting firefox inside a vncserver?

如何在vncserver中启动firefox?

You can capture the value for $DISPLAY using grep

您可以使用grep捕获$ DISPLAY的值

e.g.

export DISPLAY=`vncserver 2>&1 | egrep --only-matching ":[0-9]+" | head -n1`