aboutsummaryrefslogtreecommitdiffstats
path: root/doc/info/chap/invoking.texinfo
blob: bb4d8db40e2352fe458cb2671298fe3dc7370f16 (plain) (blame)
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
@node Invoking
@chapter Invoking

@command{scrotty} recognises four options:

@table @option
@item -h
@itemx --help
Print usage information and exit.
@item -v
@itemx --version
Print program name and version and exit.
@item -c
@itemx --copyright
Print copyright information and exit.
@item -r
@itemx --raw
Save the images in portable anymap format
(@sc{PNM}), rather than in Portable Network
Graphics (@sc{PNG}).

@sc{PNM} images are highly compressable with
@command{bzip2}. Compressed images are comparable
in size with @sc{PNG},@footnote{Usually a few
bytes in difference.} and can in fact be smaller.

@sc{PNM} is a good alternative for anything
but storage. (Unless you compress them.)

This option is also useful, in combination with
@option{--exec} if you want to save the image
in any other format.
@item -e
@itemx --exec CMD
Run a command for each saved image.

Can only be specified once.
@end table

In addition to these options, a filename
pattern, that does not start with a dash,
can be added. This filename pattern selects
with what filename the image should be saved.

Both the @option{--exec} and filename pattern
parameters can take format specifiers that are
expanded by @command{scrotty} when encountered.
There are two types of format specifier.
Characters preceded by a `%' are interpreted
by @code{strftime}. See @ref{strftime} or the
manual for your implemenation of @command{strftime}
for examples. These options may be used to refer
to the current date and time. The second kind are
internal to scrotty and are prefixed by `$' or
`\'. The following specifiers are recognised:

@table @asis
@item `@code{$i}'
Framebuffer index.
@item `@code{$f}'
Image filename/pathname.
Ignored in the filename pattern.
@item `@code{$n}'
Image filename.
Ignored in the filename pattern.
@item `@code{$p}'
Image width multiplied by image height.
@item `@code{$w}'
Image width.
@item `@code{$h}'
Image height.
@item `@code{$$}'
Expands to a literal `$'.
@item `@code{\n}'
Expands to new line.
@item `@code{\\}'
Expands to a literal `\'.
@item `@code{\ }'
Expands to a literal ` '.                                           
@end table

A space that is not prefixed by a backslash in
@option{--exec} is interpreted as an argument
delimiter. This is the case even at the beginning
and end of the string and if a space was the
previous character in the string.

For example,
@command{scrotty `%Y-%m-%d_$wx$h.$i.png` --exec 'cp $f ~/.backups/shots/'}
create a file called something like @file{2014-10-28_1792x1344.0.png}
for your first framebuffer and @file{2014-10-28_1792x1344.1.png} for
your second framebuffer, and copies the saved images to @file{~/.backups/shots/}.