Subject: FVWM: Calculation in config file

From: Uwe Pross <[email-masked]>
Date: Tue, 18 Dec 2001 07:50:15 +0100

Hi there,

Is there a way doing some simple calculation in fvwm config file?

I am using FvwmButtons on top and FvwmTaskBar on bottom of the screen. I
have got two functions to maximize/resize windows. One is for showing
taskbar the other is for showing FvwmButtons and the taskbar:

AddToFunc ResizeToShowTaskBar I Maximize 100 -27p
+ I Raise

AddToFunc ResizeToShowButtons I Resize 100 773p
+ I Move 0 73p
+ I Raise

Since a working under different operating systems with different screen
resolutions it would be nice to use the functions above with variables
instead of 'hard' values:

AddToFunc ResizeToShowTaskBar I Maximize 100 -$[TASKBAR_HEIGHT]p
+ I Raise

AddToFunc ResizeToShowButtons  I Resize 100 $[SPACE_BETWEEN]p
+ I Move 0 $[BUTTONBAR_HEIGHT]p
+ I Raise

I would like to set/calculate the environment variables in the init
section depending on the actual screen resolution:

AddToFunc InitFunction
+ I SetEnv TASKBAR_HEIGHT   27
+ I SetEnv BUTTONBAR_HEIGHT 73
+ I SetEnv SPACE_BETWEEN    `$[vp.height] - $[TASKBAR_HEIGHT] -
$[BUTTONBAR_HEIGHT]`

I know the last line is not possible, but maybe someone got an idea to
obtain a similar behaviour. 

Thanks in advance,

Uwe
--
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: Mikhael Goikhman <[email-masked]>
Date: Tue, 18 Dec 2001 20:00:14 +0000

> obtain a similar behaviour. 

AddToFunc StartFunction
+ I SetEnv TASKBAR_HEIGHT   27
+ I SetEnv BUTTONBAR_HEIGHT 73
+ I PipeRead `printf "SetEnv SPACE_BETWEEN "; expr $[vp.height] - $[TASKBAR_HEIGHT] - $[BUTTONBAR_HEIGHT]`

Regards,
Mikhael.

---

From: Uwe Pross <[email-masked]>
Date: Wed, 19 Dec 2001 11:17:21 +0100

> + I PipeRead `printf "SetEnv SPACE_BETWEEN "; expr $[vp.height] - 
$[TASKBAR_HEIGHT] - $[BUTTONBAR_HEIGHT]`

This is exactly what I was looking for. It works perfectly.

Thanks mate.

Uwe