Taking screenshots

From NetBSD Wiki

Jump to: navigation, search

ImageMagick

To take screenshots from the console to you will need the program import, which is part of the graphic suite graphics/ImageMagick, which you can install via Pkgsrc or as a binary.

# pkg_add -v ImageMagick

When done you can easily take screenshots with the import command.

# import -window root -quality 90 screenshot.jpg

You can write a small Shell Script to make taking screenshots more comfortable.

xwd

Alternately, you can use xwd(1), the X window dumping utility:

# xwd -out screenshot.xwd -root

The resulting image can be read by various X utilities (like xwud(1)) or converted into other formats with something like graphics/netpbm or graphics/ImageMagick.

scrot

If you prefer lightweight programs and already have graphics/imlib2 installed for any other purpose, you can use graphics/scrot, available via Pkgsrc


It supports all the image formats imlib2 does, it's basically a very minimal wrapper around imlib2 calls.

You can just run it like

# scrot

and it will by default create a file based on the current timestamp, in the PNG file format. You can also supply an output file on the commandline and imlib2 will pick the format based on the extension, you can supply a countdown in seconds etc.

Personal tools