root/todo/tags/0.1.20/doc/scripts.sh

Revision 290, 1.2 kB (checked in by athomas, 4 years ago)

Initial import.

  • Property svn:executable set to
Line 
1 #
2 # These functions override builtin bash commands that change directories.
3 # The purpose of this is to show any todo items as soon as you move into a
4 # directory. Quite handy.
5 #
6 # The script will also display todo items upon first login.
7 #
8 # For example, if I have some todo items in my home directory and I cd ~,
9 # the items will be displayed.
10 #
11 # This script should be added to either the system wide shell initialisation
12 # file (/etc/profile) or a user specific initialisation file (~/.bash_profile
13 # or ~/.profile). In addition, if you are using X, terminals you start up
14 # should be login terminals (typically -ls, --ls or something to that effect).
15 #
16
17 # Only display every X (10) seconds, and display a maximum of one line per note.
18 # The timeout period can be modified by putting
19 #    timeout <N>
20 # in your ~/.todorc.
21 TODO_OPTIONS="--timeout --summary"
22
23 cd ()
24 {
25         builtin cd "$@"
26         RV=$?
27         [ $RV = 0 -a -r .todo ] && devtodo ${TODO_OPTIONS}
28         return $RV
29 }
30
31 pushd ()
32 {
33         builtin pushd "$@"
34         RV=$?
35         [ $RV = 0 -a -r .todo ] && devtodo ${TODO_OPTIONS}
36         return $RV
37 }
38
39 popd ()
40 {
41         builtin popd "$@"
42         RV=$?
43         [ $RV = 0 -a -r .todo ] && devtodo ${TODO_OPTIONS}
44         return $RV
45 }              
46
47 # Run todo initially upon login
48 devtodo ${TODO_OPTIONS}
Note: See TracBrowser for help on using the browser.