summaryrefslogtreecommitdiff
path: root/local/bin/capture
blob: f8824cd1d57fd536026e8b59e50ef37225d8659d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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