summaryrefslogtreecommitdiff
path: root/local/bin/capture
blob: cac405a00ae97f0341e5bffa4f08d0f8e38881db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/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 
then 
   echo "Empty capture; ignoring"
else 
   echo "Storing capture in $JRNL"
   cat /tmp/capture > $JRNL
fi