Created
September 28, 2022 13:20
-
-
Save stormouse/1c3eaa0286f9e3834d66871e42b7de6b to your computer and use it in GitHub Desktop.
note taking script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tn { | |
local EDITOR=${TAKE_NOTE_EDITOR:-"vim"} | |
local DIRECTORY=${TAKE_NOTE_DIRECTORY:-"${HOME}/.notes"} | |
local ACTIVE_NOTE=${TAKE_NOTE_ACTIVE_NOTE:-"note-$(date +%Y-%m-%d)"} | |
if [ "${#}" == "0" ]; then | |
${EDITOR} ${DIRECTORY}/${ACTIVE_NOTE} | |
else | |
printf "[%s] %s\n" "$(date +%H:%M:%S)" "${*}" | tee -a ${DIRECTORY}/${ACTIVE_NOTE} | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment