OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [expect/] [example/] [carpal] - Blame information for rev 1778

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
# Script to enforce a 10 minute break every half hour from typing -
2
# Written for someone (Uwe Hollerbach) with Carpal Tunnel Syndrome.
3
 
4
# If you type for more than 20 minutes straight, the script rings
5
# the bell after every character until you take a 10 minute break.
6
 
7
# Author: Don Libes, NIST
8
# Date: Feb 26, '95
9
 
10
spawn $env(SHELL)
11
set start [timestamp]   ;# when we started our current typing period
12
set stop [timestamp]    ;# when we stopped typing
13
 
14
set typing 1200         ;# twenty minutes, max typing time allowed
15
set notyping 600        ;# ten minutes, min notyping time required
16
 
17
interact -nobuffer -re . {
18
        set now [timestamp]
19
 
20
        if {$now-$stop > $notyping} {
21
                set start [timestamp]
22
        } elseif {$now-$start > $typing} {
23
                send_user "\007"
24
        }
25
        set stop [timestamp]
26
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.