Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scrop

scrop is a precise Wayland region selector for screen recorders and screenshot scripts. Unlike one-drag selectors, it keeps the selected rectangle open so it can be moved, resized, and confirmed explicitly.

It prints a slurp-compatible geometry string to stdout, so it can be used as a drop-in selector for tools such as wl-screenrec.

Install

If you're on Arch, you can install the AUR binary package:

yay -S scrop-bin

To build from source, install these development packages with your distro package manager:

  • cairo
  • pango

Then install scrop from a local checkout:

cargo install --path .

Prebuilt release tarballs are published on GitHub Releases.

Usage

Start the selector:

scrop

scrop select starts the same interactive selector explicitly:

scrop select

After confirmation, scrop prints geometry to stdout:

120,80 1280x720

Use it with wl-screenrec:

wl-screenrec -g "$(scrop)"

Open with an aspect ratio toolbar to pick from presets (free, 1:1, 3:4, 9:16, 9:21):

scrop --aspect-ratio

Start with a specific preset selected:

scrop --aspect-ratio=4:3

Lock to a fixed aspect ratio:

scrop --lock-aspect-ratio=16:9

Controls

Input Action
Drag outside the selection Create a new selection
Drag inside the selection Move the selection
Drag a resize handle Resize the selection
Click Select or press Enter Confirm and print geometry
Click x or press Escape Cancel
Arrow keys Move the selection by 1 pixel
Shift + arrow keys Move the selection by 10 pixels
Aspect ratio toolbar Toggle between free, 1:1, 3:4, 9:16, 9:21 (or custom)

CLI

Usage: scrop [OPTIONS] [COMMAND]

Commands:
  select  Interactive region selection
  help    Print this message or the help of the given subcommand(s)

Options:
  -v, --version                  Print version
      --verbose...               Increase diagnostic output; may be repeated
      --aspect-ratio [<W:H>]     Enable aspect ratio controls with an optional W:H preset
      --lock-aspect-ratio <W:H>  Lock selection to a fixed W:H aspect ratio
  -h, --help                     Print help

--verbose is repeatable. Diagnostics go to stderr so stdout remains suitable for command substitution.

Exit Codes

Code Meaning
0 A region was selected and printed
1 Selection was cancelled
2 Initialization or runtime error

Requirements

scrop is Wayland-only. The compositor must support:

  • wlr-layer-shell-unstable-v1
  • zxdg-output-unstable-v1

cursor-shape-v1 is recommended for context-aware crosshair, move, and resize cursors.

Selections are constrained to one output because recorders such as wl-screenrec expect a region fully contained within a single output.

Development

cargo fmt --check
cargo test
cargo clippy --all-targets -- -D warnings
cargo build

Releases

GitHub Actions builds an x86_64 Linux binary and publishes a tarball plus checksum when a version tag is pushed. The tag must match the version in Cargo.toml.

git tag vX.Y.Z
git push origin vX.Y.Z

The release tarball can be used directly or repackaged for your distro.

About

`scrop` is interactive Wayland region selector with adjustable handles

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages