$linuxjunkies
>

grim(1)

Capture screenshots or record video on Wayland compositors.

UbuntuDebianFedoraArch

Synopsis

grim [OPTION]... [FILE]

Description

grim is a lightweight screenshot and screen recording tool for Wayland compositors. It captures the entire screen, a specific monitor, or a selected region, and outputs to a PNG image or video file. Unlike X11-based tools, grim is optimized for modern Wayland desktop environments like Sway and wlroots-based compositors.

By default, grim captures the entire visible screen and writes to stdout or a specified file. When combined with slurp, it can capture user-selected regions interactively.

Common options

FlagWhat it does
-o OUTPUTSpecify output file (PNG format); omit to write to stdout
-g GEOMETRYCapture a specific region using geometry string (WIDTHxHEIGHT+X+Y)
-t EXTENSIONSet output format (ppm, png); defaults to png
-s SCALEScale output; e.g., -s 0.5 for 50% scale
-cCapture cursor in screenshot
-l QUALITYSet PNG compression level (0-9); default is 6

Examples

Capture entire screen and save to screenshot.png

grim screenshot.png

Capture screen and copy to clipboard (stdout to wl-copy)

grim - | wl-copy

Screenshot with timestamp filename in Pictures directory

grim -o ~/Pictures/$(date +%s).png

Interactively select region with slurp and capture it

slurp | grim -g - selection.png

Capture specific region (1920×1080 at position 0,0)

grim -g '1920x1080+0+0' monitor1.png

Screenshot including the mouse cursor

grim -c screenshot_with_cursor.png

Related commands