This page was last modified: March 17 2008 22:53:54   
Too Cool for Internet Explorer

Scrot screenshots

Pressing the "Print Screen" button on your keyboard is easy. The "Take Screenshot" application that comes with Gnome, will even popup automatically and ask if you want the whole screen, or just the current window.

But "Take Screenshot" does not have the ability to grab a specific area of a window. This is where Scrot comes in handy. Scrot is a command-line tool, which makes it even more flexible.

Install Scrot

Scrot is installed via "Applications" -> "Add/Remove Software" or from the commandline:

yum install scrot

Scrot commands

Here's a few examples:

Take a screenshot with a 5 second delay:
scrot -d 5 desktop.jpeg

Add -c to the delay for a countdown:
scrot -d 15 -c desktop.png

Add -s to select a rectangle with your mouse
scrot desktop.png -s

Scrot provides many other exiting options (for example -t for thumbnail and -q for quality), and naturally you can combine them. Type man scrot to learn more.

Scrot commands the lazy way

Typing commands again and again isn't very convenient. Therefore I store my favorite screenshot commands on the Gnome panel.:

  1. Right-click an empty space on your panel and choose "Add to Panel..."
  2. Select "Custom Application Launcher..." and click "Add"
  3. Type a name and optionally a description. Then fill the command field with a scrot command of your choice.

The command can be any command you would normally write on the command line, for example:

scrot -s my_screenshot.png

After running this command you would draw a rectangle on the screen, and the file is saved in your home directory as soon as you release the mouse button.

This very simple command will overwrite any existing screenshot each time. But that is easily fixed. You can also tell scrot to save the files in a specific folder:

scrot -s '%%s.png' -e 'mv $f ~/screenshots/'

The above command will name the file with a timestamp and save it in the screenshots folder of your home directory. The timestamp ensures that each screenshot is named differently (unless you're very fast).

If you run this command from a command line, you must omit the extra % in '%%s.png'. It's only necessary to have two % when using it with "Custom Application Launcher...".



This tutorial was inspired by: freesoftmagazine.com (How to take screenshots with Scrot)