Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2920  / 2 Years ago, sun, march 6, 2022, 12:49:54

I'm looking to accomlish exactly what Anwar Shah describes here Bash script to take screenshot and save the image - Ubuntu



with the added functionality of setting a time increment for the script to continue taking screen captures. For example, I'd like to be able to execute this script and have it take and export screen shots as jpegs every 5 seconds and continue until I kill the script.



Is there any simple solution to this?


More From » bash

 Answers
7

Yes:



#! /bin/bash
while sleep 5
do
shutter -f -o 'myshot-%T.jpg' -e
done


The sleep command can take various time durations as arguments: 5s (or just 5) for 5 seconds, 129m for 129 minutes, etc.

The shutter command supports JPEG output, and the %T tells Shutter to automatically replace that part with the time of the script.
(There's also %NN to tell Shutter to use a counter.)


[#23447] Sunday, March 6, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ranquctive

Total Points: 391
Total Questions: 103
Total Answers: 104

Location: South Sudan
Member since Thu, Feb 4, 2021
3 Years ago
ranquctive questions
;