• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

include/H17-Apr-2021-147107

protocol/H17-Apr-2021-335279

.build.ymlH A D17-Apr-2021247 1716

.editorconfigH A D17-Apr-2021129 97

.gitignoreH A D17-Apr-2021438 5545

LICENSEH A D17-Apr-20211 KiB2217

README.mdH A D17-Apr-2021985 6341

main.cH A D17-Apr-202128.5 KiB1,008865

meson.buildH A D17-Apr-20211.3 KiB7057

pool-buffer.cH A D17-Apr-20213.1 KiB146122

render.cH A D17-Apr-20212.6 KiB9173

slurp.1.scdH A D17-Apr-20212.3 KiB9460

README.md

1# slurp
2
3Select a region in a Wayland compositor and print it to the standard output.
4Works well with [grim](https://github.com/emersion/grim).
5
6It currently works on Sway 1.0.
7
8Join the IRC channel: ##emersion on Freenode.
9
10## Building
11
12Install dependencies:
13* meson
14* wayland
15* cairo
16* libxkbcommon
17* scdoc (optional: man pages)
18
19Then run:
20
21```sh
22meson build
23ninja -C build
24build/slurp
25```
26
27## Example usage
28
29Select a region and print it to stdout:
30
31```sh
32slurp
33```
34
35Select a single point instead of a region:
36
37```sh
38slurp -p
39```
40
41Select an output and print its name:
42
43```sh
44slurp -o -f "%o"
45```
46
47Select a window under Sway, using `swaymsg` and `jq`:
48
49```sh
50swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp
51```
52
53## Contributing
54
55Either [send GitHub pull requests][1] or [send patches on the mailing list][2].
56
57## License
58
59MIT
60
61[1]: https://github.com/emersion/slurp
62[2]: https://lists.sr.ht/%7Eemersion/public-inbox
63