MCPcopy Index your code
hub / github.com/emersion/slurp

github.com/emersion/slurp @v1.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.5.0 ↗ · + Follow
146 symbols 302 edges 6 files 1 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
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

Contributing

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

License

MIT

Core symbols most depended-on inside this repo

seat_set_outputs_dirty
called by 6
main.c
box_intersect
called by 4
main.c
move_seat
called by 4
main.c
handle_active_selection_motion
called by 4
main.c
parse_color
called by 4
main.c
finish_buffer
called by 3
pool-buffer.c
set_source_u32
called by 3
render.c
draw_rect
called by 3
render.c

Shape

Class 82
Function 62
Enum 2

Languages

C69%
C++31%

Modules by API surface

main.c77 symbols
include/slurp.h41 symbols
pool-buffer.c14 symbols
render.c10 symbols
include/pool-buffer.h3 symbols
include/render.h1 symbols

For agents

$ claude mcp add slurp \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact