AutoYADM commit: 2025-04-23 01:15:05
This commit is contained in:
parent
589221ef09
commit
78a71ecbb7
1 changed files with 47 additions and 31 deletions
|
@ -36,42 +36,58 @@ function jrnl --description 'Lightweight journaling tool'
|
|||
mkdir -p $jdir
|
||||
end
|
||||
|
||||
set template $jdir/.template.md
|
||||
|
||||
if not test -f $template
|
||||
set -l prompt "There is no template, create one now? (y/n): "
|
||||
while read --nchars 1 -l response --prompt-str="$prompt" or return 1
|
||||
printf "\033[1A\033[2K"
|
||||
switch $response
|
||||
case y Y
|
||||
begin
|
||||
echo "# $(date +'%A, %b %d, %Y')"\n
|
||||
|
||||
echo "## Gratitude"\n
|
||||
|
||||
echo "I'm grateful for ..."\n
|
||||
|
||||
echo "## + Wins"\n
|
||||
|
||||
echo "- small_victories"\n
|
||||
|
||||
echo "## - Challenges"\n
|
||||
|
||||
echo "- hard_things"\n
|
||||
|
||||
echo "## Reflection"\n
|
||||
|
||||
echo "_One sentence to reflect on today:_"\n
|
||||
|
||||
echo "- reflection"\n
|
||||
|
||||
echo "## Learned"\n
|
||||
|
||||
echo "- fact_insight_or_skill"\n
|
||||
|
||||
echo "## Tomorrow"\n
|
||||
|
||||
echo "- prep"\n
|
||||
end >$template
|
||||
eval $EDITOR $template
|
||||
set -f new_template
|
||||
case n N
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# get the date
|
||||
set today (date +'%Y-%m-%d')
|
||||
set entry "$jdir/$today.md"
|
||||
# check if journal entry exists
|
||||
if not test -f $entry
|
||||
set -l template \
|
||||
"# $(date +'%A, %b %d, %Y')
|
||||
|
||||
## Gratitude
|
||||
|
||||
I'm grateful for ...
|
||||
|
||||
## + Wins
|
||||
|
||||
- small_victories
|
||||
|
||||
## - Challenges
|
||||
|
||||
- hard_things
|
||||
|
||||
## Reflection
|
||||
|
||||
_One sentence to reflect on today:_
|
||||
|
||||
- reflection
|
||||
|
||||
## Learned
|
||||
|
||||
- fact_insight_or_skill
|
||||
|
||||
## Tomorrow
|
||||
|
||||
- prep
|
||||
|
||||
"
|
||||
echo $template >$entry
|
||||
cat $template >$entry
|
||||
set -l prompt "Created $entry, open in $EDITOR? (y/n)"
|
||||
while read --nchars 1 -l response --prompt-str="$prompt" or return 1
|
||||
printf "\033[1A\033[2K"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue