From 917869f84b6a138745f0a66d1499ea89e3810656 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Fri, 29 Jul 2022 14:53:05 -0400 Subject: [PATCH] Make daily todo file template --- home/lib/login_functions.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) 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" } -- 2.20.1