xnuk / slurp

Select a region in a Wayland compositor

Home Page:https://wayland.emersion.fr/slurp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

slurp

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

It currently works on Sway 1.0.

Join the IRC channel: ##emersion on Freenode.

Building

Install dependencies:

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

Then run:

meson 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 under Sway, using swaymsg and jq:

swaymsg -t get_outputs | jq -r '.[] | select(.active) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp

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

About

Select a region in a Wayland compositor

https://wayland.emersion.fr/slurp

License:MIT License


Languages

Language:C 89.0%Language:Meson 6.9%Language:SuperCollider 4.1%