Subject: Re: FVWM: Global fvwm configuration

From: Lars Wirzenius <[email-masked]>
Date: Tue, 28 May 1996 20:17:49 +0300

[email-masked]:
> Carlos>  - If there is a $HOME/.fvwm2rc, no other configuration file
> Carlos>    seems to be read during configuration.
> 
> This is true, currently.

Earlier I said that fvwm would still read system.fvwmrc.  My statement was
wrong, but it's because I had misread Carlos as saying "If there is no ...".
I should get more sleep.

> For the next beta release I plan to make it look explicitly for
> system.fvwm2rc in the 'FvwmDir' directory before it tries to read
> on by default (haven't decided yet).

I think it may be a mistake to force a global config file to be read.
Or at least it will mean that the system admin can't put too much of an
environment there.  For instance, he can't start modules there, because
not everyone will want them.  A user should be able to completely avoid
a system.fvwmrc, IMHO.

> Well, another way is you could have all of your users read a file at
> the top of thier .fvwm2rc files that has all of your explicit menu
> definitions and such:
> 
>   # top of ~/.fvwm2rc
>   Read /path/to/your/system.fvwm2rc
>   # rest of user's rc file follows, which may override these things...

I think this solution is not so hot.  If the location or name of the
global file changes (and it _will_ change), every user .fvwm2rc will have
to be modified.

My system.fvwmrc hack is better, IMHO, because it reads in files from the
user's directory.  (See http://www.iki.fi/liw/misc/fvwm2config-0.1.tar.gz and
http://www.iki.fi/liw/misc/fvwm2debian-0.1.tar.gz.)

--
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: <[email-masked]> (Charles Hines)
Date: Tue, 28 May 1996 14:31:15 -0400

>>>>> "Lars" == Lars Wirzenius <[email-masked]> writes:

Lars> [email-masked]:
....

Lars> I should get more sleep.

I could use some of that myself...

>> on by default (haven't decided yet).

Lars> I think it may be a mistake to force a global config file to be
Lars> read.  Or at least it will mean that the system admin can't put
Lars> too much of an environment there.  For instance, he can't start
Lars> modules there, because not everyone will want them.  A user
Lars> should be able to completely avoid a system.fvwmrc, IMHO.

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.

>> # rest of user's rc file follows, which may override these things...

Lars> I think this solution is not so hot.  If the location or name of
Lars> the global file changes (and it _will_ change), every user
Lars> .fvwm2rc will have to be modified.

True.  This was merely an interim solution suggestion.

Lars> My system.fvwmrc hack is better, IMHO, because it reads in files
Lars> from the user's directory.

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 -f flag is a
workaround to that though (or should be, but Carlos said that didn't
work for him for some reason).  That was the reason I gave the not too
pretty solution as another option.

Chuck

*******************************************************************************
Charles K. Hines <[email-masked]>
IBM Logic Synthesis Developer [BooleDozer (TM)]
Martial Arts Instructor [Modern Arnis, Presas Style Filipino Martial Arts]

         "Go back to sleep, Chuck.  You're just havin' a nightmare
             -- of course, we ARE still in Hell." (Gary Larson)
*******************************************************************************
--
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: Austin Donnelly <[email-masked]>
Date: Tue, 28 May 96 20:10 BST

On Tue, 28 May 1996, Charles Hines wrote:

> system.fvwm2rc file, that's a minor problem...

I solved it for the Debian package by using a symlink from
FVWMDIR/.fvwm2rc to /etc/X11/fvwm2/system.fvwm.

This second file contains the real data.

Messy, sure, but I didn't want to modify the startup code.

Austin

---

From: Jean-Marc Lasgouttes <[email-masked]>
Date: Wed, 29 May 1996 13:58:09 +0200

>>>>> "Chuck" ==   <[email-masked]> writes:

>>>>> "Lars" == Lars Wirzenius <[email-masked]> writes:

    Lars> I think it may be a mistake to force a global config file to
    Lars> be read.  Or at least it will mean that the system admin
    Lars> can't put too much of an environment there.  For instance,
    Lars> he can't start modules there, because not everyone will want
    Lars> them.  A user should be able to completely avoid a
    Lars> system.fvwmrc, IMHO.

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

There could be two files that fvwm searches for:

- global.fvwmrc, which is always read if it exists
- default.fvwmrc, which is read if the user does not have a .fvwmrc

The sysadmin could choose which files he provides for the users.

Jean-Marc

---

From: Martin Kraemer <[email-masked]>
Date: Wed, 29 May 1996 15:14:45 +0200 (MET DST)

Jean-Marc Lasgouttes wrote...
> The sysadmin could choose which files he provides for the users.

Or even easier: using a new directive
    ConfigPath: $HOME:/usr/lib/X11/fvwm2
, a "combined" system.fvwm2rc could consist of
    .... a lot of defaults .... and as the last line:
    Read ".fvwm2rc"  # either ~/.fvwm2rc or /usr/lib/X11/fvwm2/.fvwm2rc
which would include either the user's config files or the system
equivalents.

Or, using the Pipe mechanism I saw on this list earlier on (and which I
think would be _very_ useful to include as a standard feature), one
could easily write
    Read "| [ -f $HOME/.fvwm2rc ] && cat $HOME/.fvwm2rc || cat /usr/lib/X11/fvwm2/system.fvwm2rc"

Or a combination of both methods could be chosen.

Just a thought.

    Martin
-- 
| S I E M E N S |   [email-masked]   |      Siemens Nixdorf
| ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
| N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request
--
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: [email-masked] (Emilio Lopes)
Date: Wed, 29 May 96 11:34 EST

>>>>> "liw" == Lars Wirzenius <[email-masked]> wrote:

liw> I think it may be a mistake to force a global config file to be
liw> read.  Or at least it will mean that the system admin can't put
liw> too much of an environment there.  For instance, he can't start
liw> modules there, because not everyone will want them.  A user
liw> should be able to completely avoid a system.fvwmrc, IMHO.

That's my HO too.

Let me say what I do with shell initialization files (~/.bashrc and
~/.bash_profile) in the workstations I take care of. These files, as
they're put in the user home dir by adduser, have something like:

## This is "~/.bashrc". This file is execute by bash for non-login
## interactive shells.

## Everything is handled by a cluster-wide file. Feel free to copy it
## to your home directory and make the changes you want, but be ware
## that eventual changes done to the system will not be reflected to
## your environment! If you want to make small changes, do them
## *after* the indicated line.

SHRC=/usr/local/cetc/sh.shrc
if [ -r $SHRC ]; then
   . $SHRC
fi
unset SHRC

## Put your local customizations after this line.

I think the same scheme can be done with fvwm2: the ~/.fvwm2rc can
"Read" some system-wide file and the user can them do some
"overloading" after the "Read". This works only with version 2, where
the order of the "sections" is no more important.

Emilio.

-- 
 Emilio C. Lopes <mailto:[email-masked]>
 FINPE, Instituto de Fisica      E-mail: [email-masked]
 Universidade de Sao Paulo       Phone : (+55 11) 818-6724 (Voice)
 Caixa Postal 66318                      (+55 11) 818-6715 (Fax)
 05389-970  Sao Paulo - SP
 BRAZIL
--
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: [email-masked] (Emilio Lopes)
Date: Wed, 29 May 96 11:52 EST

Just forget my message. I've just noted people want something more
sophisticated....

Emilio.

>>>>> "Me" == Emilio Lopes <[email-masked]> wrote:

Me> I think the same scheme can be done with fvwm2: the ~/.fvwm2rc can
Me> "Read" some system-wide file and the user can them do some
Me> "overloading" after the "Read". This works only with version 2,
Me> where the order of the "sections" is no more important.

---

From: <[email-masked]> (Charles Hines)
Date: Wed, 29 May 1996 11:15:59 -0400

>>>>> "Martin" == Martin Kraemer <[email-masked]> writes:

....
Martin> Or, using the Pipe mechanism I saw on this list earlier on
Martin> (and which I think would be _very_ useful to include as a
Martin> standard feature), one could easily write
....

Fear not.  I liked that idea and plan to include it.

It's just a matter of do I include it before or after the first
official release.  I'm trying to be extremely selective about what
goes in right now so I can actually finially get that beast out the
door, and I haven't decided on a few things yet, this being one of
them.

Chuck

BTW - I still haven't gotten through all of the mail from the long
weekend yet, for those of you who might be waiting to hear back from
me on various things...
--
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: tim werner <[email-masked]>
Date: Wed, 29 May 1996 14:02:48 -0400

>Date: Wed, 29 May 1996 11:15:59 -0400
>From: <[email-masked]> (Charles Hines)

>I'm trying to be extremely selective about what goes in right now so I
>can actually finially get that beast out the door

Out daemon, out!!  :)

tw

---

From: Matt Estela <[email-masked]>
Date: Thu, 30 May 1996 12:34:42 +1000 (EST)

> the order of the "sections" is no more important.

I think this is over-complicating things. Why not just find the file the
way vim handles it's .vimrc:

First check for ./.fvwmrc, then ~/.fvwmrc, then system.fvwmrc. The first
one it finds is sourced, and the rest are ignored.

Yours etc,

Matthew Estela /Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/Z/
[email-masked]             http://www.progsoc.uts.edu.au/~mestela

---

From: Peter Funk <[email-masked]>
Date: Thu, 30 May 1996 07:40:43 +0200 (MESZ)

Quoting Martin Kraemer:
[...]
mk> Or, using the Pipe mechanism I saw on this list earlier on (and which I
mk> think would be _very_ useful to include as a standard feature), one
mk> could easily write
mk>     Read "| [ -f $HOME/.fvwm2rc ] && cat $HOME/.fvwm2rc || cat /usr/lib/X11/fvwm2/system.fvwm2rc"

This syntax is very misleading!  A leading vertical bar ('|')
suggests, that the process will open the pipe for writing instead 
of reading.  It would be much better, if the 'Read' command will
check, if the last character in the filename argument is a
vertical bar and then use 'popen' instead of 'fopen'.  Martins
example from above will than be written as
    Read "[ -f $HOME/.fvwm2rc ] && ...   ... m2/system.fvwm2rc |"
---------------------------------------------------------------^ !!

BTW: IMHO lines longer than 80 characters look very awful.  One feature
I am missing at least in fvwm 1.24r is the possibility to introduce
continuation lines.  Since the comment syntax of .fvwm[2]rc is shell
lookalike, it would make much sense to me, if a backslash ('\') as last
character in a line would cause the following newline to be ignored.

Regards, Peter
-=-=-
Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany
office: +49 421 2041925 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen)
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc
--
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: <[email-masked]> (Charles Hines)
Date: Thu, 30 May 1996 09:12:41 -0400

>>>>> "Peter" == Peter Funk <[email-masked]> writes:

Peter> Quoting Martin Kraemer:
Peter> [...]
mk> Or, using the Pipe mechanism I saw on this list earlier on (and which I
mk> think would be _very_ useful to include as a standard feature), one
mk> could easily write
mk> Read "| [ -f $HOME/.fvwm2rc ] && cat $HOME/.fvwm2rc || cat /usr/lib/X11/fvwm2/system.fvwm2rc"

Peter> This syntax is very misleading!  A leading vertical bar ('|')
Peter> suggests, that the process will open the pipe for writing
Peter> instead of reading.

I thought that initially too, and was thinking that 'Read "< cmd"'
might be better.  But then that would look like file redirection...

Peter> It would be much better, if the 'Read' command will check, if
Peter> the last character in the filename argument is a vertical bar
Peter> and then use 'popen' instead of 'fopen'.  Martins example from
Peter> above will than be written as

Peter>     Read "[ -f $HOME/.fvwm2rc ] && ...   ... m2/system.fvwm2rc |"
Peter> ---------------------------------------------------------------^ !!

A little hard to see there I think, but a possibility.

Or better, perhaps a separate command for it (like "ReadPipe" or
something like that).  I think quite a while ago a patch like this was
submitted (for 1.24r or an earlier 2.xx) to implement this (and a few
other things).  I think I may even have it here.  I had planned to add
that one at one point...

Peter> BTW: IMHO lines longer than 80 characters look very awful.  One feature
Peter> I am missing at least in fvwm 1.24r is the possibility to introduce
Peter> continuation lines.  Since the comment syntax of .fvwm[2]rc is shell
Peter> lookalike, it would make much sense to me, if a backslash ('\') as last
Peter> character in a line would cause the following newline to be ignored.

Haven't been keeping track of the announcements, eh? :)  That was
added to 2.0.42, courtesly of Jarl.

Chuck

---

From: Jim Nicholson <[email-masked]>
Date: Thu, 30 May 1996 10:04:12 -0400 (EDT)

> might be better.  But then that would look like file redirection...

Actually, read "| cmd" is similar to perl's open(HANDLE,"| cmd"). Perl
starts the pipeline; reads to HANDLE get cmd's stdout, while writes to
handle are placed on cmd's stdin. Perl *DOES* support 
open(HANDLE,"cmd |"), in which case you can read HANDLE to get cmd's
stdout, but cmd gets an eof on stdin reads.

---

From: Peter Funk <[email-masked]>
Date: Fri, 31 May 1996 08:42:36 +0200 (MESZ)

[...Discussion about Read from a shellcommand pipe...]

I wrote:
 
Charles Hines replied:
chuck> A little hard to see there I think, but a possibility.
chuck> 
chuck> Or better, perhaps a separate command for it (like "ReadPipe" or
chuck> something like that).   [...]

I think it is not the point, whether the trailing bar notation might
be a "little hard to see there"!  Much more important will be, how easy
somebody trying to write a .fvwm[2]rc file will be able to remeber the
syntax needed to invoke this feature and what its semantic will be.

I don't think that the probability, that somebody reading an existing
.fvwm2rc file will overlook this trailing bar, justifies to choose
one of those less intuitive choices.  Almost always the content
of the string after the Read command will make clear, that it is
a shellcommand and no simple include filename.  Only if the shell
command is simply an executable script with an arbitrary name, this
might cause some confusion.  But then a short look into the script will
make it obviuous.

IMHO a trailing '|' is most logical notation for the "Read from
a pipe"-feature.  Writing .fvwm[2]rc files without continuously
refering to the man page or other existing .fvwm[2]rc files is already
hard enough.

[...\ notation...]
chuck> Haven't been keeping track of the announcements, eh? :)  That was
chuck> added to 2.0.42, courtesly of Jarl.

Indeed.  I must have overseen that.  Sorry.

Regards, Peter
NOTE: Reply-To: has been set to the new fvwm-workers mailing list.
-=-=-