init note script

This commit is contained in:
2026-03-10 00:00:04 -06:00
parent 19d6c7e071
commit a3345cc706

17
note.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
readonly NOTES_INBOX="/home/jonathan/notes/+"
readonly TEMPLATE="/home/jonathan/notes/Atlas/Utilities/Templates/new_note_template.md"
if [ -z "$1" ]; then
FILENAME="$(date +%Y%m%d-%H%M%S).md"
else
FILENAME="${1}.md"
fi
cp -pr ${TEMPLATE} ${NOTES_INBOX}/${FILENAME}
chmod 600 ${NOTES_INBOX}/${FILENAME}
DATE=$(date +%Y-%m-%d)
sed -i "s/created:.*/created: ${DATE}/g" ${NOTES_INBOX}/${FILENAME}
cd ${NOTES_INBOX}
nvim -c "LivePreview start" ${FILENAME}