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
| #!/usr/local/bin/expect
# Script to enforce a 10 minute break
# every half hour from typing -
# Written for someone (Uwe Hollerbach)
# with Carpal Tunnel Syndrome.
# If you type for more than 20 minutes
# straight, the script rings the bell
# after every character until you take
# a 10 minute break.
# Author: Don Libes, NIST
# Date: Feb 26, '95
spawn $env(SHELL)
# set start and stop times
set start [clock seconds]
set stop [clock seconds]
# typing and break, in seconds
set typing 1200
set notyping 600
interact -nobuffer -re . {
set now [clock seconds]
if {$now-$stop > $notyping} {
set start [clock seconds]
} elseif {$now-$start > $typing} {
send_user "\007"
}
set stop [clock seconds]
}
|