Subject: FVWM: conditionals?

From: Denis Perelyubskiy <[email-masked]>
Date: Sat, 19 Oct 2002 16:52:29 -0700

Hello,

I am trying to make my .fvwm2 config file work for both
2.5.x and 2.4x

In addition, depending on which machine I log in from, I
want to run 2.5.x or 2.4.x

In my fvwm2rc,I have things like ModulePath, which change
depending on which version I am running.

The only way I am aware of is to use $[FVWM_VERSION] and set
that version sometime before fvwm starts.

Also, I wanted to keep various parts of my config file in
different files. Is it possible to say something like :

source .fvwm.menues (or something)

and have that file included?

Also, is it possible to have conditional expressions in
fvwmrc, where i define something or other based on some
setting?

denis

-- 
// mailto: Denis Perelyubskiy <[email-masked]>
// icq   : 12359698
// PGP   : http://www.cs.ucla.edu/~denisp/files/pgp.asc
--
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: Dan Espen <[email-masked]>
Date: Sat, 19 Oct 2002 20:14:25 -0400

> fvwmrc, where i define something or other based on some

The fvwm variable $v contains the version.

Using PipeRead, you can do any kind of conditional statement.

For example, if you did:

PipeRead "shellcommand $v"

then shell command would be passed the Fvwm version string.
For the 2.5.4 release I'm running, that contains:

fvwm 2.5.4 (from cvs) compiled on Oct 18 2002 at 07:12:03

Anything printed by the shell command would be treated as
an Fvwm command.

-- 
Dan Espen                           E-mail: [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Sun, 20 Oct 2002 00:24:51 +0000

> depending on which version I am running.

Please remove ModulePath line completely. Don't comment it, just remove.
ModulePath is needed in neither 2.5.x nor 2.4.x (nor 2.2.x).

> and have that file included?

  Read menus  # this will include in ~/.fvwm/menus

  PipeRead "echo Read .fvwm2rc-`fvwm-config --version | cut -c1-3`"

The second includes either .fvwm2rc-2.4 or .fvwm2rc-2.5 depending
on version.

> fvwmrc, where i define something or other based on some

Mostly using this PipeRead technique.

Regards,
Mikhael.

---

From: Sam Izzo <[email-masked]>
Date: Sun, 20 Oct 2002 11:31:54 +1000

> want to run 2.5.x or 2.4.x

The way I do this at uni is by having one configuration for each machine:

yallara [11:26am] [~] ls -la .fvwm2rc*
-rw-------   1 izzo     students    7575 Oct  8 10:56 .fvwm2rc-numbat
-rw-------   1 izzo     students    7109 Oct  8 10:57 .fvwm2rc-yallara

Then my .xsession looks like this:

#!/bin/sh

# use correct config file depending on host

FOO=`hostname`
CONFIG=""

if [ $FOO = "yallara.cs.rmit.edu.au" ]; then
   CONFIG="$HOME/.fvwm2rc-yallara"
elif [ $FOO = "numbat.cs.rmit.edu.au" ]; then
   CONFIG="$HOME/.fvwm2rc-numbat"
fi

# start the window manager

exec fvwm2 -f $CONFIG

# eof

But you could of course use one of the other methods previously described;
they're probably more elegant. :-)

sam