Xlib, WMs and Applications (WAS: Re: [TAG] icewm light weight desktop)
Thomas Adam
thomas at edulinux.homeunix.org
Sat Apr 30 17:31:22 MSD 2005
On Sat, Apr 30, 2005 at 12:38:10AM -0400, Benjamin A. Okopnik wrote:
> On Fri, Apr 29, 2005 at 10:27:24PM +0100, Thomas Adam wrote:
> Oh, how I wish it did. :) Not a big thing, but this has been a
> long-standing problem with Mozilla for me (both the Big Moz and now
> Firefox): Due to couple of info bars that I use (MailDooHicky and
> the Moaning Goat Meter), I like for my windows to span from the
It does work, but it's dependant on how the window manager deals with
such things. I have to say that some WMs are better than others in this
regard. It has been many years since I used icewm for any serious use,
but as far as I can recall, it doesn't allow for arbitrary commands to
be run on a window.
I hate to err, draw comparisons, but in FVWM, doing what you're
describing above can be achieved in two ways, the first is to use a
function, as in:
``
DestroyFunc FuncStartMoveBrowser
AddToFunc FuncStartMoveBrowser
+ I Exec exec $0
+ I Wait $0
+ I Next ($0) ResizeMove w+0 -100px 0 -30p
''
(I've most likely got the co-ordinates wrong, but that can be left as an
exercise to the reader).
So the above will exec the first formal argument to the function ($0),
wait for it to appear, and then will move and resize it to the said
co-ordinates. You might invoke it thus:
``
FuncStartMoveBrowser mozilla
''
One would replace 'mozila' with whatever program was wanted. But there
are limitations with that method. The first one is that it will only
work when invoked from within a menu, or FvwmConsole, and won't work if
one were to type in 'mozilla' from an Xterm. In such cases where this
is more desirable, FvwmEvent can be used, as in:
``
DestroyModuleConfig FvwmEvent-browser: *
*FvwmEvent-Browser: Cmd Function
*FvwmEvent-Browser: add_window FuncStartMoveBrowser
''
Which would set up an event for each window that was created, calling
the function specified. The function as we have it defined needs
modifying for use with FvwmEvent, as the window would have already been
created, hence:
``
DestroyFunc FuncStartMoveBrowser
AddToFunc FuncStartMoveBrowser
+ I All (CurrentDesk, AcceptsFocus, !Transient) \
ThisWindow ("gecko") ResizeMove w+0 -100px 0 -30p
''
I've used 'gecko' as that is the window class common to both Mozilla and
Firefox.
You're probably wondering how this helps you, Ben. It doesn't, _but_
there is an application which can move and resize windows which you
could make use of, coupled with xwininfo(1). It's called 'xwit' and is
just a wrapper program around some of the Xlib functions, so for
example:
``
xwit -move x y -resize x y -names 'mozilla'
''
If you wanted to get specific, you could use xwininfo to fine tune
things, matching by window ID, etc. Maybe a little crude, but it might
help you.
-- Thomas Adam
--
"One of us is a cigar stand, and one of us is a lovely blue incandescent
guillotine" -- Stephen Malkmus, "Type Slowly" from "Brighten The Corners"
More information about the TAG
mailing list