Re: running shell commands when the mouse hits a corner

Ted Zlatanov <tzz-mIZUurteI1BWk0Htik3J/[email protected]>
Newsgroups gmane.comp.window-managers.ion.general
Organization Теодор Златанов @ Cienfuegos
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.