scripts - Using scrot to take screenshots continuously - Ask Ubuntu
i'm new using scrot. know how take screenshots typing code scrot image.jpg
. want take continuous screenshots without use of typing code everytime on terminal.
is there way , if so, should in order so?
scrot doesn't allow taking multiple screenshots in batch. however, can use bash (or other languages') loop feature achieve this.
here how took 10 screenshots in files named screenshot_n.png
(where n
sequence number`) in delay of 1 seconds each.
for in $(seq 1 10); sleep 1; import -window root screenshot_$i.png; done
i used import
tool here. came imagemagick. can use scrot in place of import
. change sleep 1
line match desired delay. check import
man page more details.
you can use in bash-function this
function shot() { in $(seq 1 $1); sleep 1; import -window root screenshot_$i.png; done }
save in .bashrc
file. can use in bash syntax shot n
, n
number of screenshot need take`
here command uses scrot
. used scrot's built-in delay feature instead of bash sleep
command here. check scrot man page more details. can use in bash-function before.
for in $(seq 1 10); scrot -d 1 screenshot_$i.png; done
you can check following question suggestions other screenshot taking tools command line
Comments
Post a Comment