6

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.

Chris
  • 211
  • 3
  • 6

5 Answers5

4

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.

Bobby
  • 9,032
1

FvwmCommand requires the FvwmCommandS FIFO to be open. If you cannot be sure all your users have one, it won't work.

But FVWM will restart on SIGUSR1.

An FVWM restart will even work if it is the last command in .Xsession.

But as other have said, if running under an X session manager (and FVWM has been compiled with session manager support), FVWM won't restart by itself, it will merely quit and expect to be restarted by the session manager. This will also affect SIGUSR1 behavior.

1

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
invert
  • 4,996
0

For me, the following works:

kill -SIGUSR1 pid

where pid is the process id of the fvwm process to restart; easier (on Linux):

killall -SIGUSR1 fvwm
0

Another alternative is to use FvwmCommand:

$ FvwmCommand Restart
gavenkoa
  • 2,154