ponty / PyVirtualDisplay

Python wrapper for Xvfb, Xephyr and Xvnc
BSD 2-Clause "Simplified" License
697 stars 78 forks source link

Get X Display number #61

Closed bigdav1178 closed 2 years ago

bigdav1178 commented 3 years ago

I would like to know how to determine the X Display number that is getting assigned by PyVirtualDisplay when set for Xvfb. I want to have ffmpeg record the xvfb display, but I'm not sure what input to give it. I tried running the "w" command from a console window, but it is only indicating the default :0 display.

ponty commented 3 years ago
import os
from pyvirtualdisplay import Display

with Display() as disp:
    print(os.environ.get("DISPLAY"))