From 36ba9f18775074b9aa4e37150e9bfa2b5d7c0d4d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 19 Apr 2014 22:55:40 -0400 Subject: [PATCH] Clean up bin/ss --- bin/ss | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/bin/ss b/bin/ss index 6c3713ac..5aae3d38 100755 --- a/bin/ss +++ b/bin/ss @@ -1,18 +1,16 @@ #!/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 & + 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 & else - echo "Deactivating timelapse!" + echo "Deactivating timelapse! Images in: $(cat ~/.ss)/" rm ~/.ss fi