File: scripts.sh

package info (click to toggle)
devtodo 0.1.20%2Bgit20200830.0ad52b0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 968 kB
  • sloc: ansic: 5,307; cpp: 3,908; perl: 112; sh: 106; makefile: 45; csh: 2
file content (48 lines) | stat: -rwxr-xr-x 1,241 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#
# These functions override builtin bash commands that change directories.
# The purpose of this is to show any todo items as soon as you move into a 
# directory. Quite handy.
#
# The script will also display todo items upon first login.
#
# For example, if I have some todo items in my home directory and I cd ~,
# the items will be displayed.
#
# This script should be added to either the system wide shell initialisation
# file (/etc/profile) or a user specific initialisation file (~/.bash_profile 
# or ~/.profile). In addition, if you are using X, terminals you start up
# should be login terminals (typically -ls, --ls or something to that effect).
#

# Only display every X (10) seconds, and display a maximum of one line per note.
# The timeout period can be modified by putting
#    timeout <N>
# in your ~/.todorc.
TODO_OPTIONS="--timeout --summary"

cd ()
{
	builtin cd "$@"
	RV=$?
	[ $RV = 0 -a -r .todo ] && devtodo ${TODO_OPTIONS}
	return $RV
}

pushd ()
{
	builtin pushd "$@"
	RV=$?
	[ $RV = 0 -a -r .todo ] && devtodo ${TODO_OPTIONS}
	return $RV
}

popd ()
{
	builtin popd "$@"
	RV=$?
	[ $RV = 0 -a -r .todo ] && devtodo ${TODO_OPTIONS}
	return $RV
}              

# Run todo initially upon login
devtodo ${TODO_OPTIONS}