mirror of
https://github.com/olexsmir/dotfiles.git
synced 2026-01-15 08:41:34 +02:00
todo: update config; refactor actions
This commit is contained in:
parent
d5d6748eb3
commit
b68db8cdc1
5 changed files with 17 additions and 4 deletions
|
|
@ -21,6 +21,6 @@ for context in $CONTEXTS ; do
|
||||||
CONTEXT_LIST=$(_list "$TODO_FILE" "@$context\b" "$@" | sed 's/\ *@[a-zA-Z0-9._\-]*\ */ /g')
|
CONTEXT_LIST=$(_list "$TODO_FILE" "@$context\b" "$@" | sed 's/\ *@[a-zA-Z0-9._\-]*\ */ /g')
|
||||||
if [[ -n "${CONTEXT_LIST}" ]]; then
|
if [[ -n "${CONTEXT_LIST}" ]]; then
|
||||||
echo -e "--@${context}"
|
echo -e "--@${context}"
|
||||||
echo "${CONTEXT_LIST}" | eval $TODOTXT_FINAL_FILTER
|
echo "${CONTEXT_LIST}" | eval "$TODOTXT_FINAL_FILTER"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
||||||
3
config/todo/actions/e
Executable file
3
config/todo/actions/e
Executable file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
$EDITOR "$TODO_FILE"
|
||||||
3
config/todo/actions/next
Executable file
3
config/todo/actions/next
Executable file
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
exec "$TODO_SH" @ next
|
||||||
|
|
@ -8,8 +8,13 @@ if [[ $action == "usage" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
item=$1
|
item=$1
|
||||||
|
if [[ $item == "" ]]; then
|
||||||
|
TODOTXT_VERBOSE=0 $TODO_FULL_SH ls @url
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ! "$item" =~ ^[0-9]+$ ]]; then
|
if [[ ! "$item" =~ ^[0-9]+$ ]]; then
|
||||||
echo "$item: invalid item number"
|
echo "provided [task_number] is invalid: $item"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -21,7 +26,7 @@ if [[ -z "$URL" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! "#URL" =~ ^(?!https?:\/\/) ]]; then
|
if [[ ! "$URL" =~ ^(?!https?:\/\/) ]]; then
|
||||||
URL="https://$URL"
|
URL="https://$URL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,13 @@
|
||||||
# reference: /etc/todo/config
|
# reference: /etc/todo/config
|
||||||
|
|
||||||
export TODO_ACTIONS_DIR="$HOME/.dotfiles/config/todo/actions"
|
export TODO_ACTIONS_DIR="$HOME/.dotfiles/config/todo/actions"
|
||||||
|
export TODOTXT_DEFAULT_ACTION="next"
|
||||||
|
|
||||||
export TODO_DIR=~/org/
|
export TODO_DIR=~/org
|
||||||
export TODO_FILE="$TODO_DIR/todo.txt"
|
export TODO_FILE="$TODO_DIR/todo.txt"
|
||||||
export DONE_FILE="$TODO_DIR/done.txt"
|
export DONE_FILE="$TODO_DIR/done.txt"
|
||||||
export REPORT_FILE="$TODO_DIR/.report.txt"
|
export REPORT_FILE="$TODO_DIR/.report.txt"
|
||||||
|
export HABIT_FILE="$TODO_DIR/habits.txt"
|
||||||
|
|
||||||
export PRI_A=$YELLOW
|
export PRI_A=$YELLOW
|
||||||
export PRI_B=$PURPLE
|
export PRI_B=$PURPLE
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue