Executing stuff on shutdown, plus standby stuff.
- kgschlosser
- Site Admin
- Posts: 5508
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Executing stuff on shutdown, plus standby stuff.
and here is a bunch more events for power related things
System.Monitor.Off
System.Monitor.On
System.Monitor.Dim
System.PowerSource.Line
System.PowerSource.Battery
System.PowerSource.UPS
System.BatteryLevel.0%
thru
System.BatteryLevel.100%
System.PowerSaving.Off
System.PowerSaving.On
System.PowerProfile.PowerSaver
System.PowerProfile.HighPerformance
System.PowerProfile.Balanced
windows xp only
System.BatteryLevel.Low
System.OemEvent
System.QuerySuspendFailed
System.ResumeCritical
System.QuerySuspend
System.Monitor.Off
System.Monitor.On
System.Monitor.Dim
System.PowerSource.Line
System.PowerSource.Battery
System.PowerSource.UPS
System.BatteryLevel.0%
thru
System.BatteryLevel.100%
System.PowerSaving.Off
System.PowerSaving.On
System.PowerProfile.PowerSaver
System.PowerProfile.HighPerformance
System.PowerProfile.Balanced
windows xp only
System.BatteryLevel.Low
System.OemEvent
System.QuerySuspendFailed
System.ResumeCritical
System.QuerySuspend
Re: Executing stuff on shutdown, plus standby stuff.
And how can i delay the shutdown now?
I want to do some stuff (like powering down the projector (CEC+), send a message to my smartphone (Autoremote)), but it seems that doesnt delay the shutdown.
Probably i can open an unsaved document and kill it after i got all my stuff done?
The wait doesnt seem to delay the shutdown in any way..
I want to do some stuff (like powering down the projector (CEC+), send a message to my smartphone (Autoremote)), but it seems that doesnt delay the shutdown.
Probably i can open an unsaved document and kill it after i got all my stuff done?
The wait doesnt seem to delay the shutdown in any way..
- kgschlosser
- Site Admin
- Posts: 5508
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Executing stuff on shutdown, plus standby stuff.
I am thinking this is going to give you a solution.
backup the file c:\program files (x86)\eventghost\plugins\system\__init__.py
download the 2 attached files and put them into c:\program files (x86)\eventghost\plugins\system
overwrite the __init__.py file
this will generate a couple new events
System.EndSession.SystemShutdown = Shutdown/Restart
System.EndSession.EventGhostShutdown = System is requesting the close of EventGhost
System.EndSession.LogOff = Local Logoff
System.EndSession.EventGhostForcedClose = System is forcing the close of EventGhost (out of memory.. things like that)
There are 2 new actions.
Shutdown\Block Shutdown
Shutdown\Block Logoff
They will do exactly as they state. with the Block Shutdown if you want to disable it run the same action with the message field blank.
This is going to stall the shutdown while the event System.EndSession.SystemShutdown is running. so any actions you are performing will get run before the shutdown occurs.
I have not fully tested this yet. but if someone wants to give it a go it should work.
backup the file c:\program files (x86)\eventghost\plugins\system\__init__.py
download the 2 attached files and put them into c:\program files (x86)\eventghost\plugins\system
overwrite the __init__.py file
this will generate a couple new events
System.EndSession.SystemShutdown = Shutdown/Restart
System.EndSession.EventGhostShutdown = System is requesting the close of EventGhost
System.EndSession.LogOff = Local Logoff
System.EndSession.EventGhostForcedClose = System is forcing the close of EventGhost (out of memory.. things like that)
There are 2 new actions.
Shutdown\Block Shutdown
Shutdown\Block Logoff
They will do exactly as they state. with the Block Shutdown if you want to disable it run the same action with the message field blank.
This is going to stall the shutdown while the event System.EndSession.SystemShutdown is running. so any actions you are performing will get run before the shutdown occurs.
I have not fully tested this yet. but if someone wants to give it a go it should work.
- Attachments
-
- ShutdownNotifier.py
- (3.17 KiB) Downloaded 107 times
-
- __init__.py
- (74.32 KiB) Downloaded 108 times
Re: Executing stuff on shutdown, plus standby stuff.
I'm not sure I've had an issue with a "wait" command not working, but as a temporary workaround you could have an event trigger the stuff you want to do before shutdown, then at the end of the event chain use the triggerevent function that actually shuts down. Thats what I always do to avoif any conflicts or oddity.
ex:
ir button press event::
do x
do y
do z
trigger "actual shutdown event" (the delay on trigger works for certain on my end)
then there would be a separate macro which listens for the "actual shutdown event"
ex:
ir button press event::
do x
do y
do z
trigger "actual shutdown event" (the delay on trigger works for certain on my end)
then there would be a separate macro which listens for the "actual shutdown event"
- kgschlosser
- Site Admin
- Posts: 5508
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Executing stuff on shutdown, plus standby stuff.
I am not sure But I do know that some remotes are hard coded for the shutdown through the driver it's self. and using EventGhost is not necessarly an option if you want to retain the use of that button.
Or if you use the mouse and shutdown the computer but still want EventGhost to perform a specific set of actions. that is where the above would come in useful.
Also if you didn't want the accidental shutdown of the computer. This can be used to block that shutdown process. At the present state of the additions it will display a screen telling you the reason why it cannot shutdown with the option to force terminate EventGhost. I can add an action that will simply stop windows from shutting down no matter what. if that is something that is wanted.
Or if you use the mouse and shutdown the computer but still want EventGhost to perform a specific set of actions. that is where the above would come in useful.
Also if you didn't want the accidental shutdown of the computer. This can be used to block that shutdown process. At the present state of the additions it will display a screen telling you the reason why it cannot shutdown with the option to force terminate EventGhost. I can add an action that will simply stop windows from shutting down no matter what. if that is something that is wanted.
Re: Executing stuff on shutdown, plus standby stuff.
Hi all!
Just got myself a Pulse8 HDMI CEC, and playing around with it.
My question is related to this topic.
For switching the TV off on shutdown I have played with the suggestions in this post, and using Main.OnEndSession works. However this also switches TV off when I restart windows, obviously cause windows ends on restart as well!
What event can I use, when I specifically tell windows to shutdown, eg from start menu? Is there one?
Thanks in advance!
PS While searching a lot of reference was made to a couple of threads eg the one below which seems to have disappeared, any ideas what it had?
http://www.eventghost.org/forum/viewtop ... f=2&t=2011
Just got myself a Pulse8 HDMI CEC, and playing around with it.
My question is related to this topic.
For switching the TV off on shutdown I have played with the suggestions in this post, and using Main.OnEndSession works. However this also switches TV off when I restart windows, obviously cause windows ends on restart as well!
What event can I use, when I specifically tell windows to shutdown, eg from start menu? Is there one?
Thanks in advance!
PS While searching a lot of reference was made to a couple of threads eg the one below which seems to have disappeared, any ideas what it had?
http://www.eventghost.org/forum/viewtop ... f=2&t=2011
Re: Executing stuff on shutdown, plus standby stuff.
EG lost its .org domain but if you change it to .net like so viewtopic.php?f=2&t=2011 it works
Re: Executing stuff on shutdown, plus standby stuff.
Thanks for that!
- kgschlosser
- Site Admin
- Posts: 5508
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Executing stuff on shutdown, plus standby stuff.
there is no way of telling the difference between say a shutdown or a restart. This was not something that was coded into windows.
The easiest way for you to be able to set something up like this is by use of a remote. and this is how I would set this up.
I would make a button a "restart" button. and that button when pressed would start a timer. and inside of say 10 seconds you would have to enter 4 digits from the remote. and the restart would begin first by disabling the action that turns off the TV. and then it would run the shutdown.
the whole password retry thing would be so that the button cannot be accidentally pressed.
The easiest way for you to be able to set something up like this is by use of a remote. and this is how I would set this up.
I would make a button a "restart" button. and that button when pressed would start a timer. and inside of say 10 seconds you would have to enter 4 digits from the remote. and the restart would begin first by disabling the action that turns off the TV. and then it would run the shutdown.
the whole password retry thing would be so that the button cannot be accidentally pressed.
Re: Executing stuff on shutdown, plus standby stuff.
kgschlosser wrote: ↑Fri Aug 31, 2018 3:00 pmI am thinking this is going to give you a solution.
backup the file c:\program files (x86)\eventghost\plugins\system\__init__.py
download the 2 attached files and put them into c:\program files (x86)\eventghost\plugins\system
overwrite the __init__.py file
this will generate a couple new events
System.EndSession.SystemShutdown = Shutdown/Restart
System.EndSession.EventGhostShutdown = System is requesting the close of EventGhost
System.EndSession.LogOff = Local Logoff
System.EndSession.EventGhostForcedClose = System is forcing the close of EventGhost (out of memory.. things like that)
There are 2 new actions.
Shutdown\Block Shutdown
Shutdown\Block Logoff
They will do exactly as they state. with the Block Shutdown if you want to disable it run the same action with the message field blank.
This is going to stall the shutdown while the event System.EndSession.SystemShutdown is running. so any actions you are performing will get run before the shutdown occurs.
I have not fully tested this yet. but if someone wants to give it a go it should work.
I've tried to use these Shutdown events and actions, but so far I am unable to get them to work in Windows 10. I am on the Insider Skip ahead preview if that makes a difference build 18865. I copied both files to the EG\Plugin\System folder and when I start EG, the 2 actions do show up in the actions list.
I added the System.EndSession.SystemShutdown event with an Autoremote Send Message action and a Block ShutDown action after that but it doesn't seem to send the message to AutoRemote and it doesn't block the shutdown either. Same with the System.EndSession.LogOff event as well.
I noticed that all of the other plugins in the System folder also had a .pyc file to match but the ShutDownNotifier does not have one. Is that file needed?
I'm sure I am doing something wrong but I haven't been able to figure it out yet. Any help would be appreciated!
- kgschlosser
- Site Admin
- Posts: 5508
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Executing stuff on shutdown, plus standby stuff.
return the system files back to their original ones and install this plugin instead
viewtopic.php?f=9&t=10276&p=52662#p52662
viewtopic.php?f=9&t=10276&p=52662#p52662
Re: Executing stuff on shutdown, plus standby stuff.
That Works!!! Thanks you very much.. I really do appreciate it!kgschlosser wrote: ↑Thu Mar 28, 2019 5:05 pmreturn the system files back to their original ones and install this plugin instead
viewtopic.php?f=9&t=10276&p=52662#p52662
- kgschlosser
- Site Admin
- Posts: 5508
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: Executing stuff on shutdown, plus standby stuff.
no worries m8. I made that plugin because it is a good feature to have. and we might at some point merge it with the core. it is something that should be included in the core.