>> Does anyone know if it is possible to save the current state
>> ( window positions and applications running in them )
>> across login sessions?
>> Like my A window had A1 appl running on that postion on the
>> desktop, B window has B1 appl running .....
>> Upon exit fvwm saves it's state and picks it up upon restart.
>I believe it is possible with the FvwmSave module. I've never tried it, so I can't confirm it though.
I did not get the original article, so I'm replying to this one. Yes,
it is possible to save the state of the desktop, but how much data is
actually saved depends on how cooperative your applications are.
Usually you can save and restore the following information: what
applications are running, whether or not they are iconized, and where
on your screen they are. With most applications, you cannot hope to
restore where in your document you were, for example.
Here's how to do it. In your .fvwmrc, simply add the line
Module "SaveDesktop" FvwmSave
to one of your menus. Upon activation of that menu item, your desktop
configuration is saved to a file "new.xinitrc". To restore the
desktop, simply execute that file.
Well, you'll say, fine, but what I really wanted was for the desktop
to get saved automagically when I quit and restored automagically
as soon as I enter X again. You can do that, too, but -- at least in
fvwm 1.2, which is what I still use -- it does not work just to add
FvwmSave before the "Quit" line in your .fvwmrc, because fvwm does
not wait for FvwmSave to finish saving your desktop before exiting --
thus killing the freshly started module before anything is saved.
What I did was: Replace
Quick "Quit fvwm"
Function "Save and exit" save_and_exit
That function is defined as
Module "I" FvwmSave
Desk "I" 0 2 # or whichever desk you don't use
Exec "I" (sleep 2; xeyes)
Desk "I" 0 1 # or whichever desk you use
Wait "I" xeyes
FvwmSave is started; xeyes is started after a two-second-pause; as
soon as the xeyes window appears, fvwm quits. FvwmSave has at
least two seconds to perform its task -- and that is usually enough.
It would be even more elegant to have something like
Sleep "I" 20
but fvwm 1.2 does not have a command to unconditionally wait in a
You still have to add some code to your .xsession or .xinitrc or both
to make fvwm restore your desktop. This is what I have at the end of
my .xsession (with .xinitrc being a symlink to .xsession):
if [ -f ~/new.xinitrc ]; then # do we have a new.xinitrc?
grep -v 'fvwm' ~/new.xinitrc | grep -v 'xconsole' > /tmp/xinitrc.$$
# do not restart fvwm or xconsole
# If there is no saved state, fall back to a sane state.
xterm -geometry 80x34+0+0 &
I hope this helps!
Get my pgp key: http://www.fak14.uni-muenchen.de/~mselig/mykey.asc