Skip to content

Instantly share code, notes, and snippets.

@jamak
Created July 7, 2012 21:46
Show Gist options
  • Save jamak/3068171 to your computer and use it in GitHub Desktop.
Save jamak/3068171 to your computer and use it in GitHub Desktop.
#! /bin/zsh
TIME=$1
FNAME=$2
#if [[ $# != 3]] then;
# echo "USAGE: $0 time_interval filename"
# exit 2
#fi
if [[ -f $FNAME ]]; then;
echo "filename taken!"
exit 2
fi
a=0
while true
do
sleep $TIME
screencapture ${(l:6::0:)a}.png
((a++))
trap "ffmpeg -f image2 -qscale 2 -i %06d.png -same_quant $FNAME;break" 2
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment