Restarting FVWM via a script

All:

This might be an odd question, but here it is:

I want to be able to, via a script, swap one .fwm2rc file, for another, and then restart X/FVWM, so that the new session of FVWM is available for use (I know that this is odd).

I know that I can write a bash script to move files, so that isn’t the issue, but restarting X/FVWM so that the new .fvwm2rc is loaded, is something that is way, way out of my league…

Any takers?
– Skender

The “Restart” command allows for this without the need of a script. You could add something like the following to a menu:

AddToMenu foo "Restart FVWM new Config" "Restart fvwm -f /path/to/new/config"
AddToMenu foo "Restart FVWM normal Config" "Restart fvwm"

– Thomas Adam

Excellent. Thanks Thomas.

Apparently FVWM also restarts when you send it the SIGUSR1 signal as mjk and tpope figured out in #fvwm, this might be handy if you somehow locked your FVWM and don’t have FvwmCommand running or if you want to restart FVWM from an external script and don’t want to use FvwmCommand.

(right, I just wanted to document this as it’s apparently not on the manpage and it fitted nicely in the topic, I admit it :wink: )

Of course – this used to be a long-standing facet of many of the init scripts in /etc/{rc,init}.d for many years.

– Thomas Adam