mirror of
https://github.com/emersion/grim.git
synced 2026-10-22 19:11:38 +00:00
Grab images from a Wayland compositor
https://wayland.emersion.fr/grim
- C 88.4%
- Meson 8.6%
- Shell 3%
|
History
|
||
|---|---|---|
| include | ||
| protocol | ||
| .build.yml | ||
| .editorconfig | ||
| .gitignore | ||
| box.c | ||
| buffer.c | ||
| cairo_jpg.c | ||
| grim.1.scd | ||
| LICENSE | ||
| main.c | ||
| meson.build | ||
| meson_options.txt | ||
| output-layout.c | ||
| README.md | ||
| render.c | ||
grim
Grab images from a Wayland compositor. Works great with slurp and with sway >= 1.0.
Example usage
Screenshoot all outputs:
grim screenshot.png
Screenshoot a specific output:
grim -o DP-1 screenshot.png
Screenshoot a region:
grim -g "10,20 300x400" screenshot.png
Select a region and screenshoot it:
grim -g "$(slurp)" screenshot.png
Use a timestamped filename:
grim $(xdg-user-dir PICTURES)/$(date +'%Y-%m-%d-%H%M%S_grim.png')
Screenshoot and copy to clipboard:
grim - | wl-copy
Grab a screenshot from the focused monitor under Sway, using swaymsg and jq:
grim -o $(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | .name') screenshot.png
Installation
- Arch Linux:
pacman -S grim
Building
Install dependencies:
- meson
- wayland
- cairo
- libjpeg (optional)
Then run:
meson build
ninja -C build
build/grim
Contributing
Either send GitHub pull requests or send patches on the mailing list.
License
MIT