Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

For a very specific software application, we maintain a base of machines running fvwm 2.5. To update the menu structure, the fvwm2rc default config file is replaced during the update process performed by a package management system. To enable the new menu structure after an update, the user has to manually perform an action: Restart machine, re-login, restart fvwm. The preferred action is to choose "Window Manager > Restart Fvwm2" since no login is needed then and even the windows survive.

Question: How can I invoke an equivalent action as "Restart Fvwm2" from the command line or the package management system? The following command does not work (neither do similar ones):

fvwm -c "Restart"
[FVWM][SetupICCCM2]: <<ERROR>> another ICCCM 2.0 compliant WM is running, try -replace

"-replace" is no option since one needs to log in again after calling it.

share|improve this question

3 Answers 3

up vote 3 down vote accepted

What you want is either to make fvwm re-read the configuration or restart it completely. Additionally, I'm not totally sure that -c does what you want.

The fast or dirty way would be:

killall fvwm
fvwm

Note: Please do not execute this on a BSD or Solaris system, as killall will kill the init process there. killall processname is Linux only.

But I'm not sure if this wouldn't destroy some window information (location, dimensions etc.). Or, you could try replacing the current session:

fvwm --replace

That should end the old fvwm process, launch a new one and even keep the windows correctly.

If fvwm is your x-session, you could still try to use FvwmCommand, the external command interface which seems to be able to send commands to the currently running fvwm.

share|improve this answer
    
Thanks Bobby, but as I already stated, 'replace' does not work for me since I have to login again after that command. Unfortunately, it is the same with 'killall fvwm'. –  Chris Jun 5 '12 at 9:21
    
@Chris: Now I'm confused, why is fvwm running if there is no user logged in? –  Bobby Jun 5 '12 at 9:23
    
At the beginning I'm logged in, but the command 'fvwm -replace' logs me out, I have to log in again after calling it, the same thing happens with 'killall fvwm'. –  Chris Jun 5 '12 at 10:07
    
"killing the previously running wm may terminate your X session, if the wm was started as the last client in your .Xclients or .Xsession file." -- This is expected behaviour when you restart your WM, you have to log in again. Some WM's offer a "reload" (like spectrwm), that keeps your windows and session. fvwm seems to lack this. –  invert Jun 5 '12 at 10:38
    
@Chris: I see, didn't think of that. See my edit. –  Bobby Jun 5 '12 at 10:41

The Manual tells us:

Here are some cases when 'Restart fvwm2' or 'Restart fvwm' cause troubles:

  • running fvwm under a session manager
  • running fvwm with multi headed displays
  • having command line arguments, like -f themes-rc or -cmd
  • if the first fvwm2 in the $PATH is a different one

These points hint to why you see that message, check each of them off in your case.

Define some keyboard shortcuts to enact the restart command (also in the manual):

Key F1 R N Restart
Key F1 R N Restart fvwm -s
Key F1 R N Restart ~/bin/fvwm -f $HOME/.fvwm/main
Key F1 R N Restart fvwm1 -s -f .fvwmrc
Key F1 R N Restart xterm -n '"X console"' \
  -T \"X\ console\" -e fvwm1 -s
share|improve this answer
    
I'm not sure if there is a misunderstanding... The restart works well if I select it from the fvwm menu, it is the behavior I want. But I want it from the command line, that is, from outside of fvwm itself. –  Chris Jun 5 '12 at 10:10
    
sorry for the misunderstanding. There are no USR SIGNALS defined for fvwm, to trigger external restart, so @Bobby's answer is good in this regard. –  invert Jun 5 '12 at 10:37

Another alternative is to use FvwmCommand:

$ FvwmCommand Restart
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.