helm/bin/ss

17 lines
464 B
Plaintext
Raw Normal View History

2014-04-19 19:43:20 -07:00
#!/bin/sh
# Start taking screenshots every N seconds, until this script is called again
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
echo "Timelapse, go!"
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