summaryrefslogtreecommitdiff
path: root/home/dots/.local/bin/capture
blob: c4cd8448d93a50052757fff7cece452cb312b4e2 (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
$EDITOR $CAPTURE_FILE +1
if grep -q '^\*\s*$' $CAPTURE_FILE
then 
   echo "Empty capture; ignoring"
else 
   echo "Storing capture in $JRNL"
   cat $CAPTURE_FILE > $JRNL
fi