On Thu, Feb 11, 2010 at 05:52:58PM +0100, Nathan H?sken wrote:
> On 02/10/2010 07:50 PM, Elliot S wrote:
> > You can move the window to its center and then shrink/expand.
> > You can check for overlap by piping to a script.
> >
> >   
> 
> Hi,
> 
> With piping to a script you mean using PipeRead? How can I inform the
> script about the windows on the current desktop?

You would only need to use PipeRead here to perform some mathematics, not to
check if the window is overlapped (see the Overlapped condition), but
potentially how much it is [1] overlapped by.  Then, in the same statement,
just call whichever function you choose with the correct number of arguments
-- which FVWM will pass in, as $0, $1, $2, etc.

So for example, if you had this:

DestroyFunc Foo
AddToFunc   Foo
+ I Echo $0
+ I SomethingWith $1

... and you need to calculate what $1 needed to be beforehand:

PipeRead `echo Foo hello $(($[SOME_ENV_VAR] + 23 - 1))`

FVWM would execute "Foo" as expanding:

$0 == hello
$1 == whatever the result from the calculation was.

Yes, I am contriving this deliberately -- so you'll have to fill in the gaps
with the appropriate FVWM functions and values, etc.

If you have problems then, with a specific function, you'll find the
"EchoFuncDefinition" command useful.

-- Thomas Adam

[1] By this point, all of this becomes trivial using FvwmPerl, to be honest.

-- 
"It was the cruelest game I've ever played and it's played inside my head."
-- "Hush The Warmth", Gorky's Zygotic Mynci.

Reply via email to