0
Fork 0
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%
Find a file
History 2019-01-29 15:09:25 +01:00
include Add an option to disable JPEG support 2018-12-04 22:22:20 +01:00
protocol Add support for wlr-screencopy-unstable-v1 2018-07-13 19:25:56 +01:00
.build.yml fix: build.sr.ht archlinux image libjpeg-turbo package 2018-07-27 13:26:23 +02:00
.editorconfig Add .editorconfig 2018-05-13 21:38:37 +01:00
.gitignore First commit 2018-05-11 22:26:31 +01:00
box.c Only screenshot outputs we're interested in 2018-05-18 08:54:33 +01:00
buffer.c Use shm_open instead of XDG_RUNTIME_DIR 2018-11-14 18:38:33 +01:00
cairo_jpg.c Fix i686 build -Werror=incompatible-pointer-types complaint 2018-11-06 01:35:06 +01:00
grim.1.scd Add -c option to include cursor 2018-09-18 12:08:14 +02:00
LICENSE Initial commit 2018-05-04 13:59:53 +01:00
main.c Fix switch fallthrough breaking PNG files 2018-12-04 23:00:50 +01:00
meson.build Add an option to disable JPEG support 2018-12-04 22:22:20 +01:00
meson_options.txt Add missing meson_options.txt 2018-12-04 22:24:29 +01:00
output-layout.c Split rendering and output layout functions in separate files 2018-05-18 09:16:59 +01:00
README.md readme: add an example to copy to clipboard 2019-01-11 23:45:13 +01:00
render.c Add support for WL_SHM_FORMAT_ABGR8888 2019-01-29 15:09:25 +01:00

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