Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emersion/slurp
Select a region in a Wayland compositor
https://github.com/emersion/slurp
cli screenshot wayland
Last synced: 3 months ago
JSON representation
Select a region in a Wayland compositor
- Host: GitHub
- URL: https://github.com/emersion/slurp
- Owner: emersion
- License: mit
- Created: 2018-05-20T16:27:09.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-26T05:40:23.000Z (4 months ago)
- Last Synced: 2024-02-26T06:39:00.031Z (4 months ago)
- Topics: cli, screenshot, wayland
- Language: C
- Homepage: https://wayland.emersion.fr/slurp
- Size: 127 KB
- Stars: 828
- Watchers: 10
- Forks: 52
- Open Issues: 38
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-wayland - Slurp - Select a region in a Wayland compositor (Screenshots)
- awesome-hyprland - slurp
- awesome-starred - slurp - Select a region in a Wayland compositor (C)
- awesome - slurp - Select a region in a Wayland compositor (C)
- awesome-stars - emersion/slurp - Select a region in a Wayland compositor (C)
README
# 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
```
## ContributingEither [send GitHub pull requests][GitHub] or [send patches on the mailing list][ML].
## License
MIT
[grim]: https://sr.ht/~emersion/grim/
[IRC]: https://web.libera.chat/gamja/#emersion
[GitHub]: https://github.com/emersion/slurp
[ML]: https://lists.sr.ht/%7Eemersion/public-inbox