owenrusk.dev

dotfiles

shell, editor, ssh.

git clone https://owenrusk.dev/dotfiles.git

dotfiles / bin/note -rwxr-xr-x · 284 bytes

 1 #!/bin/sh
 2 # note some words: they go on the end of this month's file. no words: open it.
 3 dir=${NOTES:-$HOME/notes}
 4 file="$dir/$(date +%Y-%m).md"
 5 mkdir -p "$dir"
 6 
 7 if [ $# -eq 0 ]; then
 8     exec "${EDITOR:-nvim}" + "$file"
 9 fi
10 printf -- '- %s %s\n' "$(date '+%d %H:%M')" "$*" >> "$file"