helm/bin/ss

19 lines
467 B
Plaintext
Raw Normal View History

2014-04-19 19:43:20 -07:00
#!/bin/sh
2014-11-18 22:21:21 -08:00
# Start taking screenshots every N seconds, until this script is
# called again.
2014-04-19 19:43:20 -07:00
if [ ! -f ~/.ss ]; then
2014-04-19 19:55:40 -07:00
dir="$1"
if [ $# -eq 0 ]; then
[ ! -d ~/Desktop/ss ] && mkdir -p ~/Desktop/ss
dir=~/Desktop/ss
fi
echo "$dir" > ~/.ss
2014-11-18 22:21:21 -08:00
echo "Timelapse, go!"
2014-04-19 19:55:40 -07:00
i=1;while [ -f ~/.ss ];do screencapture -t jpg -x "$dir/$i.jpg"; let i++;sleep 5; done &
2014-04-19 19:43:20 -07:00
else
2014-04-19 19:55:40 -07:00
echo "Deactivating timelapse! Images in: $(cat ~/.ss)/"
2014-04-19 19:43:20 -07:00
rm ~/.ss
fi