Corsica

A free UNIX program for preventing Repetitive Strain Injury (RSI)
by Herbert Bos and Paul van der Mark

Leiden Institute of Advanced Computer Science (LIACS)
Leiden University, The Netherlands



Corsica is a UNIX program that enforces regular breaks with an eye on preventing or counteracting Repetitive Strain Injury (RSI).

The distribution contains various flavours. For the basic version of the program, you only need to be running X. For a more advanced version, you need to have access to Tcl/Tk also. The more advanced version runs a prettier interface during the breaks. For example, it will show a set of tips and exercises to prevent RSI.

Corsica keeps track of keyboard activity and pops up a window when a threshold is exceeded. By default it also locks the keyboard and mouse buttons during the breaks. You can overrule this keyboard lock by pressing ESC.

Corsica has been tested on Solaris, Linux, and HPUX. We suspect it works on many other versions of UNIX as well, as long as they support X11 and shared libraries. What's required is Xlib (for the basic version). For the advanced version Tcl/Tk is also needed (we are using version 8.1 of both Tcl and Tk, but older versions may work also). If you have a different flavour of UNIX, our advice is to simply try it and see whether it works or not. If you get it to work on a version that is not listed here, please let us know.



DOWNLOAD

We have run some final tests and plan to fix the bugs we found at some unspecified time in the future (i.e. when we have time, when we actually understand X, when hell freezes over, etc.). Until then, an official release of Corsica will not be available from this webpage. In the meantime, you can try the pre-release. The Tcl/Tk version of Corsica is shown in the snapshot below. More information about Corsica can be found in the README file included below the snapshot. This is free software. If you like the program, send us an email.




SCREEN SHOT




Figure 1. Corsica pops up over a calendar application and (while locking the keyboard) shows tips and exercises.



CHANGE LOG

Date Change
Nov 8 11:32:42 2001 Signal handling added, so if bad stuff happens, keyboard is unlocked
Oct 2 14:27:44 2001 Fixed various memory leaks (long overdue)
Sep 13 18:08:12 2001 Added error logging capabilities and patched some of the code (in a disgusting manner) so the crashes won't occur anymore.
Jul 10 19:55:41 2001 The Tcl/Tk pre-release may suffer from occasional crashes (i.e. it has reached Windows' stability). Just restart to get it running again.




README
============================================================================
				Corsica 1.0
============================================================================
 
What is a Corsica?
     
     Corsica is a UNIX program that enforces regular breaks with an
     eye on preventing or counteracting Repetitive Strain Injury
     (RSI). 
     
     The distribution contains various flavours. For the basic version
     of the program (default), you only need to be running X. For a
     more advanced version, you need to have access to Tcl/Tk also.

     The more advanced version runs a prettier interface during the
     breaks. For example, it will show a set of tips and exercises to
     prevent RSI. (You can add to these as well: simply dump any GIF
     image you want to include in the ./Tk-interface/gifs directory and
     they will automically appear next time you run the program). To
     run this version, also see the note at the bottom. The basic X
     version, meanwhile, only shows a window with a time line, but
     offers similar functionality.

     Corsica also provides an extensible framework which allows
     programmers to add their own versions with their own interfaces
     to the basic distribution. Provided they are stable, we welcome
     any such additions and would be happy to stick them in the
     official distribution.
     
How does it work?
        
     Corsica works by catching the X key events for all windows on a
     desktop. In this way, it will check every few seconds whether
     there was any keyboard activity. If the program concludes that
     during a certain time interval, known as 'time between breaks'
     (settable with the -w option), the recorded keyboard activity
     exceeded a threshold, it will pop up a window saying it's time
     for a break and in addition, it will lock the keyboard and mouse
     buttons (note that this can be turned off, if desired). By
     default, the keyboard and mouse button locks may be overriden
     only by pressing the ESC key (this can be turned off also).
     
On what platforms does it run?

     Corsica has been tested on Solaris, Linux, and HPUX. We suspect
     it works on many others as well, as long as they support X11 and
     shared libraries. What's required is Xlib (for the basic
     version). For the advanced version Tcl/Tk is also needed. If you
     have a different flavour of UNIX, our advice is to simply try it
     and see whether it works or not. If you get it to work on a
     version that is not listed here, please let us know.
     
Download

     Corsica can be downloaded from
     http://www.liacs.nl/~herbertb/misc/corsica
 

Changes:

     Sep 13 18:08:12 2001
     Added error logging capabilities and patched some of the code 
     (in a disgusting manner) so the crashes won't occur anymore.

     Jul 10 19:55:41 2001
     The Tcl/Tk pre-release may suffer from occasional crashes
     (i.e. it has reached Windows' stability). Just restart to get it 
     running again.

Copyright

     Corsica is free software, available under the GNU General Public
     License. 

     *** IF YOU LIKE THIS SOFTWARE, PLEASE SEND US AN EMAIL: herbertb@liacs.nl

============================================================================
			How to build and run
============================================================================

(1) Download the software (corsica-x.x.x.tar.gz) and unpack as follows:

	 tar zxvf corsica-x.x.x.tar.gz


(2) This will create a directory rsi/. In this directory, and the
    sub directories rsi/server/ rsi/X-interface/ and rsi/Tk-interface,
    type:

	  configure 

    The configure script will go and look for specific things in your
    environment and generate a Makefile when it's done. If no
    parameters are specified, the configure script will make the
    simple X interface the default. If you know you want the Tcl/Tk
    interface as default, you can specify this as follows:

	  configure --enable-interface=Tk

    Note that, regardless of which interface you specify here, you can
    always change the interface later (see step 4).

(3) The next step is to make the basic executable by typing (in the
    rsi/ directory):

	  make

    This should build the basic version of the program, unless you
    specifically configured the system to make the Tcl/Tk version your
    default interface, in which case this is the one that is built.

    If you built the basic version, but would like to try the more
    advanced Tcl/Tk version (or vice versa) you can continue with step
    4. Otherwise, you're done.


(4) If you have Tcl/Tk available at your site, you can build a Tcl/Tk
    version by typing:

	  make -C Tk-interface clean
	  make -C Tk-interface 


    *** Note: this will overwrite the default X library in directory ***
    *** ./libs. To change back to the default library, type:	     ***

	  make -C X-interface clean
	  make -C X-interface

    These two commands allow you to move between the two versions.


(5) To run the program simply type

	  rsi.sh

    This is a simple wrapper around the executable (./server/rsi)
    which automatically sets the LD_LIBRARY_PATH to include ./libs and
    can be run from any directory. Running the program with command
    line option '-h' will present and explain the various options.


    *** NOTE: Tcl/Tk version also needs libtcl.so and libtk.so (see below)

============================================================================
		Finding the Tcl/Tk libraries
============================================================================

If you want to run the more advanced version of Corsica, which uses
Tcl/Tk, you will also have to have libtcl.so and libtk.so on your
LD_LIBRARY_PATH. 

You can see whether they are, by running the program. If it works,
they must have been on the path, if not, you will see an error message
saying that libtcl.so or libtk.so can't be found. 

If this happens, find out where these libraries are (e.g.~by typing
'locate libtcl.so', if the locate program is available). Next, make
sure they can be found in the same way as in the example below.


			      Example
			      -------

As an example, assume that both libtcl.so and libtk.so are in
/usr/local/lib/ (which is the case in my local setup), this directory
is added to my LD_LIBRARY_PATH by typing (depending on the shell):

1. for /bin/sh or bash:

      LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
      EXPORT LD_LIBRARY_PATH

2. for csh and tcsh:

   setenv LD_LIBRARY_PATH=$LD_LIBRARY_PATH $LD_LIBRARY_PATH:/usr/local/lib

Now you should be able to run rsi.sh as normal. If you want to avoid
having to type this again in the future, just add the two lines in (1)
to the file rsi.sh, just before the last line.


============================================================================
		More information about RSI
============================================================================

 * http://www.rsi-uk.org.uk/ (English)
 * http://www.rsi-center.com/ (English and Dutch)
 * http://www.engr.unl.edu/ee/eeshop/rsi.html
 * http://www.leidenuniv.nl/arbodienst/brochures/rsi.htm (Dutch)
 * http://www.rsi-vereniging.nl/ (Dutch)

Other anti-RSI programs for unix:

 * http://www.lcdf.org/xwrits


============================================================================
		KNOWN BUGS:
============================================================================

1.  Not all options are currently used.

2.  Some applications (notably ghostview) do clever things with their
    keyboard events. Running Corsica may prevent them from getting
    some of their keystrokes, which means they have to be controlled
    by the mouse.

3.  Major: when used with keyboard locking, we are told that on rare
    occasions Corisca crashes while it has locked the screen (and
    without releasing the lock)! This is a very serious bug, but
    currently we don't have the time to track it down. You have to use
    another machine to kill Corsica (e.g. killall rsi). If you are not
    so lucky as to have multiple machines present: specify that you
    don't want to use the locking option!
    
============================================================================

Copyright (c) 2001 Herbert Bos and Paul van der Mark
Email: {herbertb,pmark}@liacs.nl



$Id: index.html,v 1.1 2001/07/04 14:01:55 herbertb Exp herbertb $