emersion / grim

Grab images from a Wayland compositor

Home Page:https://wayland.emersion.fr/grim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot capture region into clipboard

luispabon opened this issue · comments

I have a setup with slurp that allows me to select a region then dump it to file. That works fine (there's a bug in slurp with multi outputs but that's a different story).

I'm having trouble however to combine slurp, grim with geometry and wl-copy (to capture to clipboard instead):

# This works fine, region is captured to file
 slurp | grim -g - $(xdg-user-dir PICTURES)/Screenshot-region-$(date +'%Y-%m-%d-%H%M%S.png')
# This captures all outputs
slurp | grim - -g | wl-copy

This upsets grim's argument parser:
slurp | grim -g - | wl-copy
~ slurp | grim -g -    
Usage: grim [options...] <output-file>

  -h              Show help message and quit.
  -s <factor>     Set the output image scale factor. Defaults to the
                  greatest output scale factor.
  -g <geometry>   Set the region to capture.
  -t png|jpeg     Set the output filetype. Defaults to png.
  -q <quality>    Set the JPEG filetype quality 0-100. Defaults to 80.
  -o <output>     Set the output name to capture.
  -c              Include cursors in the screenshot.

Ahh never mind, I was ofc doing it wrong. If someone reads this:

slurp | grim -g - - | wl-copy