Does anybody have a script or snippet to detect the current screen resolution?

I need the screen resolution for window placement. My remaster uses IceWM and Iconbox, and I want to place the iconbox and certain windows at startup.

Thanks,

nibl