diff options
Diffstat (limited to '')
-rwxr-xr-x | local/bin/capture | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/local/bin/capture b/local/bin/capture index cac405a..f8824cd 100755 --- a/local/bin/capture +++ b/local/bin/capture @@ -1,13 +1,16 @@ #!/bin/sh -JRNL="$STITCH_DIRECTORY/$(date +'%y-%m-%d.%H:%M.%S').org" -echo '* ' > /tmp/capture -kak /tmp/capture +1:3 -e "execute-keys i" -if grep -q '^\*\s*$' /tmp/capture +DATE=$(date +'%y-%m-%d.%H:%M.%S') +CAPTURE_FILE="/tmp/capture-$DATE" +echo $DATE +JRNL="$STITCH_DIRECTORY/$DATE.org" +echo '* ' > $CAPTURE_FILE +kak $CAPTURE_FILE +1:3 -e "execute-keys i" +if grep -q '^\*\s*$' $CAPTURE_FILE then echo "Empty capture; ignoring" else echo "Storing capture in $JRNL" - cat /tmp/capture > $JRNL + cat $CAPTURE_FILE > $JRNL fi |