Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Most useful script I've ever written, and legitimately how I keep track of everything important in my life:

  #! /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.


Similar. I've ended up at these functions in .bashrc:

   # 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).


I use Org mode in Emacs, so I have a follow up:

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.


I just have a Dropbox/todo.txt file opened permanently in Notepad++, no scripts and no need to type anything.


here's my pull request

$ cat << EOF > ~/.bash_profile

> alias lstd='ls ~/Dropbox/todo'

> EOF


And maybe some autocompletion if using zsh?

    #compdef todo
    
    _todo() {
      _files -W $HOME/Dropbox/todo/
    }
    
    _todo "$@"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: