toyotacorolla

vroom
git clone https://git.davidvoz.net/toyotacorolla.git
index
logs
tree

note
1#!/bin/sh
2# this is a modified version of swindlesmccoop's note program
3#
4# $ note [enter message here]
5# this will have the message automatically added
6#
7# $ note -p
8# will print out the notes
9#
10# $ note
11# takes you to a nvim edit to add your note
12
13NOTES_FILE=$HOME/misc/notes
14
15if [ "$*" = "-p" ]; then
16 cat "$NOTES_FILE"
17 exit 0
18fi
19
20if [ "$#" -ge 1 ]; then
21 echo "[$(date)]" >> "$NOTES_FILE"
22 echo "$*" >> "$NOTES_FILE"
23 echo "" >> "$NOTES_FILE"
24 exit 0
25fi
26
27nvim +startinsert /tmp/note_temp
28
29if [ -s /tmp/note_temp ]; then
30 echo "[$(date)]" >> "$NOTES_FILE"
31 cat /tmp/note_temp >> "$NOTES_FILE"
32 echo "" >> "$NOTES_FILE"
33 rm /tmp/note_temp
34fi