Here’s the magic to get the video mode set right for the Sharp LL-172C-B monitor (1280x1024) on Ubuntu 9.04:
First, run CVT to get the modeline:
$ cvt 1280 1024
Copy the output from that into the Screen section of /etc/X11/xorg.conf
Section "Monitor"
Identifier "Configured Monitor"
# 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz
Modeline "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync
EndSection
Restart X and you’re in business.
Update: I found I needed to tune the values a little bit. See the post here for more details.