From c0caaeb2345a08baa96eacf61bcd303ddec12456 Mon Sep 17 00:00:00 2001 From: Jake Ginesin Date: Wed, 3 Dec 2025 22:50:31 -0500 Subject: [PATCH] generation 546 25.11.20250714.62e0f05 --- home/programs/sxhkd/sxhkdrc | 3 + home/scripts/daily.sh | 59 +++++++++++++++++++ home/scripts/idk.sh | 25 ++++++++ home/scripts/journal/nf.sh | 8 +++ .../security/{sg.sh => semgrep-auto.sh} | 0 5 files changed, 95 insertions(+) create mode 100644 home/scripts/daily.sh create mode 100644 home/scripts/idk.sh rename home/scripts/security/{sg.sh => semgrep-auto.sh} (100%) diff --git a/home/programs/sxhkd/sxhkdrc b/home/programs/sxhkd/sxhkdrc index 8c1a5d9..deae6d7 100644 --- a/home/programs/sxhkd/sxhkdrc +++ b/home/programs/sxhkd/sxhkdrc @@ -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 diff --git a/home/scripts/daily.sh b/home/scripts/daily.sh new file mode 100644 index 0000000..288d341 --- /dev/null +++ b/home/scripts/daily.sh @@ -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" diff --git a/home/scripts/idk.sh b/home/scripts/idk.sh new file mode 100644 index 0000000..640dc16 --- /dev/null +++ b/home/scripts/idk.sh @@ -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" diff --git a/home/scripts/journal/nf.sh b/home/scripts/journal/nf.sh index 924b9da..f4477b0 100644 --- a/home/scripts/journal/nf.sh +++ b/home/scripts/journal/nf.sh @@ -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 ;; diff --git a/home/scripts/security/sg.sh b/home/scripts/security/semgrep-auto.sh similarity index 100% rename from home/scripts/security/sg.sh rename to home/scripts/security/semgrep-auto.sh