Subject: FVWM: Loading a fvwm2rc.$HOST

From: Johan Svedberg <[email-masked]>
Date: Sat, 4 Jan 2003 22:54:31 +0100

Hello, world!

I'm wondering if there is a way to accomplish this from my fvwm2rc or do
I have to use some kind of shellwrapper like:

    export HOST=`uname -n | cut -d . -f 1`

    if [ -e ~/lib/fvwm2rc.\$HOST/fvwm2rc.$HOST ]; then
	. ~/lib/fvwm2rc.\$HOST/fvwm2rc.$HOST
    fi

I want to add diffrent configurations to my default one depending on
which machine I'm on. I'm aware of that I can use the source command,
but I would like to test if there actually is a file to be sourced
aswell.

Regards,

-- 
Johan Svedberg, [email-masked], http://www.acc.umu.se/~winkle
--
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: Cameron Simpson <[email-masked]>
Date: Sun, 5 Jan 2003 11:05:27 +1100

On 22:54 04 Jan 2003, Johan Svedberg <[email-masked]> wrote:
| I'm wondering if there is a way to accomplish this from my fvwm2rc or do
| I have to use some kind of shellwrapper like:
| 
|     export HOST=`uname -n | cut -d . -f 1`
| 
|     if [ -e ~/lib/fvwm2rc.\$HOST/fvwm2rc.$HOST ]; then
| 	. ~/lib/fvwm2rc.\$HOST/fvwm2rc.$HOST
|     fi
| 
| I want to add diffrent configurations to my default one depending on
| which machine I'm on. I'm aware of that I can use the source command,
| but I would like to test if there actually is a file to be sourced
| aswell.

Well, I invoke fvwm like this:

	fvwm -cmd "PipeRead fvwmrc"

and fvwmrc is a shell script to emit an fvwm rc file on stdout.
Perhaps you may want to adopt this approach, or some obvious variant?
-- 
Cameron Simpson, DoD#743        [email-masked]    http://www.zip.com.au/~cs/

Always code as if the guy who ends up maintaining your code will be a violent
psychopath who knows where you live.
	- Martin Golding, DoD #0236, [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: Mikhael Goikhman <[email-masked]>
Date: Sun, 5 Jan 2003 05:48:52 +0000

> but I would like to test if there actually is a file to be sourced

If you have different files with FVWM commands in some place, say ~/.fvwm,
you may include one or another such file from your main fvwm2rc using:

  Read additional-config-for-$[HOST] Quiet

Regards,
Mikhael.

---

From: Johan Svedberg <[email-masked]>
Date: Sun, 5 Jan 2003 14:37:35 +0100

>   Read additional-config-for-$[HOST] Quiet

Ah, exactly what I was after, thanks Mikhael. I'm guessing that won't
scream if there is no such file?

Regards,