generation 546 25.11.20250714.62e0f05

This commit is contained in:
2025-12-03 22:50:31 -05:00
parent 35f493aa9c
commit c0caaeb234
5 changed files with 95 additions and 0 deletions

View File

@@ -186,6 +186,9 @@ super + bracket{left,right}
super + {o}
sh nf daily
super + {i}
sh nf idk
# open my notes without goyo and with nvimteee
super + {shift} + {o}
sh nf daily

59
home/scripts/daily.sh Normal file
View File

@@ -0,0 +1,59 @@
# get today's date
curr=$(date +%y-%m-%d)
curr_bigyear=$(date +%Y-%m-%d)
# echo "$curr"
curr_pretty=$(date "+%A, %B %d %G")
curr_onenumber=$(date +%Y%m%d)
echo "Today: $curr_pretty"
# get written journal lines
journal_len=$(wc /home/synchronous/journal/daily.md | awk '{print $1}')
journal_date_area=$(rg 25-12-03 /home/synchronous/journal/daily.md -n -o | sed 's/:/ /' | awk '{print $1}')
journal=""
if [[ $journal_date_area == "" ]]; then
journal="No writing in the journal yet today.."
else
jd_diff=$(echo "$journal_len - $journal_date_area" | bc)
journal="You've written $jd_diff journal line(s)"
fi
# get todos for today
todo_len=$(awk '!NF { print NR; exit }' /home/synchronous/journal/todo.md)
todo_len_1=$(echo "$todo_len" - 1 | bc)
todo_len_2=$(echo "$todo_len" - 2 | bc)
todos=$(head /home/synchronous/journal/todo.md -n "$todo_len_1" | tail -n "$todo_len_2")
# choose idk based on psuedorandom seeded with date
idk_len=$(wc -l /home/synchronous/journal/rest/idk.md | awk '{print $1'})
idk_date=$(date +%Y%m%d)
idk_pseudo=$(python3 -c "import math; import random; random.seed($idk_date); print( math.floor(random.random() * 10000) % $idk_len)")
idk=$(sed -n '7 p' /home/synchronous/journal/rest/idk.md | cut -c3-)
# check if there exists a .daily in home for this day
daily_date=$(stat -c "%y" /home/synchronous/.daily | awk '{print $1}')
if [[ $daily_date != $curr_bigyear ]]; then
rm /home/synchronous/.daily
touch /home/synchronous/.daily
# set idk
echo "- idk: $idk" >> /home/synchronous/.daily
else
idk_prev=$(rg idk /home/synchronous/.daily | cut -c8-) # take existing idk
if [[ $idk_prev != $idk ]]; then
idk="$idk_prev [done!]"
fi
fi
echo
# echo $idk
echo "Lore for today:"
echo "- idk: $idk"
echo "- $journal"
echo
# TODOS SETUP
echo "Todos for today ($todo_len_2 items):"
echo "$todos"

25
home/scripts/idk.sh Normal file
View File

@@ -0,0 +1,25 @@
add_idk() {
if [[ "$1" == "" ]]; then
echo "Empty entry"
exit 0
fi
fq=$(rg "$1" /home/synchronous/journal/rest/idk.md 2> /dev/null)
if [[ "$fq" != "" ]]; then
echo "Entry already present"
exit 0
fi
echo "- $1" >> /home/synchronous/journal/rest/idk.md
echo "Added entry: '$1'"
idk_len=$(wc -l /home/synchronous/journal/rest/idk.md | awk '{print $1}')
echo "You do not know $idk_len things!"
}
run_command() {
case $1 in
"add") add_idk "$2" ;;
"del") remove_idk "$2" ;;
*)
esac
}
run_command "$1" "$2"

View File

@@ -44,6 +44,13 @@ open_daily() {
-c "lua vim.g.goyo_if = 1" &!
}
open_idk() {
alacritty -t "idk.md" -e nvim "$main/rest/idk.md" \
-c "Goyo | set wrap | set path+=$main_dir" \
-c "execute 'normal G'" \
-c "lua vim.g.goyo_if = 1" &!
}
open_todo() {
alacritty -t "todo.md" -e nvim "$main/todo.md" \
-c "execute 'lua vim.g.goyo_if = 1' | set wrap | Goyo | set path+=$main_dir" &!
@@ -157,6 +164,7 @@ run_command() {
"search") search ;;
"daily") open_daily ;;
"todo") open_todo ;;
"idk") open_idk ;;
"find") notes_find ;;
"tags") search_by_tags ;;
"title") search_by_title ;;