feat(user/malte): notetaking has closed: now

This commit is contained in:
Malte Tammena 2024-03-03 14:19:00 +01:00
parent 69e24bd148
commit 059e37ce19

View file

@ -91,7 +91,8 @@ bat "$XDG_DATA_HOME/life.md/$year.md" |
if [ -n "$ONLY_TODOS" ]; then
rg "^- \[.\] " |
sed 's/- \(\[.\]\) \(.*\) due:\([[:digit:]]\{4\}-[[:digit:]]\{2\}-[[:digit:]]\{2\}\)\(.*\)/- \1  \3 \2\4/' |
sort -r |
sort --reverse --stable |
sort --key 2.3,2.3r --stable |
{
if [ -n "$FILTER_TAG" ]; then
rg "#$FILTER_TAG\b"
@ -101,7 +102,7 @@ bat "$XDG_DATA_HOME/life.md/$year.md" |
} |
{
if [ -n "$ONLY_DONE" ]; then
rg "^- \[[xX]\] " | rg "done:$(date +%Y-%m-%d)"
rg "^- \[[xXcC]\] " | rg "(done|closed):$(date +%Y-%m-%d)"
else
cat
fi
@ -117,9 +118,10 @@ bat "$XDG_DATA_HOME/life.md/$year.md" |
sed "s/- \[ \]  \([[:digit:]]\{4\}-[[:digit:]]\{2\}-[[:digit:]]\{2\}\) /- [ ] $C_DEADLINE \1$C_RESET/" |
sed "s/- \[ \]/ $C_RED$C_RESET/g" |
sed "s/- \[[xX]\]/ $C_GREEN$C_RESET/g" |
sed "s/- \[[cC]\]/ $C_MAGENTA$C_RESET/g" |
sed "s/^\(\s*\)- /\1 $C_CYAN$C_RESET /g" |
sed "s/^\(\s*\)+ /\1 $C_CYAN$C_RESET /g" |
sed "s/^\([[:digit:]]\{2\}:[[:digit:]]\{2\}\)/$C_BOLD\1$C_RESET/g" |
sed "s/\(#\S\+\)/$C_CYAN\1$C_RESET/g" |
sed "s/\(\(due\|done\|prio\):\S\+\)/$C_MAGENTA\1$C_RESET/g" |
sed "s/\(\(due\|done\|prio\|closed\):\S\+\)/$C_MAGENTA\1$C_RESET/g" |
sed "s/^---\$/$C_MAGENTA$DASH$C_RESET/"