This is the gksyn README file for v2 and up.
Author: Romano Giannetti <romano@rgtti.com>

gksyn is a GKrellm plugins to control synaptic touchpad behaviour. See the
web page (http://rlog.rgtti.com/software/linux/gksyn/). You can ask the
author, too. 

To build gksyn, you have to:

   1 - have gkrellm 2.2 or better installed, included development library;
   2 - have synaptics driver installed. In debian-based linux distribution
       that means install the xserver-xorg-input-synaptic.  
   3 - uncompress the archive gksyn-x.y.z.tar.gz 
   4 - do "cd gksyn; ./build_gksyn" 
   5 - move gksyn.so and setlb.so to your plugin directory 
       ($HOME/.gkrellm2/plugins)
   6 - restart gkrellm, enable plugin and enjoy. 
   
Basically, the purpose of this plugin is to select if the touchpad is active
or not. The rationale of this is that, when typing on the keyboard, too much
often you can touch the active touchpad area an find yourself typing in a
completed unwanted position or window. 

After enabled, in your gkrellm you will have a new panel with an icon (a
grey square with a green check in it) and the word "On" on the rigth. That
means that your touchpad is enabled. 

If you click on the word "on", it will change to "Auto". Now your touchpad
will be enabled only if you are not typing for at least 2 seconds (default
value that can be changed with the configuration tab of the plugin). When
you type, the touchpad will be disabled and the icon will change to a grey
square with a red cross on it. 

If you click again on the "Auto" label, the touchpad will be put in a
continuos "Off" status. This could be handy when you have an external mouse
connected, but quite bad if not... so if the plugin does not detect an
external mouse it will not let you switch to Off. 

Notice that in the new version of X, if setting is "auto", the touchpad is
disabled also if you press a modifier key; this makes the "click+shift" or
"click+ctrl" combination difficult (you have to press the modifier, wait the
timeout, and then click on the touchpad).

I hope you enjoy the plugin; please drop me a note if you did. 

       Romano Giannetti 

CAVEATS AND THE GORY DETAILS.

-*- gksyn v2 uses the standard synaptics utilities. 

This version of the gksyn plugin uses (spawns) the commands synclient and
syndaemon, which do the real work of speaking with the touchpad. That way,
gksyn will be independent from updates (I hope) of the underlying drivers.
Basically, if symdaemon works for you, gksyn should too. 

One of the collateral effect of this is the necessity of using a LD_PRELOAD
trick to call the syndaemon program. That program, infact, uses standard
output to tell the user the status of the touchpad. Unfortunately, the
buffering rules in Unix pipes make it impossible to use it as a subprocess
and at the same time reading the output: being not connect to a tty, the
libc changes the stdout buffering to full mode... so I used a little trick
to change that. The problem is that gksyn *have* to find the preload
library, and that means that if your plugin directory is not the default
one, you have to modify the source (search for the start_daemon() function). 

-*- the "off" status. 

The off status is very dangerous. If you switch off the touchpad you can be
stuck. To solve this, the plugin tries hard to guess if there is another
mouse in the laptop, by looking at /proc/bus/input/devices. In case of
doubt, gksyn refuses to switch to off state. You can change this, if you
want, look at the function update_plugin(). 

In that case I *strongly* advise you to define a key to reenable the mouse. 
Under gnome, is simply a matter of going to System->Preferences->Keyboard
Shortcut and define a new action, with the command "synclient
touchpadoff=0", the assign it to a key combination. It can save your day.


ACKNOWLEDGMENT:
               
The software was written by a cut'n'paste and #include exercise of other's
people software, and more explicitly from:

- Pietro Franchi <knefas@gmail.com>

- the demo1.c and demo3.c example plugins from the gkrellm distribution 
  (thanks to Bill Wilson!)

- the gkacpi plugin (thanks to Michal Suski and Ralf Van Dorsselaer)

- the synaptic driver software (thanks especially  to Peter Osterlund)

- A bunch of very useful pages
  http://www.pixelbeat.org/programming/stdio_buffering/
  http://lists.gnu.org/archive/html/bug-coreutils/2008-11/msg00164.html
  http://en.gentoo-wiki.com/wiki/Synaptics_Touchpad
  
  
   