Subject: Re: FVWM: Global fvwm configuration

From: Lars Wirzenius <[email-masked]>
Date: Tue, 28 May 1996 19:06:32 +0300

Carlos Carreras:
> I am the manager of a few workstations and I would like to provide a basic
> fvwm configuration file for all the users in my network. My interest is in
> maintaining a menu structure which is updated everytime a new application is
> installed so it can be accessed from the workspace menu by everyone. Besides,
> each user should be able to configure his fvwm with his $HOME/.fvwm2rc.

I've been working on a setup for this also.

>  - If there is a $HOME/.fvwm2rc, no other configuration file seems to be read
>    during configuration.

Fvwm should still read the system.fvwmrc, at least it does for me.

>  - If there is no $HOME/.fvwm2rc, I can't find where the default configuratio
> n
>    should reside to be read by fvwm2. 

On my system it is /etc/X11/fvwm2/system.fvwmrc, but the directory can be
set to anything when fvwm is configured.  In fvwm 2.0.42, at least, the
location is configured in Fvwm.tmpl.

I put my first attempt at the scripts in 
http://www.iki.fi/liw/misc/fvwm2config-0.1.tar.gz and
http://www.iki.fi/liw/misc/fvwm2debian-0.1.tar.gz.  The first is a
user-extensible system.fvwmrc replacement, that doesn't require every
user to have a .fvwm2rc, and the second is a set of tools for Debian Linux
that maintain a menu structure.

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: Tue, 28 May 1996 12:14:35 -0400

Carlos Carreras <[email-masked]> writes:
> Is it possible to do this with fvwm2? How? I have tried many things, but I
> have not been successful. Here is what is happennig:
> 
>    should reside to be read by fvwm2. It is not even clear how the file shoul
>    be called: .fvwm2rc or system.fvwmrc. I have tried both names in several
>    places but none of them worked:
> 
> 	/usr/lib/X11/fvwm/
> 	/usr1/lib/X11/fvwm/	(I have X11 in /usr1)
> 	/usr1/lib/X11/twm/
> 	/usr8/lib/fvwm/		(fvwm is installed in /usr8)
> 
>  - I also tried to call fvwm2 with the option -f "Read <file>" but that
>    didn't work either. (What am I doing wrong?)
> 
> I have version 2.0.42. Is there anything else I can do? Thanks in advance!

Invoke fvwm2 thru a shell.  In "/usr/public/bin/fvwm2" (or wherever):

#!/bin/ksh

# Shell to start fvwm2:

x=`uname -a`
case $x in
  SunOS*5\.*)
  	    ARCH_OS=sun_os5;;
  SunOS*4\.*)
  	    ARCH_OS=sun_os4;;
esac

export SYSBITMAPS=
case $ARCH_OS in
  sun_os4)
	   export SYSICONS=/usr/local/icons
	   export FVWMPLAY=play
	   FVWM=/usr/public/src/fvwm-2.0.40
	   ;;
  sun_os5)
	   export SYSICONS=/opt/icons
	   export FVWMPLAY=audioplay
           export SYSBITMAPS=$i/include/X11/bitmaps
	   FVWM=/opt/public/src/fvwm-2.0.42
	   ;;
  *)
     print "fvwm only supported on Sun OS 4 and 5 (by this shell)" >/dev/console
     exit 1;;
esac

export FVWMHOME=$FVWM/$ARCH_OS

if [ ! -f $HOME/.fvwm2rc ] ; then
  if [ -f $HOME/.fvwmrc ] ; then
    print "You currently have a version 1 .fvwmrc." >/dev/console
    print "Converting it using:" >/dev/console
    print " $FVWMHOME/fvwmrc_convert" >/dev/console
    $FVWMHOME/fvwmrc_convert
  else
    print "You don't currently have a .fvwm2rc file creating one" >/dev/console
    cp /u/tools/dane/fvwm2.0.40/new_user.fvwm2rc $HOME/.fvwm2rc
  fi
