capture a screenshot using imlib2


Capture a screenshot and save it to the current directory with the current date as the filename

$ scrot

Capture a screenshot and save it as capture.png
$ scrot [capture.png]

Capture a screenshot interactively
$ scrot --select

Capture a screenshot from the currently focused window
$ scrot --focused

Display a countdown of 10 seconds before taking a screenshot
$ scrot --count --delay [10]


scrot [-bcfhikmopsuvz] [-a X,Y,W,H] [-C NAME] [-D DISPLAY] [-d SEC] [-e CMD]
      [-F FILE] [-l STYLE] [-n OPTS] [-q NUM] [-S CMD] [-t NUM | GEOM] [FILE]


scrot (SCReenshOT) is a simple command line screen capture utility, it uses imlib2 to grab and save images.

scrot has many useful features:

  • Support for multiple image formats: JPG, PNG, GIF, and others.

  • The screenshot's quality is configurable.

  • It is possible to capture a specific window or a rectangular area on the screen.

Because scrot is a command line utility, it can easily be scripted and put to novel uses. For instance, scrot can be used to monitor an X server in absence.

scrot is free software under the MIT-advertising license.


-a, --autoselect X,Y,W,H

Non-interactively choose a rectangle starting at position X,Y and of W by H resolution.

-b, --border

When selecting a window, grab the WM's border too. Use with -s to raise the focus of the window.

-C, --class NAME

NAME is a window class name. Associative with -k.

-c, --count

Display a countdown when used with -d.

-D, --display DISPLAY

DISPLAY is the display to use; see X(7).

-d, --delay SEC

Wait SEC seconds before taking a shot.

-e, --exec CMD

Execute CMD on the saved image.

-F, --file


-f, --freeze

Freeze the screen when -s is used.

-h, --help

Display help and exit.

-i, --ignorekeyboard

Don't exit for keyboard input. ESC still exits.

-k, --stack OPT

Capture stack/overlapped windows and join them. A running Composite Manager is needed. OPT it's optional join letter: v/h (vertical/horizontal). Default: h

-l, --line STYLE

STYLE indicates the style of the line when the -s option is used; see SELECTION STYLE.

-m, --multidisp

For multiple heads, screenshot all of them in order.

-n, --note OPTS

OPTS is a collection of options which specify notes to bake into the image. See NOTE FORMAT.

-o, --overwrite

By default scrot does not overwrite the output FILE, use this option to enable it.

-p, --pointer

Capture the mouse pointer.

-q, --quality NUM

NUM must be between 1 and 100. For lossless output formats, a higher value represents better but slower compression. For lossy output formats, a higher value represents higher quality and larger file size. Default: 75.

-S, --script CMD

CMD is an imlib2 script.

-s, --select OPT

Interactively select a window or rectangle with the mouse, use the arrow keys to resize. See the -l and -f options. OPT it's optional; see SELECTION MODE

-t, --thumb NUM | GEOM

Also generate a thumbnail. The argument is the resolution of the thumbnail, it may be a percentage NUM or a resolution GEOM. Examples: 10, 25, 320x240, 500x200.

-u, --focused

Use the currently focused window.

-v, --version

Output version information and exit.

-z, --silent

Prevent beeping.


Redirection to standard output. The output image format is PNG.


-e, -F and FILE parameters can take format specifiers that are expanded by scrot when encountered. There are two types of format specifier: Characters preceded by a '%' are interpreted by strftime(2). The second kind are internal to scrot and are prefixed by '$'. The following specifiers are recognised by scrot:

    $$   A literal '$'.
    $a   The system's hostname.
    $f   The image's full path (ignored when used in the filename).
    $h   The image's height.
    $m   The thumbnail's full path (ignored when used in the filename).
    $n   The image's basename (ignored when used in the filename).
    $p   The image's pixel size.
    $s   The image's size in bytes (ignored when used in the filename).
    $t   The image's file format (ignored when used in the filename).
    $w   The image's width.
    \n   A literal newline (ignored when used in the filename).


    $ scrot '%Y-%m-%d_$wx$h.png' -e 'optipng $f'

This would create a PNG file with a name similar to 2000-10-30_2560x1024.png and optimize it with optipng(1).


When using -s, optionally you can indicate the action to perform with the selection area. Some actions allow optional parameters too.

    capture             Capture the selection area, this action is by default and
                        does not need to be specified.

    hole                Highlight the selected area overshadowing the rest of the capture.

    hide,IMAGE          Hide the selection area by drawing an area of color (or image) over it.
                        Optionally indicate name of the image to use as cover.
                        Image has priority over color.

    blur,AMOUNT         Blurs the selection area.
                        Optionally you can specify the amount of blur.
                        Amount,range: 1..30,  default: 18

In modes 'hole' and 'hide' the color of the area is indicated by 'color' property of the line style and the opacity of the color (or image) is indicated by property 'opacity', SELECTION STYLE

If the 'hide' mode uses an image that does not have an alpha channel, the opacity parameter will be ignored and it will be drawn fully opaque.


    $ scrot --select=hide
    $ scrot -shole --line color="Dark Salmon",opacity=200
    $ scrot -sblur,10
    $ scrot -shide,stamp.png --line opacity=120


When using -s, you can indicate the style of the line with -l.

-l takes a comma-separated list of specifiers as argument:

    style=STYLE     STYLE is either "solid" or "dash" without quotes.

    width=NUM       NUM is a pixel count between 1 and 8 inclusive.

    color="COLOR"   Color is a hexadecimal HTML color code or the name of
                    a color. HTML color codes are composed of a pound
                    sign '#' followed by a sequence of 3 2-digit
                    hexadecimal numbers which represent red, green, and
                    blue respectively. Examples: #FF0000 (red), #E0FFFF
                    (light cyan), #000000 (black).

    opacity=NUM     NUM is between 0 and 255 inclusive. 255 means
                    100% opaque, 0 means 100% transparent. For the
                    opacity of the line this is only effective if a
                    Composite Manager is running.

    mode=MODE       MODE is either "edge" or "classic" without quotes.
                    edge is the new selection, classic uses the old one.
                    "edge" ignores the style specifier and the -f flag,
                    "classic" ignores the opacity specifier.

Without the -l option, a default style is used:



    $ scrot -l style=dash,width=3,color="red" -s


The -n option's argument is more arguments:

    -f  'FontName/size'
    -t  'text'
    -x  position (optional)
    -y  position (optional)
    -c  color(RGBA, range 0..255) (optional)
    -a  angle (optional)


    $ scrot -n "-f '/usr/share/fonts/TTF/DroidSans-Bold/40' -x 10
            -y 20 -c 255,0,0,255 -t 'Hi'"


scrot was originally developed by Tom Gilbert.

Currently, source code is maintained by volunteers. Newer versions are available at

Copied to clipboard