File: README.md

package info (click to toggle)
slurp 1.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 176 kB
  • sloc: ansic: 1,377; xml: 240; makefile: 4
file content (70 lines) | stat: -rw-r--r-- 1,351 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
# slurp

Select a region in a Wayland compositor and print it to the standard output.
Works well with [grim].

Join the IRC channel: [#emersion on Libera Chat][IRC].

## Building

Install dependencies:

* meson
* wayland
* cairo
* libxkbcommon
* scdoc (optional: man pages)

Then run:

```sh
git clone https://github.com/emersion/slurp
cd slurp
meson setup build
ninja -C build
build/slurp
```

## Example usage

Select a region and print it to stdout:

```sh
slurp
```

Select a single point instead of a region:

```sh
slurp -p
```

Select an output and print its name:

```sh
slurp -o -f "%o"
```

Select a window under Sway, using `swaymsg` and `jq`:

```sh
swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp
```

Select a window without border under Sway, using `swaymsg` and `jq`:

```sh
swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | "\(.rect.x+.window_rect.x),\(.rect.y+.window_rect.y) \(.window_rect.width)x\(.window_rect.height)"' | slurp
```
## Contributing

Either [send GitHub pull requests][GitHub] or [send patches on the mailing list][ML].

## License

MIT

[grim]: https://gitlab.freedesktop.org/emersion/grim
[IRC]: https://web.libera.chat/gamja/#emersion
[GitHub]: https://github.com/emersion/slurp
[ML]: https://lists.sr.ht/%7Eemersion/public-inbox