diff --git a/ayo.sh b/ayo.sh index 8a49a2c..cf28829 100755 --- a/ayo.sh +++ b/ayo.sh @@ -23,6 +23,9 @@ case $1 in . ${HOME}/Projects/scripts/tasks.sh done $2 $3 $4 $5 $6 $7 $8 $9 ;; + ns) # Notes sync + . ${HOME}/Projects/scripts/notes.sh sync + ;; nl) # Notes list . ${HOME}/Projects/scripts/notes.sh list $2 $3 $4 $5 $6 $7 $8 $9 ;; diff --git a/journal.sh b/journal.sh index 1c916ae..de4716a 100755 --- a/journal.sh +++ b/journal.sh @@ -40,8 +40,7 @@ if [ "$1" = "append" ]; then { read -p "Add thought: " thought time=$(date +'%r') - echo $'\n'\> \[$time\]$'\n'\> $thought >> "$full_path" - + echo $'\n'\> $thought \[$time\] >> "$full_path" } || { echo ">>> Append failed" } diff --git a/notes.sh b/notes.sh index a3a2db4..7b620ba 100755 --- a/notes.sh +++ b/notes.sh @@ -55,12 +55,16 @@ function createNote() { } +## SYNC notes in directory +if [ "$1" = "sync" ] || [ "$1" = "s" ]; then + notesSync + ## LIST notes in directory -if [ "$1" = "list" ] || [ "$1" = "l" ]; then +elif [ "$1" = "list" ] || [ "$1" = "l" ]; then echo "ACTIVE NOTES: " + notesSync files=( $notes_dir/*.md ) index=0 - notesSync for file in "${files[@]##*/}"; do ((index++)) echo "$index) $file" @@ -68,17 +72,16 @@ if [ "$1" = "list" ] || [ "$1" = "l" ]; then ## OPEN a note from a list elif [ "$1" = "open" ] || [ "$1" = "o" ]; then + notesSync files=( $notes_dir/*.md ) if ! [ "$2" = "" ]; then index=($2-1) open_file=${files[$index]} editFile "$open_file" - notesSync else PS3="Open file #: " echo "Please select a file to OPEN." - notesSync select file in "${files[@]##*/}"; do { echo "Opening $file" @@ -94,8 +97,8 @@ elif [ "$1" = "open" ] || [ "$1" = "o" ]; then ## REMOVE a note from a list elif [ "$1" = "remove" ] || [ "$1" = "rm" ]; then - files=( $notes_dir/*.md ) notesSync + files=( $notes_dir/*.md ) if ! [ "$2" = "" ]; then index=($2-1) @@ -122,8 +125,8 @@ elif [ "$1" = "remove" ] || [ "$1" = "rm" ]; then ## ARCHIVE a note from a list elif [ "$1" = "archive" ] || [ "$1" = "a" ]; then - files=( $notes_dir/*.md ) notesSync + files=( $notes_dir/*.md ) if ! [ "$2" = "" ]; then index=($2-1) diff --git a/tasks.sh b/tasks.sh index 055a3eb..bf8c2be 100755 --- a/tasks.sh +++ b/tasks.sh @@ -59,9 +59,9 @@ function createtask() { ## LIST tasks in directory if [ "$1" = "list" ] || [ "$1" = "l" ]; then echo "ACTIVE TASKS: " + notesSync files=( $tasks_dir/*.md ) index=0 - notesSync for file in "${files[@]##*/}"; do ((index++)) echo "$index) $file" @@ -69,17 +69,16 @@ if [ "$1" = "list" ] || [ "$1" = "l" ]; then ## OPEN a task from a list elif [ "$1" = "open" ] || [ "$1" = "o" ]; then + notesSync files=( $tasks_dir/*.md ) if ! [ "$2" = "" ]; then index=($2-1) open_file=${files[$index]} editFile "$open_file" - notesSync else PS3="Open file #: " echo "Please select a file to OPEN." - notesSync select file in "${files[@]##*/}"; do { echo "Opening $file" @@ -95,12 +94,14 @@ elif [ "$1" = "open" ] || [ "$1" = "o" ]; then ## MARK AS DONE a task from a list elif [ "$1" = "done" ] || [ "$1" = "d" ]; then - files=( $tasks_dir/*.md ) notesSync + files=( $tasks_dir/*.md ) if ! [ "$2" = "" ]; then index=($2-1) done_file=${files[$index]} + read -p "Resolution: " resolution + echo $resolution >> "$done_file" mv "$done_file" "${tasks_dir}/done/" notesSync else @@ -121,8 +122,8 @@ elif [ "$1" = "done" ] || [ "$1" = "d" ]; then ## REMOVE a task from a list elif [ "$1" = "remove" ] || [ "$1" = "rm" ]; then - files=( $tasks_dir/*.md ) notesSync + files=( $tasks_dir/*.md ) if ! [ "$2" = "" ]; then index=($2-1)