Hello,

I made a patch a couple of months ago and have been using it all this
time. I figured that it wouldn't hurt to let you all know about it.

I know that in the past this have been suggested and discussed:

I reviewed a couple of old threads in the mailing list about this.
Well, really one thread, the other is just one post: 

http://www.mail-archive.com/fvwm-workers%40lists.math.uh.edu/msg00091.html
http://www.mail-archive.com/fvwm-workers%40lists.math.uh.edu/msg13962.html

On the thread, Rafal Bisingier, Mikhael Goikhman, Scott Smedley and Uwe
Pross discuse about the issue, but also about some more complex things,
which are not intended to be on this simple patch. This is just
intended to work as a simple Test modification, by reusing all what's
there, and not to provide any advanced conditional functionality,
which, as I see it, was one of the problems of the patch discussed in
that thread.

An example is worth more than a million words:

....................
SetEnv height $[vp.height]
# Read the left side panels
# ONLY if your screen resolution is equal or above
# 864 pixels on height
#Test (EnvGreaterOrEqual height 864) Read \
#        $[FVWM_USERDIR]/side-all-panels.config 
Test (Compare height >= 864) Read \
        $[FVWM_USERDIR]/side-all-panels.config 
....................


This two examples, the commented one, and the un-commended, do exactly
the same. I think their meaning is evident. So i am not going to give
any long explanation.

The whole operator set is implemented, in both ways, I found this way
convenient, because it is very much the same way that the resto of Test
conditionals are used within fvwm. Let me know which way do you preffer
(or if none at all, or if you would leave the two notations). This is
from the patch, the man page snippet:

....................
+The
+.I "EnvGreaterOrEqual varname pattern"
+test-condition is true if
+.I pattern
+matches or is greater than the given environment variable value.
+The
+.I "EnvGreater varname pattern"
+test-condition is true if
+.I pattern
+is greater than the given environment variable value.
+The
+.I "EnvLesser varname pattern"
+test-condition is true if
+.I pattern
+is lesser than the given environment variable value.
+The
+.I "EnvLesserOrEqual varname pattern"
+test-condition is true if
+.I pattern
+matches or is lesser than the given environment variable value.
+
+The
+.IB "Compare varname operator pattern " 
+test-condition is true if the logical operation defined by
+.IB "varname",
+.IB "operator "
+and
+.IB "pattern "
+is true. Where 
+.IB "operator "
+is one of >=, >, ==, <=, <.
....................


The patch is here, it is my home server, so, just bear with it :P
http://jesgue.homelinux.org/fvwm-files/new-test-conditions-v2.patch

Let me know what do you think, I would really like to see this in fvwm,
so people can get rid of ugly bash tricks to do something as simple as
to decide the size of a panel.

-- Jesús Guerrero

Reply via email to