emersion/slurp

Select a region in a Wayland compositor

C

1,291

134 commits

updated May 10, 2026

See the code

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.

Building

Install dependencies:

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

Then run:

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:

slurp

Select a single point instead of a region:

slurp -p

Select an output and print its name:

slurp -o -f "%o"

Select a window under Sway, using swaymsg and jq:

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:

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 or send patches on the mailing list.

License

MIT

cli
screenshot
wayland

emersion/slurp

Select a region in a Wayland compositor

C

1,291

134 commits

updated May 10, 2026

See the code

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.

Building

Install dependencies:

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

Then run:

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:

slurp

Select a single point instead of a region:

slurp -p

Select an output and print its name:

slurp -o -f "%o"

Select a window under Sway, using swaymsg and jq:

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:

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 or send patches on the mailing list.

License

MIT

cli
screenshot
wayland

Project health

Overall

4.0/10

Maintained

0/10

Code review

5/10
OpenSSF Scorecard

Significant stargazers

(top 24 of 30)

Simon Cruanes

467 followers · starred Jun 2020

Jake Bailey

1,255 followers · starred Feb 2019

DaniPopes

1,052 followers · starred Jul 2025

Michael Davis

685 followers · starred Sep 2020