Clean up bin/ss

This commit is contained in:
Henrik Lissner 2014-04-19 22:55:40 -04:00
parent c2a19e7821
commit 36ba9f1877

20
bin/ss
View file

@ -1,18 +1,16 @@
#!/bin/sh #!/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 # Start taking screenshots every N seconds, until this script is called again
if [ ! -f ~/.ss ]; then if [ ! -f ~/.ss ]; then
echo "Timelapse, on in 3..." dir="$1"
touch ~/.ss if [ $# -eq 0 ]; then
sleep 3 [ ! -d ~/Desktop/ss ] && mkdir -p ~/Desktop/ss
i=1;while [ -f ~/.ss ];do screencapture -t jpg -x ~/Desktop/ss/$i.jpg; let i++;sleep 5; done & 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 &
else else
echo "Deactivating timelapse!" echo "Deactivating timelapse! Images in: $(cat ~/.ss)/"
rm ~/.ss rm ~/.ss
fi fi