systemevents *OnQuit Thread last updated on 2008-10-09 13:01:18

Posted by member 392791 on 2008-10-08 09:34:25

I use systemevents 0.2's *OnStart to launch a particular program when I start a particular theme with particular settings. That works.

I use its *OnQuit to kill that program when I change the particular setting in this theme. This also works.

I also want to kill that program when I change to a different theme, but *OnQuit doesn't work, and none of the other events works either.

So it seems systemevents doesn't provide an event that would be triggered when switching FROM a theme, only when switching TO a theme (so triggering *OnStart). Is there some other module that would be triggered by switching FROM a theme?

Posted by member 31 on 2008-10-08 12:15:35 link

I use its *OnQuit to kill that program when I change the particular setting in this theme. This also works. - I'm uncertain what you mean here.

Systemevents executes *OnStart when the module is loaded.
Systemevents executes *OnQuit when the module is unloaded.

Module's are loaded when LiteStep starts, and in the 2nd half of a LiteStep recycle.
Module's are unloaded when LiteStep exits and in the 1st half of a LiteStep recycle.

Themes are a set of configuration files, these configuration files are loaded and unloaded in the same situation as Modules. (ie. if you change themes, the original theme is unloaded in the 1st half of a recycle, and the new theme is loaded in the 2nd half of a recycle)

Assuming that you have Systemevents specified in your OTS2 personal configuration files:

When starting LiteStep (ie at logon) *OnStart will be executed.
When quiting LiteStep (ie at logoff) *OnQuit will be executed.
When you recycle/change themes, *OnQuit will be called first, then *OnStart will be called immediately afterwards.

If you are loading Systemevents from particular themes then you can figure out the correct behavior from the above information.

Posted by member 392791 on 2008-10-08 15:40:04 link

Sorry. My mistake. I was using

*OnQuit !Execute [taskkill.exe /f /im ClocX.exe]

which didn't always work, but when I changed it to

*OnQuit !Execute ["c:\winnt\system32\taskkill.exe" /f /im ClocX.exe]

it did work. I know c:\winnt\system32 is in my path. Are there situations in which bangs don't inherit the base environment?

Posted by member 1 on 2008-10-08 17:09:43 link

might have to do with the quotes more so than the path. Try pulling the quotes from the full path scenario and see if it works.

Posted by member 392791 on 2008-10-08 18:32:16 link

But with the quotes and the full path it works. I didn't use quotes when I didn't include the path.

Posted by member 1 on 2008-10-08 20:28:12 link

right...so try ["taskkill.exe" /f /im ClocX.exe] or [c:\winnt\system32\taskkill.exe /f /im ClocX.exe]. The first will hopefully work and the second would hopefully not.

Posted by member 392791 on 2008-10-09 00:33:09 link

My system crashed (actually LiteStep crashed), so I had to reboot. After rebooting, quoted and unquoted taskkill.exe without the full path works.

My system is a laptop, and I usually suspend or hibernate many times between reboots, and after a while Litestep starts losing system tray icons (usually the volume control, sometimes my wireless network indicator), so there seems to be a memory leak somewhere. I guess these memory leaks may affect Litestep's environment too.

I'll stick with a quoted full path to taskkill since it worked when the other variations didn't.

Thank you jugg and DeViLbOi for your help.

Posted by member 31 on 2008-10-09 11:07:52 link

Can you determine whether only doing suspend causes the tray icon problems, or whether only doing hibernate causes it? We'd like to ensure any problems of this sort do not happen and would appreciate if you could provide more details on this lost tray icon issue you are experiencing.

Posted by member 1 on 2008-10-09 13:01:18 link

I use Standby on my desktop and hibernate on my laptop and don't have problems with missing icons.