Is there a good cross-platform way of getting the screen dimensions? Frequently I do this with PerlTk:
use Tk;
my $mw = MainWindow->new;
my $screen_width = $mw->screenwidth();
my $screen_height = $mw->screenheight();
But it'd be better to not have to load all of Tk just to do this.
This looks like a good X11 specific way of doing these things (GetRootWindow should work for screen dimensions):
Perl: Getting the geometry of a window with X11 WindowID
But I think a cross-platform approach would be better.
Specifically, I'm looking for ways to determine the monitor dimensions in pixels, which is what Tk's screenwidth and screenheight return.