Created
April 22, 2017 04:04
-
-
Save irskep/518bd0a00584edc0156268914523eb5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SCREEN_COUNT=0 | |
echo Capture started on `date` | |
echo Capture started on `date` >> log.txt | |
trap ctrl_c INT | |
function ctrl_c() { | |
echo Capture ended on `date` with $SCREEN_COUNT screens captured. | |
echo Capture ended on `date` with $SCREEN_COUNT screens captured. >> log.txt | |
exit | |
} | |
mkdir -p ~/timelapse | |
while true | |
do | |
sleep 30 | |
FILENAME=~/timelapse/screen.`date +%s`.jpg | |
FILENAME2=~/timelapse/camera.`date +%s`.jpg | |
echo Capturing to $FILENAME | |
screencapture -C -m -t jpg -x -f $FILENAME | |
imagesnap -w 1 $FILENAME2 | |
SCREEN_COUNT=$((SCREEN_COUNT+1)) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment