by carpdiem · 3y ago · 0 comments
#! /bin/bash
function todo {
if [ $# -eq 0 ]
then
vim ~/Dropbox/todo/todo_list.txt
else
vim "$HOME/Dropbox/todo/todo_list_$1.txt"
fi
}
Sourcing this in my shell means I just have to type... todo
To automatically get into my default todo list which is synced to dropbox (and thus accessible everywhere on mobile as well).While, whenever I have a new project/etc come up, I can just
todo new_project_name
And get a new, nice clean file, with the same backups and multi-device accessibility. # Append a timestamped entry to the journal
log() {
printf "$(date +%Y-%m-%d--%H:%M) %s\n" "$*" >> $journal
}
# Query the journal
lquery() {
grep -ni $1 $journal
}
# Show all journal entries from today
ltoday() {
clear
grep -n $(date +%Y-%m-%d) $journal
}
# On a line identified by line number, switch @todo to @done
ldo() {
sed -i "$1 s/@todo/@done/" $journal
sed -i "$1 s/$/ \[COMPLETED $(date +%Y-%m-%d--%H:%M)\]/" $journal
}
Nice things about this system: there's only one file; I'm only ever looking at the data I want to see; and there are no applications running or files open (except my terminal, I guess).Do you have a format in your text files to track when things are done, like a checklist?
In Org, you can give things states like "TODO", "INPROGRESS", "DONE", "CANCELLED", add checkboxes (like "[ ]" and "[x]"), have sub-tasks/lists, etc.
I have really gotten into Org, and I have found there are a few other checklist formats/programs in plain text. Just wondering how you do it.
$ cat << EOF > ~/.bash_profile
> alias lstd='ls ~/Dropbox/todo'
> EOF
#compdef todo
_todo() {
_files -W $HOME/Dropbox/todo/
}
_todo "$@"