Hi,

I want to execute a script in a xterm window every time I log out from
ion (the script does some interactive synchronization with a server).

At the moment, I have the following ~/.xsession file to accomplish
this:

xterm &
firefox &
# some more stuff to start
ion3
xterm -e sync-script

I first start some applications, then ion and after ion has finished,
I open an xterm and run the sync-script. This works fine, however,
from time to time, the xterm with the sync-script does not accept
keyboard input. 

I think the best solution would be to start the sync-script not after
ion has finished but "integrate" it into ion's shutdown procedure. So I
redefined the exit menu:

defmenu("exitmenu", {
    menuentry("Restart",        "my_restart()"),
    menuentry("Exit",           "my_shutdown()"),
})

where my_shutdown looks like this:

function my_shutdown() 
  -- start sync-script here!
  ioncore.shutdown();
end

The problem is now: how to start the sync-script? The call
ioncore.exec('xterm -e sync-script') does not block until the script
has finished and so shutdown proceeds without finishing the
sync-script. Is there some way to program the desired behavior?

Regards,
Stefan Wehr

-- 
Stefan Wehr
Web:  http://www.stefanwehr.de
PGP:  Key is available from pgp.mit.edu, ID 0B9F5CE4

Reply via email to