import

Capture some or all of an X server screen, and save the image to a file. Part of ImageMagick. More information: https://imagemagick.org/script/import.php.

import -window root path/to/output.ps

import -window root -display remote_host:screen.display path/to/output.png

import -window window_id path/to/output.jpg