Subject: FVWM: Multiple configs for multi-head?

From: Hal Haygood <[email-masked]>
Date: Mon, 7 Feb 2000 15:18:08 -0500 (EST)

My platform:
Solaris 2.6, Sparc 5, head 1 is S24 (24 bit), head 2 is CG3 (8 bit).  Soon
there will be head 3, CG3, 8 bit greyscale.  I'm using FVWM 2.2.4, built
from scratch.

I'd like to know the method for specifying configuration settings based on
the display.  For example, I can do HGradient title bars on my 24-bit head
with no problems, but this (obviously) nukes the colormap on the 8-bit
head.  Furthermore, I may need to specify a 'shades of green' palette for
the greyscale head when it goes in.

So, in other words, I'd like to be able to use different configs for the
different heads.

This would also help me with another issue.  Currently, everything
specified in FVWMButtons comes up on each display.  Umm, I don't have a
need for three load monitors, or biffs.  I'd like to display the main
FVWMButtons (with all the goodies) on display 0.0, but only show the
window buttons on displays 0.1 and 0.2.

I've got FVWM integrated with CDE, with '*wmStartupCommand:
/usr/local/bin/fvwm2' specified in ~/.Xdefaults.  Login is handled by
dtlogin, logout is handled by a MenuItem calling 'exec dtaction
ExitSession'.

One message in the mailing list archives mentions using M4 for
preprocessing.  How exactly is this done to parse for separate displays?
Or is there a way to specify display-specific config options in .fvwm2rc?

Thanks in advance for any advice you may have.

Hal
-- 
Hal Haygood  ::  [email-masked]  ::  [email-masked]
UNIX Technical Solutions Architect, Sprint Paranet, Raleigh, NC

--
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: Dominik Vogt <[email-masked]>
Date: Tue, 08 Feb 2000 11:09:34 +0100

> So, in other words, I'd like to be able to use different configs for the

You can start fvwm independently on each screen with the
'-s' and '-d' options:

  # fvwm2 -d :0.0 -s -f ~/.fvwm2rc.screen0
  # fvwm2 -d :0.1 -s -f ~/.fvwm2rc.screen1

And so on.

Bye

Dominik ^_^

-- 
Dominik Vogt, Agilent Technologies, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/464-4596, fax: 07031/464-3883, [email-masked]
--
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: Hal Haygood <[email-masked]>
Date: Tue, 8 Feb 2000 12:04:12 -0500 (EST)

>   # fvwm2 -d :0.1 -s -f ~/.fvwm2rc.screen1

Dominick,

Thanks.  I did read that the -s option specifies that FVWM should manage a
single screen.  However, I'm not sure this will work for me -- I've got it
integrated with CDE, and the WM is specified as a resource in
~/.Xdefaults .  If I run the commands listed above in a shell script,
backgrounding each one (&) except the last, and then specify that
shell script in .Xdefaults, would that work?

Or I suppose I could just try it and see, eh?  :)

And here's a somewhat related question.  Currently, with the dual head, I
just have one fvwm2 specified as the WM.  When it runs, it spawns off two
fvwm2's, like so:

     hal   386   377  0   Feb 06 ?        0:10 /usr/local/bin/fvwm2 -s
     hal   387   386  0   Feb 06 ?        0:10 /usr/local/bin/fvwm2 -s

Does FVWM have code that detects multiple-display systems, and
automatically spawns these off?  How is this handled in multi-head
systems where CDE is not in use?  I'm just curious as to how that works.

Thanks again for your help.

---

From: Grant McDorman <[email-masked]>
Date: Tue, 8 Feb 2000 16:38:48 -0500

According to Hal Haygood:
> > > the display.

[cut]

A better way, rather than starting one for each screen manually, is to use
M4 (or perhaps CPP) to preprocess the file. For your case, where you want to
do things based on colour depth, it works even better because you can
configure by depth rather than by screen number. The macro CLASS will be the
screen type (in your case, TrueColor or PseudoColor, depending on the
screen); the macro SCREEN will be the screen number; the macro COLOR will be
Yes or No, as appropriate, and the macro PLANES will be the depth (i.e. 8 or
24) - see the FvwmM4 manual page for a complete list. So, in M4, you can do
things like:

  ifelse(CLASS,'TrueColor','
    x-your-root-loader -background pretty-24-bit-picture
  ','
    xsetroot -solid blue4')
  ifelse(SCREEN,'0','
    Module FvwmButtons-S0   # a symbolic link to FvwmButtons; use
                            # *FvwmButtons-S0 to configure
  ','
    Module FvwmButtons-S1
  ')

(Note, by the way, that you should supply -m4-squote and -m4-equote to the
fvwm invocation, since using the default quotes, as above, will probably not
work; I use curly braces {}.)

For a somewhat more complicated example, here's a snippet of my .fvwm2rc for
M4:

# TrueColor/Psuedo color configuration
ifelse(CLASS,{TrueColor},{
 # - can use fancy, colour-intensive stuff
 define({ACTIVE_PIXMAP},{Bluegrain.xpm})
 define({INACTIVE_PIXMAP},{greenleather.xpm})

 define({TITLE_ACTIVE_PIXMAP},{MARBLE_SMOKE.xpm})
 define({TITLE_INACTIVE_PIXMAP},{GreySlate.xpm})

 define({GRADIENT},{MenuFace DGradient 128 2 lightgrey 50 blue 50 white})
 define({SIDEPIC},{SidePic side.fvwm2.xpm, SideColor Black })

 define({PICTURES},{/usr2/grant/Images/Paintings})
 define({PICGLOB},{*.jpeg})
},{
 # presumably pseudo-colour. Keep it down, keep it down.
 define({ACTIVE_PIXMAP},{Bluegrain.xpm})
 define({INACTIVE_PIXMAP},{greenleather.xpm})

 define({TITLE_ACTIVE_PIXMAP},{MARBLE_SMOKE.xpm})
 define({TITLE_INACTIVE_PIXMAP},{GreySlate.xpm})

 define({GRADIENT},{})
 define({SIDEPIC},{})

 define({PICTURES},{HOME/Patterns})
 define({PICGLOB},{*})
})

...snip...

AddToDecor  Basic
+           BorderStyle Active (TiledPixmap ACTIVE_PIXMAP)
+           BorderStyle Inactive (TiledPixmap INACTIVE_PIXMAP)
+           TitleStyle ActiveUp (TiledPixmap TITLE_ACTIVE_PIXMAP)
+           TitleStyle ActiveDown (TiledPixmap TITLE_ACTIVE_PIXMAP)
+           TitleStyle Inactive (TiledPixmap TITLE_INACTIVE_PIXMAP)

> just have one fvwm2 specified as the WM.  When it runs, it spawns off two

[cut]

> automatically spawns these off?

Fvwm looks at the number of displays and spawns a new instance for each.
However, it does keep some track of each instance; specifically, if you do a
'quit' in this case, it will terminate all instances. Conversely, if you run
individual copies with -s for each screen, quitting one won't quit the other.

You can force it to quit on one just screen when it automatically spawns -
look for the QuitScreen command (code I submitted way back for 2.0.46 or
thereabouts).

-- 

Grant McDorman <[email-masked]>, Senior Software Developer
Cedara Software Corp.  <URL:http://www.cedara.com>
  (formerly I.S.G. Technologies Inc.)
Mississauga, Ontario, Canada