On Mon, 07 Jan 2008 16:12:19 -0500 Mark Eichin <[EMAIL PROTECTED]> wrote: 

>> Also, the X and Y dimensions are set to 1920x1200 in the script, but can
>> be overridden with -x and -y respectively.  I don't know how to grab
>> those automatically.

ME> If you're into running commands instead of doing Xlib from perl
ME> directly, just run "xwininfo -root" and parse out the Width: and
ME> Height: fields.  (For multi-monitor setups, just run one on each
ME> screen, or maybe look at xdpyinfo and parse "screen #" and
ME> "dimensions:" instead.)

I'd do Xlib directly to get the mouse position and the screen
dimensions, but I just don't have the time to play with it.  I know
Inline::C will do almost all the glue work, but the remaining 10% of
work will take me a long time...  If you or someone else can tell me the
Xlib calls to do those two things, I'll rewrite my script.  I did some
googling but didn't hit useful information.

There's a Perl X11::Protocol module but I'd rather not make the end user
install a huge CPAN module just for a few lines of C.  Similarly, I'd
rather not set up the X event loop if I can help it.  So the simpler the
better...  Thanks for any ideas.

Ted

Reply via email to