fi
export FVWMICONS=$FVWM/icons
export FVWMAUDIO=$FVWM/fvwm_audio

exec $FVWMHOME/fvwm2

The advantages to using  a shell,  is that you  can install  new fvwm2
releases more easily.

As far as sharing menu structures, you would want to put "reads" in the
"new_user.fvwm2rc" file like this:

  read $FVWMHOME/misc.appl.menus

(Use $FVWMHOME, or any other variable you set in your startup shell.)

> Carlos Carreras
> Univ. Pol. Madrid

--
Dan Espen                                    Phone: (908) 699-5570
[email-masked]
444 Hoes Lane  Room RRC 1C-214
Piscataway, NJ 08854
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: Lars Wirzenius <[email-masked]>
Date: Tue, 28 May 1996 22:54:19 +0300

[email-masked]:
> Oh, definitely.  I tried to word it to indicate that, but didn't
> succeed.  It'll either be added as an option to turn it on or off
> (depending on what I make the default).  Not sure which one I should
> make the default though.  I'm leaning towards default off.

I have no problem, then.  (I vote for not always reading the global config 
file by default.  It is less of a change from the current situation.)

> A system.fvwm2rc that reads files from the user's directory would be
> better, yes, but since fvwm doesn't currently look for a
> system.fvwm2rc file, that's a minor problem...  

The Debian Linux setup has a symlink from /usr/lib/X11/fvwm2/.fvwm2rc to
/etc/X11/fvwm2/system.fvwmrc.  I've probably been confusing everyone else. :)

BTW, reading both the global and local config files is not quite enough for
full extensibility, since the user will need a way to add entries to the
middle of the main menu (we don't want to have "Exit" in the middle of the
menu, do we?).

---

From: Lars Wirzenius <[email-masked]>
Date: Thu, 30 May 1996 18:16:07 +0300

Matt Estela:
> I think this is over-complicating things. Why not just find the file the
> way vim handles it's .vimrc: [ first one of .fvwmrc ~/.fvwmrc system.fvwmrc ]

That's essentially what happens now, except for the naming of files (and
I don't think . is searched).

The problem to be solved is this: many a sysadmin wants to set up a nice,
comfortable default environment for every user.  Something, for example,
that has a menu with all/most X programs that are installed on the system.
So he writes a system.fvwmrc that does this.  So far, so good.

However, many users will want to customize their environment, at least a 
bit.  For example, they might want to change colors, the background, or 
add a couple of entries to the menu.  To do this, they copy system.fvwmrc
to ~/.fvwm2rc, edit it, and they're happy.

Until the sysadmin changes system.fvwmrc to add a new program to the menu.

Instead of copying, the user might just put the line "Read /foo/system.fvwmrc"
as the first line in his .fvwm2rc.  This breaks when (not if) the sysadmin
moves the file to another place.  Also, it will cause helpdesk load when
people accidentally remove the line.

One way to handle this is have fvwm always read both system.fvwmrc and
.fvwm2rc.  This has the drawback that the user might not want any traces of
the default environment, so there must be some override.

My own solution is to have system.fvwmrc read in .fvwm2/post.hook (the name
needs some work, but it doesn't matter).  This solves all problems, I think.
If a user wants a small customization, they can just write a one-line 
.fvwm2/post.hook.  If they want to completely replace the environment,
they can create a .fvwm2rc (in which case system.fvwmrc is not read at all).

Actually, my solution introduces another problem: since I have many `hook'
files, the user may be more confused about what the file should be called.
Documentation can only go so far.

If someone wants to have a look, 
<http://www.iki.fi/liw/misc/fvwm2config-0.1.tar.gz>.

(Note: I use the name system.fvwmrc, although the actual name is
$(FvwmDir)/.fvwm2rc; I think system.fvwmrc is a better name, and I hope
it will be changed back in the future.  But I'm not lobbying it until I
write the code myself.)