If I would like to select a window for scrot
this could be easily done with:
scrot -s name.jpg
But if I want to ask scrot
to keep taking screenshots from a selected window, then I don't know how to do this. The following is what I tried:
#!/bin/sh
while true
do
scrot -s "$(date)".jpg
sleep 5
done
The problem with the above is: after every 5 seconds I have to tell scrot
which window by clicking it.
If only I could pass the window by clicking it only once the first time it would be perfect.
If not, could I tell scrot
which window by telling it the window name?
Edit: I also want it to work even when the window is minimised. How to do this?
From
man scrot
:So you could just change your script like so:
However this will start taking screenshots as soon as the script is started, which is probably undesired; this would be a bit more user-friendly, as it will start taking screenshots only after the user has manually selected a window: