todo: add todo.txt cli's config

This commit is contained in:
Oleksandr Smirnov 2025-06-21 23:59:10 +03:00
parent 551a3fcbfd
commit e5f2273627
No known key found for this signature in database
3 changed files with 38 additions and 0 deletions

16
config/todo/actions/@ Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
action=$1
shift
CONTEXTS=$(grep -o '[^ ]*@[^ ]\+' "$TODO_FILE" | grep '^@' | sort -u | sed 's/^@//g' )
for context in $CONTEXTS ; do
if [[ $context == "someday" ]]; then
continue
fi
CONTEXT_LIST=$(_list "$TODO_FILE" "@$context\b" "$@" | sed 's/\ *@[a-zA-Z0-9._\-]*\ */ /g')
if [[ -n "${CONTEXT_LIST}" ]]; then
echo -e "--@${context}"
echo "${CONTEXT_LIST}" | eval $TODOTXT_FINAL_FILTER
fi
done

20
config/todo/config Normal file
View file

@ -0,0 +1,20 @@
# vim: ft=bash
# reference: /etc/todo/config
export TODO_ACTIONS_DIR="$HOME/.dotfiles/config/todo/actions"
export TODO_DIR=~/org/
export TODO_FILE="$TODO_DIR/todo.txt"
export DONE_FILE="$TODO_DIR/done.txt"
export REPORT_FILE="$TODO_DIR/.report.txt"
export PRI_A=$YELLOW
export PRI_B=$PURPLE
export PRI_C=$LIGHT_BLUE
export COLOR_PROJECT=$GREEN
export COLOR_CONTEXT=$CYAN
export COLOR_DATE=$BLUE
export COLOR_NUMBER=$CYAN
export COLOR_META=$BLUE