
Take a Screenshot from the Command Line #12
Chapter 2, Console
|
41
HACK
command uses the import utility that is part of the ImageMagick suite of
tools (use your package manager to install ImageMagick if it isn’t already on
your system) to take a screenshot of the root window (the root window is the
entire screen) and name the image screen.png. If you want to grab a particu-
lar part of the screen, you also can use the –
crop option to grab that specific
area (such as
import –crop 500x400). And if you run import without –window
your cursor will change to a crosshair, which you can drag over the area you
want to capture. For many print and digital media houses, PNG is a recom-
mended screenshot format, but ImageMagick supports a range of different
formats, so you can use what you need. Read the
import manpage for more
information.
Take a Screenshot from a Command-Line Terminal
If you need to take a screenshot from a command-line console while X is
running elsewhere on the system, adjust the command line and add a few
additional features to it. This method is commonly used when you need a
screenshot of an installation routine or a program running on an embedded
device. To do this, first access the shell that runs behind the installer by
pressing Ctrl-Alt-F2; this provides you with a simple shell in which you can
run the commands to grab the shot. If you are planning on using this hack
while installing a