helm/bin/ss

19 lines
436 B
Plaintext
Raw Normal View History

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