X-Git-Url: https://git.xandkar.net/?p=khome.git;a=blobdiff_plain;f=home%2Flib%2Flogin_functions.sh;h=193f4be374266469790c1ae46aee48bedf0e698b;hp=d1d458a284011845b283a55b3a9d1dafc1d36a05;hb=917869f84b6a138745f0a66d1499ea89e3810656;hpb=a2a21403525e59e47e404a0ae5cc929c9db6cfda diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index d1d458a..193f4be 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -425,20 +425,28 @@ gh_clone_repo() { git clone "$1" } +daily_todo_file_template() { +cat << EOF +=============================================================================== +$(date '+%F %A') +=============================================================================== + + +backlog +------------------------------------------------------------------------------- +EOF +} + todo() { local date - local timestamp - local bar - date=$(date +%F) - timestamp=$(date '+%F %A') - bar=$(for _ in {1..80}; do printf '='; done) + date="$(date +%F)" local -r dir="$DIR_TODO/daily" local -r file="$dir/$date.txt" mkdir -p "$dir" if [ ! -f "$file" ] then - printf '%s\n%s\n%s\n' "$bar" "$timestamp" "$bar" > "$file" + daily_todo_file_template > "$file" fi cd "$DIR_TODO" && "$EDITOR" "$file" }