GNU/Linux Desktop Survival Guide
by Graham Williams
2018-05-10 ImageMagick provides a
simple screen or window shooting facility. To capture the whole screen
we specify with the -window option to the
import command identifying that we want to capture the
$ import -window root screen.png $ display screen.png
We can capture a specific window chosen with a click of the mouse
button with the -frame option of the import
command. This will include the window manager's frame that surrounds a
window. In the following example we -pause 5 seconds before
capturing the selected window:
$ import -frame -pause 5 window.png
This will capture the screen region occupied by the window and thus might include other windows that overlap with the selected window, so the pause option is useful to allow us to bring the window of interest to the front.
A simple mechanism for obtaining a window shot is to run the command from the Run Application window, usually initiated with Alt-F2. Alternatively, run the display command from a terminal (or the Run Applications window) and click the Capture button.