Wednesday 10 July 2013

screen capture on Linux

There are many different ways to do a screen capture of the desktop using various command line utilities which grab a portion of the display such as ImageMagick or utilise built-in functionality of the Window Manager being used. However, I have discovered another cool command line tool to do this called scrot.

With it you can do the usual create an image of the desktop after a certain length of time, but the features I have found useful are the ability to select an area of the screen to save (-s option) and the ability to execute a command on the saved image (-e option).

e.g.
scrot -s <new image file> -e 'gpicview %f'

From the example, scrot also can use some format specifiers for -e and filename options, here I use %f to get the filename.

It would be easy to add a scrot command to scripts for easy quick screen capture.