LinuxCommandLibrary

slop

Select a screen region and output coordinates

TLDR

Wait for the user to make a selection and output its geometry to stdout

$ slop
copy

Double click, rather than click and drag, to draw a selection
$ slop [[-D|--nodrag]]
copy

Highlight the selection rather than outlining it
$ slop [[-l|--highlight]]
copy

Specify the output format
$ slop [[-f|--format]] [format_string]
copy

Specify the selection rectangle's color
$ slop [[-c|--color]] [red],[green],[blue],[alpha]
copy

SYNOPSIS

slop [options]

PARAMETERS

-d
    Specify a default geometry if no interactive selection is desired.

-f
    Read command-line arguments from a file.

-g
    Specify an initial geometry for the selection window.

-h
    Display help message.

-n
    Do not highlight the selected region.

-v
    Display version information.

-V
    Verbose operation.

-x
    Select using stdin: x y w h

-z
    Use a translucent border.

-b
    Border color, as a hex value (e.g., "0xff0000ff" for opaque red).

-e
    Print geometry to stderr.

-l
    Highlight color.

-m
    Modifier to use to move with keyboard. Possible values: Shift, Control, Mod1, Mod2, Mod3, Mod4, Mod5.

-s
    Save snapshot to file.

-u
    Print geometry as URIs.

-w
    Border width in pixels.

DESCRIPTION

slop (Select Operation) is a utility that allows you to interactively select a rectangular region of the screen. It's primarily designed for use in scripts where you need to capture a specific area, pipe that area to other programs like image editing or OCR software, or use the coordinates for other operations.

The user interface consists of a selectable rectangle drawn on the screen. The command outputs the geometry of the selected rectangle (x, y, width, height) to standard output, making it easy to integrate with other tools. slop provides several options for customizing the appearance and behavior of the selection rectangle, including border color, line width, and transparency. It can also be configured to highlight the selected region.

slop is very useful for scripting screen capture tools, for example, you can use it together with ImageMagick's import tool to save a section of the screen. The usage is simple and intuitive, perfect for the command line user.

OUTPUT FORMAT

The output format of slop is 'x y width height'. Where x and y are the coordinates of the top-left corner of the selected rectangle, width is the width of the rectangle, and height is the height of the rectangle.

DEPENDENCIES

slop requires X11 libraries for operation. You may need to install packages such as libX11-dev or xorg-dev to compile or run it, depending on your distribution.

SEE ALSO

import(1), xclip(1)

Copied to clipboard