Subject: Re: FVWM: fvwm2rc + restart

From: Rainer Koehler <[email-masked]>
Date: Tue, 2 Apr 2002 18:45:53 -0800

John Smith writes:

> Hey, I was thinking about something as I was rewriting part of my
> configuration, and I thought it would be neat if there were an option in fvwm2
> where you can have fvwm2 automatically reload when you change the .fvwm2rc.

You were already told why it is not a good idea to have fvwm read its
config-file every time it changes.  This doesn't mean it's not
possible to edit it and reread it when you are done.

Here is my function to do that:

DestroyFunc EditFvwmrc
AddToFunc EditFvwmrc "I" Exec edit_fvwmrc.tk
+		     "I" Wait edit_fvwmrc.tk
+		     "I" echo Re-reading fvwmrc
+		     "I" Read .fvwm2rc

Edit_fvwmrc.tk is a little tcl/tk-script to edit the .fvwm2rc and open
a window to tell fvwm when we are ready:

- -----------------------------------------------------------------------------
#!/bin/sh
# -*- Mode: tcl -*-
#
# edit_fvwmrc.tk
# Created:     Tue Apr  2 17:54:21 2002 by [email-masked]
# Last Change: Tue Apr  2 18:42:34 2002
#
# use from within fvwm 2.2 to edit the .fvwm2rc and
# open a window to trigger a wait command in fvwm
#
#############################################################################\
exec wish $0 $@

exec gnuclient_emacs $env(HOME)/.fvwm2rc
update
exit
- -----------------------------------------------------------------------------

(Gnuclient_emacs is my command to tell a running emacs that we want to
 edit a file)

I hate scripts that have more comments than code, but my attempts to
squeeze everything into one Exec-line within the fvwmrc resulted only
in crashes (Of course, fvwm loads the edited fvwmrc when it is
restarted after the crash, but I don't think that's what you want :)

HTH
Rainer
--
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].