O
O
OCCASS OCCASSOVICH2022-03-01 09:31:25
linux
OCCASS OCCASSOVICH, 2022-03-01 09:31:25

How to take a screenshot of a virtual display in linux?

Look, I start programs like this with the following command:

DISPLAY=:99 xvfb-run -a -n 1 -l -s "-screen 0, 1920x1080x8" python3 main.py

How can I take a screenshot of the display on which I launched it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2022-03-01
@rPman

vncsnapshot
is in the upd repositories . I didn’t think that you might not have a vnc server, the X server itself can give screenshots, the utility

xwd -root -display :99 | convert - png:- > screenshot.png

in this case xwd (x11-app package) takes the screenshot and convert (imagemagic package) converts it to png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question