(rulers shown with -bg #ffffff -fg #008080)

xruler: A pixel ruler for X11

xruler is a simple progam that should have come with the base X11 distribution, but didn't. It displays a small shaped window that has little arrows at every 10 pixels, and larger arrows at 50 and 100 pixels.

The orientation, length, foregroud color, and background color are all is configurable on the commandline:

usage: xruler [-display name] [-fg color] [-bg color] [-width number] [-height number]

Download the package here