I been capturing a large number of window-shots on Linux servers recently. To do this I’ve been doing a screen-shot by hitting the “Print Screen” key (or Actions > Take Screenshot…), then manually chopping out the relevant window from the screen-shot. Needless to say it’s a complete pain in the butt.
After wasting quite some time doing this I thought I’d google round for a quicker solution. Almost instantly I hit upon the ImageMagick package. It’s on the RedHat/CentOS/Fedora CDs and if you have the “Graphics” option installed you probably have it already.
The two command line options of interest to me were:
import -window root /mypath/screenshot.jpg
The first option captures the whole screen and saves it as the specified. The second option captures the contents of the next window you click on and saves it as the specified file. The window frame is not captured, just the contents.
Unfortunately, I’ve completed most of my current batch of window-shots, but next time around life will be alot easier and quicker 🙂