File: scrot.1

package info (click to toggle)
scrot 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 500 kB
  • sloc: ansic: 2,132; sh: 46; makefile: 38
file content (358 lines) | stat: -rw-r--r-- 10,889 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
.\" Text automatically generated by txt2man
.TH scrot 1 "13 Mar 2026" "scrot-2.0.0" "command line screen capture utility"
.SH NAME
\fBscrot \fP- command line screen capture utility
\fB
.SH SYNOPSIS
.nf
.fam C
\fBscrot\fP [\fB-bcfhimopuvz\fP] [\fB-a\fP \fIX,Y,W,H\fP] [\fB-C\fP \fINAME\fP] [\fB-D\fP \fIDISPLAY\fP] [\fB-d\fP \fISEC\fP] [\fB-e\fP \fICMD\fP]
      [\fB-k\fP \fIOPT\fP] [\fB-l\fP \fISTYLE\fP] [\fB-M\fP \fINUM\fP] [\fB-n\fP \fIOPTS\fP] [\fB-q\fP \fINUM\fP] [\fB-s\fP \fIOPTS\fP] [\fB-t\fP % | \fIWxH\fP]
      [\fB-w\fP \fINUM\fP] [[\fB-F\fP] \fIFILE\fP]

.fam T
.fi
.fam T
.fi
.SH DESCRIPTION
\fBscrot\fP (SCReenshOT) is a simple command line screen capture utility, it uses
imlib2 to grab and save images.
.PP
\fBscrot\fP has many useful features:
.RS
.IP \(bu 3
Support for multiple image formats: JPG, PNG, GIF, and others.
.IP \(bu 3
The screenshot's quality is configurable.
.IP \(bu 3
It is possible to capture a specific window or a rectangular area on the
screen.
.RE
.PP
Because \fBscrot\fP is a command line utility, it can easily be scripted and put to
novel uses. For instance, \fBscrot\fP can be used to monitor an X server in absence.
.PP
\fBscrot\fP is free software under the MIT-feh license.
.SH OPTIONS
.TP
.B
\fB-a\fP, \fB--autoselect\fP \fIX,Y,W,H\fP
Non-interactively choose a rectangle starting at
position X,Y and of W by H resolution.
.TP
.B
\fB-b\fP, \fB--border\fP
When selecting a window, grab the WM's border too.
Use with \fB-s\fP to raise the focus of the window.
.TP
.B
\fB-C\fP, \fB--class\fP \fINAME\fP
\fINAME\fP is a window class name. Associative with \fB-k\fP.
.TP
.B
\fB-c\fP, \fB--count\fP
Display a countdown when used with \fB-d\fP.
.TP
.B
\fB-D\fP, \fB--display\fP \fIDISPLAY\fP
\fIDISPLAY\fP is the display to use; see \fBX\fP(7).
.TP
.B
\fB-d\fP, \fB--delay\fP [b]\fISEC\fP
Wait \fISEC\fP seconds before taking a shot.
When given the `b` prefix, e.g `\fB-d\fP b8`, the delay
will be applied before selection.
.TP
.B
\fB-e\fP, \fB--exec\fP \fICMD\fP
Execute \fICMD\fP on the saved image.
.TP
.B
\fB-F\fP, \fB--file\fP \fIFILE\fP
Specify the output file. If \fIFILE\fP is "-", \fBscrot\fP will
output the image to stdout. The filename is
expanded according to the format specified in
SPECIAL STRINGS. The output file may be specified
through the \fB-F\fP option, or as a non-option argument.
.TP
.B
\fB-f\fP, \fB--freeze\fP
Freeze the screen when \fB-s\fP is used.
.TP
.B
\fB-h\fP, \fB--help\fP
Display help and exit.
.TP
.B
\fB-i\fP, \fB--ignorekeyboard\fP
Don't exit for keyboard input. ESC still exits.
.TP
.B
\fB-k\fP, \fB--stack\fP[=\fIOPT\fP]
Capture stack/overlapped windows and join them. A
running Composite Manager is needed for it to work
correctly. \fIOPT\fP is optional join letter: v/h
(vertical/horizontal). Default: h
.TP
.B
\fB-l\fP, \fB--line\fP \fISTYLE\fP
\fISTYLE\fP indicates the style of the line when the \fB-s\fP
option is used; see SELECTION \fISTYLE\fP.
.TP
.B
\fB-M\fP, \fB--monitor\fP \fINUM\fP
Capture Xrandr monitor number \fINUM\fP.
.TP
.B
\fB-m\fP, \fB--multidisp\fP
For multiple heads, screenshot all of them in order.
.TP
.B
\fB-o\fP, \fB--overwrite\fP
By default \fBscrot\fP does not overwrite the output
\fIFILE\fP, use this option to enable it.
.TP
.B
\fB-p\fP, \fB--pointer\fP
Capture the mouse pointer.
.TP
.B
\fB-q\fP, \fB--quality\fP \fINUM\fP
\fINUM\fP must be within [1, 100]. A higher value
represents better quality image and a lower value
represents worse quality image. Effect of this flag
depends on the file format, see COMPRESSION QUALITY
section. Default: 75.
.TP
.B
\fB-s\fP, \fB--select\fP[=\fIOPTS\fP]
Interactively select a window or rectangle with the
mouse, use the arrow keys to resize. See the \fB-l\fP and
\fB-f\fP options. \fIOPTS\fP it's optional; see SELECTION MODE
.TP
.B
\fB-t\fP, \fB--thumb\fP % | \fIWxH\fP
Also generate a thumbnail. The argument represents
the thumbnail's resolution: if the argument is a
single number, it is a percentage of the full size
screenshot's resolution; if it is 2 numbers
separated by an "x" character, it is a resolution.
If one of the resolution's dimensions is 0, it is
replaced by a number that maintains the full size
screenshot's aspect ratio. Examples: 10, 25, 320x240,
500x200, 100x0, 0x480.
.TP
.B
\fB-u\fP, \fB--focused\fP, \fB--focussed\fP
Use the currently focused window.
.TP
.B
\fB-v\fP, \fB--version\fP
Output version information and exit.
.TP
.B
\fB-w\fP, \fB--window\fP WID
Window identifier to capture.
WID must be a valid identifier (see \fBxwininfo\fP(1)).
.TP
.B
\fB-Z\fP, \fB--compression\fP LVL
Compression level to use, LVL must be within
[0, 9]. Higher level compression provides lower file
size at the cost of slower encoding/saving speed.
Effect of this flag depends on the file format, see
COMPRESSION QUALITY section. Default: 7.
.TP
.B
\fB-z\fP, \fB--silent\fP
Prevent beeping.
.TP
.B
\fB--format\fP FMT
Specify the output file format. E.g "\fB--format\fP png".
If no format is specified, \fBscrot\fP will use the file
extension to determine the format. If filename
does not have an extension either, then PNG will
be used as fallback.
.TP
.B
\fB--list-options\fP[=\fIOPT\fP]
List all program options. If argument is "tsv" it
outputs a TAB separated list intended for scripts.
Default is "human". Note that the tsv format is not
stable and may change in the future.
.SH SPECIAL STRINGS
\fB-e\fP, \fB-F\fP and \fIFILE\fP parameters can take format specifiers that are expanded
by \fBscrot\fP when encountered. There are two types of format specifier:
Characters preceded by a '%' are interpreted by \fBstrftime\fP(3). The second kind
are internal to \fBscrot\fP and are prefixed by '$'. The following specifiers are
recognised by \fBscrot\fP:
.PP
.nf
.fam C
    $$   A literal '$'.
    $a   The system's hostname.
    $F   The output file format.
    $f   The image's path (may be relative, ignored when used in the filename).
    $h   The image's height.
    $m   The thumbnail's path (may be relative, 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.
    $W   The name of the window (only for --select, --focused and --window).
    \\n   A literal newline (ignored when used in the filename).

.fam T
.fi
Example:
.PP
.nf
.fam C
    $ scrot '%Y-%m-%d_$wx$h.png' -e 'du -h $f'

.fam T
.fi
This would create a PNG file with a name similar to 2000-10-30_2560x1024.png
and show the disk-usage with \fBdu\fP(1).
.SH SELECTION MODE
When using \fB-s\fP, optionally you can indicate the action to perform with the selection area.
Some actions allow optional parameters too.
.PP
.nf
.fam C
    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 must be within [1, 30]. Default: 18.

.fam T
.fi
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 \fISTYLE\fP
.PP
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.
.PP
Examples:
.PP
.nf
.fam C
    $ scrot --select=hide
    $ scrot -shole --line color="Dark Salmon",opacity=200
    $ scrot -sblur,10
    $ scrot -shide,stamp.png --line opacity=120

.fam T
.fi
.SH SELECTION STYLE
When using \fB-s\fP, you can indicate the style of the line with \fB-l\fP.
.PP
\fB-l\fP takes a comma-separated list of specifiers as argument:
.PP
.nf
.fam C
    style=STYLE     STYLE is either "solid" or "dash" without quotes.

    width=NUM       NUM is a pixel count within [1, 8].

    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 within [0, 255]. 255 means 100% opaque, 0 means
                    100% transparent. For the opacity of the line, this is only
                    effective if the compositor supports _NET_WM_WINDOW_OPACITY.

    mode=MODE       MODE can be "auto", "edge" or "classic" without quotes.
                    edge is the new selection, classic uses the old one.
                    "auto" uses "edge" if -f flag isn't active, "classic"
                    otherwise. "edge" ignores the style specifier, "classic"
                    ignores the opacity specifier.


.fam T
.fi
Without the \fB-l\fP option, a default style is used:
.PP
.nf
.fam C
    mode=auto,style=solid,opacity=100

.fam T
.fi
The default width is automatically derived from the display DPI.
.PP
Example:
.PP
.nf
.fam C
    $ scrot -l style=dash,width=3,color="red" -s

.fam T
.fi
.SH COMPRESSION QUALITY

For lossless formats (e.g PNG), the quality options is ignored. For lossy
formats where the quality and compression are tied together (e.g JPEG),
compression will be ignored. And for image formats where quality and
compression can be independently set (e.g WebP, JXL), both flags are respected.
.SH EXAMPLES

Following are a couple examples of using \fBscrot\fP with other utilities.
.PP
Copying screenshot to clipboard using \fBxclip\fP(1):
.PP
.nf
.fam C
  $ scrot - | xclip -selection clipboard -target image/png

.fam T
.fi
Taking a screenshot and optimizing its size with \fBoptipng\fP(1):
.PP
.nf
.fam C
  $ scrot -e 'optipng -o4 $f'

.fam T
.fi
Selecting a window by PID with \fBxdo\fP(1):
.PP
.nf
.fam C
  $ scrot -w $(xdo id -p PID)

.fam T
.fi
Taking a screenshot and annotating it with \fBImageMagick\fP(1):
.PP
.nf
.fam C
  $ scrot - | magick - -pointsize 64 -gravity North -annotate +16+16 'hello, world!' out.png

.fam T
.fi
.SH AUTHOR
\fBscrot\fP was originally developed by Tom Gilbert.
.PP
Currently, source code is maintained by volunteers. Newer versions
are available at https://github.com/resurrecting-open-source-projects/\fBscrot\fP
.SH SEE ALSO
\fBImageMagick\fP(1)
\fBoptipng\fP(1)
\fBxclip\fP(1)
\fBxdo\fP(1)
\fBxwininfo\fP(1)