@newmanth_twitter Yes, this is covered. todo.sh -v -v help
reveals this environment variable:
TODOTXT_SOURCEVAR=\$DONE_FILE use another source for listcon, listproj
To include both current and done sources, define a Bash array:
TODOTXT_SOURCEVAR='("$TODO_FILE" "$DONE_FILE")' todo.sh listproj
You can also put the export TODOTXT_SOURCEVAR=...
into your .todo.cfg
to make it permanent.
Hello @silasdb! The _list
function is exported and can be used by add-ons to output tasks with the common numbering and formatting. For task ordering, there's the TODOTXT_SORT_COMMAND
hook. So, a minimal add-on could set its own sorting command (sort
, awk
, or similar) and then invoke the built-in listing of the todo.txt file:
TODOTXT_SORT_COMMAND='awk ...'
_list "$TODO_FILE" "$@"
Here's a simple but complete example from my own add-ons.
_list
renders the task numbers based on the passed lines, that does not work; the numbering would be off. However, because completely empty lines are suppressed, blanking out those lines that you don't want (but keeping the newline to maintain the right numbering) will do what you want.
due
add-on has (more or less) the same functionality as the original Python one, I would keep the name; in the end, what's most important is how you best remember the add-on name. The add-on directory also lists several alternatives with the same name.
No, as
_list
renders the task numbers based on the passed lines, that does not work; the numbering would be off. However, because completely empty lines are suppressed, blanking out those lines that you don't want (but keeping the newline to maintain the right numbering) will do what you want.
I was wondering how I can use that. I cannot pass lines to _lines via stdin. Should I have to create a temporary files with the lines I want to output via _list?
_format()
is invoked by _list()
, too; just the summary footer is missing. You should be able to avoid using a temporary file (though that certainly is not too bad, neither). Todo files aren't that large; it should comfortably fit into memory, so holding the (filtered) contents in a Bash variable (and then echo
ing that into _list()
should be possible.
@ransome1 I went into more detail on the Github issues section, but the short answer is yes, I think the listed filters should shrink based on the amount of visible todos.
Here's my answer! ransome1/sleek#4
@ransome1 Works great! I've also got it via snap on Ubuntu 20.04 so it updated automatically there this morning!
Thank you for this app! I like the fact that it's multi-platform as well; I've been looking to share a todo.txt process with some folks using different OS's. I'll let you know if we discover anything in that process!