1

How do I take a screenshot of restricted area with delay while sending the screenshot to clipboard? I would like to get the screenshot stored on the clipboard to be able to paste it afterwards.

gnome-screenshot -a -c works but gnome-screenshot -a -c --delay=2 does not work. It outputs the following: Conflicting options: --area and --delay should not be used at the same time.

In case it is not possible to do this with gnome-screenshot, what other alternatives are there out there?

Thanks

2 Answers2

0

First take a delayed full screen shot, then crop the image. I use GIMP to crop.

0

Taking a delayed screenshot in gnome-screenshot is only possible for a full screen capture.

IF there is a need to automate the process, the command line screengrabber scrot can do this. It only outputs to a file, but in good linux tradition, you can subsequently use another tool, xclip, to place it on the clipboard.

scrot -s -d 4 -o image.png
xclip -sel c -t image/png -i image.png 

This will allow you to make a selection (s) and after a delay of 4 seconds (-d 4) write out to image.png, overwriting -o the file if already present. The second command will link the file to the clipboard (-sel c) as a MIME type image/png.

This could be wrapped in a script:

#!/bin/bash
TEMP=mktemp
scrot -s -d $1 -o $TEMP
xclip -sel c -t image/png -i $TEMP 

mktemp creates a file with a random name in the /tmp folder. That folder is automatically cleaned on the next reboot. $1 is the first argument to provide to the script. So if you call the script for example ss, then the command ss 4 would introduce a delay of 4 seconds.

vanadium
  • 88,010