3 ms·
#!/bin/bash date="$(date +"%Y-%m-%d")" location="/home/developer/Dropbox/Personal/journal" filename="$date.md" output_path="$location/$filename
by noir_lord 8y ago
#!/bin/bash
date="$(date +"%Y-%m-%d")"
location="/home/developer/Dropbox/Personal/journal"
filename="$date.md"
output_path="$location/$filename"
echo $date
echo $location
echo $filename
echo $output_path
# No existing file so lets create it
if [ ! -f $output_path ]; then
echo "Creating Journal Entry"
touch $output_path
echo "Journal: $date" >> $output_path
printf "==================\n\n" >> $output_path
echo "$output_path:20000"
code -n -goto :2000 "$output_path:2000"
else
echo "Opening Existing Journal Entry"
echo "$output_path:20000"
code -n -goto :2000 "$output_path:2000"
fi
Bound to the star key (I have an Ergo 4000 that has a non-standard key right in the middle).
All it does is create a markdown file with the name of the current date and then open that in vscode and move the cursor to the end of the file unless the file already exists in which case it skips creating it and just opens it at the end.
vscode realtime markdown preview is lovely.
I'm aware the bash is horrible, it was a 30s hack to see if it'd work (about 6mths ago...).