#!/bin/sh 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 $CAPTURE_FILE > $JRNL fi