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

Ability to output to file and stdout simultaneously.

cedws opened this issue · comments

It would be nice if there were a parameter to output to a file and stdout simulatenously. An example use case is:

grim -g "$(slurp)" ~/Pictures/$(date +'%H%M%S-%Y-%m-%d.png') | wl-copy

Of course, you could also do something like the following:

grim -g "$(slurp)" ~/Pictures/$(date +'%H%M%S-%Y-%m-%d.png') && wl-copy < ~/Pictures/$(date +'%H%M%S-%Y-%m-%d.png')

but that's pretty long and unwieldy, especially when in a Sway config file.

I am happy to implement this if you are open to the idea.

Is this good enough?

grim -g "$(slurp)" - | tee ~/Pictures/$(date +'%H%M%S-%Y-%m-%d.png') | wl-copy

Works excellently! Let's add this to the README.