Xresprobe is a package that probes both laptop and ddc-compliant screens for their standard resolutions, and returns a specifically-formatted, easy-to-parse output.
it contains the 'ddcprobe' package, which performs a ddc probe to the monitor; however, ddcprobe only works on i386 and powerpc. the laptop detection routines are, however, sufficiently generic to to be useful to other architectures.