Subject: FVWM: Resizing Windows using KEY bindings - or: Why can't fvwm calculate?

From: Marc-Jano Knopp <[email-masked]>
Date: Mon, 3 Dec 2001 13:37:25 +0100

Hi, all!

I'm a keyboard freak and want to MOVE and RESIZE my windows using
appropriate key bindings. Moving windows works (more or less, maybe
I'll mail about it later), but I cannot get resizing windows using
the keyboard to work.

What I used is

  Key  j  A  SCM   Function ResizeWinLeftFunc $w

and

  DestroyFunc ResizeWinLeftFunc
  AddToFunc ResizeWinLeftFunc
  + I WindowId $0 Resize $[w.width]-10 keep

I'm not that familiar with "programming" in fvwm, but as far
as I can see, fvwm does not evaluate "$[w.width]-10" properly,
when I do

  + I WindowId $0 Echo "WIDTH: "$[w.width]-10
  
instead, I get something like

  WIDTH: 503-10
  
on stdout/stderr. I haven't found anything that seems like
it could calculate expressions. Am I blind? The only way
of "calculation" seems to be function specific, e.g. the
Syntax

  Move w+5 50

Who can help?

Best regards

  Marc-Jano
  
P.S.: fvwm2 is not really perfect, but so far the best window
      manager I found - using fvwm/fvwm2 since 1993 or so!
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Marcus Lundblad <[email-masked]>
Date: Mon, 3 Dec 2001 14:19:38 +0100 (CET)

> instead, I get something like

You should use something like:
+ I WindowId $0 Resize `expr "(" $[w.width]-10 ")"` keep

I'm not sure it works to backquote inside a function line like that,
perhaps you must use PipeRead

---

From: Dan Espen <[email-masked]>
Date: Mon, 03 Dec 2001 08:33:35 -0500

> > I'll mail about it later), but I cannot get resizing windows using
...
> perhaps you must use PipeRead

You're right, backticks won't work there, you do need to
use PipeRead.

For example:

PipeRead 'echo echo value $(($[w.width]-10)).'

produces:

[FVWM][Echo]:  value 756.

the first echo is for the shell, the second one for Fvwm.
The $(()) is to get the shell to evaluate the arithmetic.
This was done in FvwmTalk which had a width of 766.

I'd construct and test the Resize command, but I don't
want to spoil the fun.

-- 
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].