-
Notifications
You must be signed in to change notification settings - Fork 716
Tips and Tricks
Access todo.sh from anywhere in the file tree. Add the following to your ~/.bashrc
file (~/.bash_profile
for Mac and Cygwin users):
PATH=$PATH:"/path/to/your/todo/scripts"
Avoid typing todo.sh every time. Add the following to your ~/.bashrc
file (~/.bash_profile
for Mac and Cygwin users):
alias t='todo.sh -d /path/to/your/todo.cfg'
Then you simply type t add laundry
from anywhere in your file tree to add a task.
Hide the configuration file by renaming it .todo.cfg
.
Access your remote server’s todo.txt
via ssh. If you have a shell account on remote.server.com
, alias your todo.sh
commands to do the same thing as usual but prepend ssh username
remote.server.com@ to them. Something like:
ssh [email protected] todo.sh list
Displays the remote todo list.
If you often have an open ssh session to remote.server.com
consider appending the following to your ~/.ssh/config
file:
Host * ControlPath ~/.ssh/master-%r@%h:%p ControlMaster auto
This causes ssh to use the existing connection rather than opening new ones. The speed up for additional connections is amazing.
Integrate your todo.txt onto your desktop
Bash completion
Add this to /etc/bash_completion.d/todo:
#have todo && _todo() { local cur prev opts COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" COMMANDS="add a addto app append archive birdseye command del \ rm depri dp do help list ls listall lsa listcon \ lsc listfile lf listpri lsp listproj lsproj move \ mv prepend prep pri p replace report" OPTS="-@ -@@ -+ -d -f -h -p -P -a -n -t -v -vv -V" case "${prev}" in #-*) # return 0 # ;; #add|a|addto|append|app|archive|del|rm|depri|dp|do|help| \ #list|ls|listall|lsa|listcon|lsc|listfile|lf|listpri|lsp|\ #listproj|lsprj|move|mv|prepend|prep|pri|p|replace| \ #report|) # return 0 # ;; *) completions="$COMMANDS $OPTS" ;; esac COMPREPLY=( $( compgen -W "$completions" -- $cur )) return 0 } #[ -n "${have:-}" ] && complete -F _todo $filename todo complete -F _todo todo
Now you can type $todo ad[tab] and bash’ll autocomplete to $todo add
High Color Support
xterm-based terminals, including Putty for Windows, support 256 colors instead of just 16. Here are some sample colors (including backgrounds) that you can paste into your config file right before the PRIORITY COLORS section. Check http://www.frexx.de/xterm-256-notes/ for a hex-to-xterm converter to get exactly the color you want.
### === HIGH-COLOR === compatible with most terms including putty ### for windows... use colors that don't make your eyes bleed :) export PINK='\\033[38;5;211m' export ORANGE='\\033[38;5;203m' export SKYBLUE='\\033[38;5;111m' export MEDIUMGREY='\\033[38;5;246m' export LAVENDER='\\033[38;5;183m' export TAN='\\033[38;5;179m' export FOREST='\\033[38;5;22m' export MAROON='\\033[38;5;52m' export HOTPINK='\\033[38;5;198m' export MINTGREEN='\\033[38;5;121m' export LIGHTORANGE='\\033[38;5;215m' export LIGHTRED='\\033[38;5;203m' export JADE='\\033[38;5;35m' export LIME='\\033[38;5;154m' ### background colors export PINK_BG='\\033[48;5;211m' export ORANGE_BG='\\033[48;5;203m' export SKYBLUE_BG='\\033[48;5;111m' export MEDIUMGREY_BG='\\033[48;5;246m' export LAVENDER_BG='\\033[48;5;183m' export TAN_BG='\\033[48;5;179m' export FOREST_BG='\\033[48;5;22m' export MAROON_BG='\\033[48;5;52m' export HOTPINK_BG='\\033[48;5;198m' export MINTGREEN_BG='\\033[48;5;121m' export LIGHTORANGE_BG='\\033[48;5;215m' export LIGHTRED_BG='\\033[48;5;203m' export JADE_BG='\\033[48;5;35m' export LIME_BG='\\033[48;5;154m' ### extra attributes export UNDERLINE='\\033[4m' ### sample of combining foreground and background # export PRI_A=$HOTPINK$MEDIUMGREY_BG$UNDERLINE