#!/bin/sh TODO_BASE='* TODO ' JRNL="$STITCH_DIRECTORY/$(date +'%y-%m-%d.%H:%M.%S').org" echo '* TODO ' > /tmp/capture kak /tmp/capture +1:8 -e "execute-keys i" if grep -q '^\* TODO\s*$' /tmp/capture then echo "Empty capture" else echo "Storing capture in $JRNL" cat /tmp/capture > $JRNL fi