summaryrefslogtreecommitdiffstats
path: root/swaygrab/swaygrab.1.txt
blob: 8faf43f5ec11abedd72756c6dab315527c23d5ae (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
/////
vim:set ts=4 sw=4 tw=82 noet:
/////
:quotes.~:

swaygrab (1)
============

Name
----
swaygrab - Grab image data from the current sway session.

Synopsis
--------
'swaygrab' [options] [file]

Grabs pixels from an output and writes them to _file_. The image will be passed to
ImageMagick convert for processing.

Options
-------

*-h, --help*::
	Show help message and quit.

*-c, \--capture*::
	Captures multiple frames as video and passes them into ffmpeg. Continues until
	you send SIGTERM (ctrl+c) to swaygrab.

*-o, \--output* <output>::
	Use the specified _output_. If no output is defined the currently focused
	output in sway will be used.

*-v, \--version*::
	Print the version (of swaymsg) and quit.

*-s, --socket* <path>::
	Use the specified socket path. Otherwise, swaymsg will ask sway where the
	socket is (which is the value of $SWAYSOCK, then of $I3SOCK).

*-R, --rate* <rate>::
	Specify a framerate (in frames per second). Used in combination with -c.
	Default is 30. Must be an integer.

*-r, --raw*::
	Instead of invoking ImageMagick or ffmpeg, dump raw rgba data to stdout.
	
*-f, --focused*::
	Capture only the currently focused container.

Environment Variables
---------------------
swaygrab reads the following environment variables.

*SWAYGRAB_FFMPEG_OPTS*::
	Pass additional arguments to FFmpeg when starting a capture.

Examples
--------

swaygrab output.png::
	Grab the contents of currently focused output and write to output.png.

swaygrab -c -o HDMI-A-1 output.webm::
	Capture a webm of HDMI-A-1.

SWAYGRAB_FFMPEG_OPTS="-f alsa -i pulse" swaygrab -c::
	Capture the focused output and encode audio from the default recording
	device.

Authors
-------

Maintained by Drew DeVault <sir@cmpwn.com>, who is assisted by other open
source contributors. For more information about sway development, see
<https://github.com/swaywm/sway>.