1 2 3
The xeyes program is a simple demo of how to follow the mouse cursor. This is from the modular X.org X11 project.