← 返回命令列表

Linux command

grim 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Screenshot

grim

Example

grim -o [output_name]

Example

grim -g "[x],[y] [width]x[height]"

Select

grim -g "$(slurp)"

Example

grim "[path/to/file.png]"

Example

grim - | wl-copy

说明

grim (grab image) is a Wayland-native screenshot tool. It captures images directly from the Wayland compositor, making it compatible with Sway, GNOME on Wayland, and other Wayland-based environments. For region selection, grim is commonly paired with slurp, which allows interactive selection of screen areas. Output to stdout (-) enables piping to clipboard managers like wl-copy.

参数

-g _GEOMETRY_
Capture specific region (x,y widthxheight format)
-o _OUTPUT_
Capture specific Wayland output (monitor)
-s _FACTOR_
Set scale factor
-t _TYPE_
Output format: png, jpeg, or ppm
-q _QUALITY_
JPEG quality (1-100)
-l _LEVEL_
PNG compression level (0-9)
-c
Include cursor in screenshot

FAQ

What is the grim command used for?

grim (grab image) is a Wayland-native screenshot tool. It captures images directly from the Wayland compositor, making it compatible with Sway, GNOME on Wayland, and other Wayland-based environments. For region selection, grim is commonly paired with slurp, which allows interactive selection of screen areas. Output to stdout (-) enables piping to clipboard managers like wl-copy.

How do I run a basic grim example?

Run `grim` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -g _GEOMETRY_ do in grim?

Capture specific region (x,y widthxheight format)