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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [insight/] [expect/] [example/] [carpal] - Rev 1782

Compare with Previous | Blame | View Log

# 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 [timestamp]   ;# when we started our current typing period
set stop [timestamp]    ;# when we stopped typing

set typing 1200         ;# twenty minutes, max typing time allowed
set notyping 600        ;# ten minutes, min notyping time required

interact -nobuffer -re . {
        set now [timestamp]

        if {$now-$stop > $notyping} {
                set start [timestamp]
        } elseif {$now-$start > $typing} {
                send_user "\007"
        }
        set stop [timestamp]
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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