It is currently March 28th, 2024, 10:23 am

OnWakeAction

Changes made during the Rainmeter 3.0 beta cycle.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

OnWakeAction

Post by jsmorley »

We have added a new action option in the [Rainmeter] section of skins:

OnWakeAction
Action to execute when Windows returns from the sleep or hibernate states.

http://docs.rainmeter.net/manual-beta/skins/rainmeter-section#OnWakeAction
User avatar
QuakeGuy
Posts: 36
Joined: February 3rd, 2020, 11:15 pm
Location: Germany

Re: OnWakeAction

Post by QuakeGuy »

Sorry for bumping this old thread, but i have a question. I want my skin do a complete refresh, when you come back to your machine. My code:

OnWakeAction=[!Refresh]

But when i come back, it shows everything defined in OnConnectErrorAction for the webparser measure. It works normally after x minutes, when UpdateRate is reached again. I am curious about this. :(
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: OnWakeAction

Post by jsmorley »

QuakeGuy wrote: February 5th, 2020, 2:35 pm Sorry for bumping this old thread, but i have a question. I want my skin do a complete refresh, when you come back to your machine. My code:

OnWakeAction=[!Refresh]

But when i come back, it shows everything defined in OnConnectErrorAction for the webparser measure. It works normally after x minutes, when UpdateRate is reached again. I am curious about this. :(
While I can't be sure, it seems to me that when your system "wakes up", Rainmeter is kicking in before your network infrastructure is fully stood up. You might look at delaying the refresh for some number of seconds after you wake up.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
OnWakeAction=[!SetOption MeterString Text "10 seconds to Refresh"][!Delay 10000][!Refresh]

[MeterString]
Meter=String
FontSize=20
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Hello World
You can play with the amount of time in [!Delay 10000] to find something that is reliable for you.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: OnWakeAction

Post by jsmorley »

To be honest, using !Refresh feels a bit brute-force to me, although it may be appropriate in some circumstances.

Why not have the OnWakeAction wait some number of seconds, then simply [!CommandMeasure WebParserParentMeasure "Update"]

Going to be a lot less visibly "jarring" than refreshing the entire skin.
User avatar
QuakeGuy
Posts: 36
Joined: February 3rd, 2020, 11:15 pm
Location: Germany

Re: OnWakeAction

Post by QuakeGuy »

Wow, fast reply. Thanks JSMorley. Btw i am new here, maybe its not the right section, "Help: Rainmeter Skins" would be better?

To my problem: OnWakeAction=[!Delay 5000][!Refresh] would easily fix this. I will test it.
The described problem occurs on my desktop pc. When i use my Surface nothing happens at all. It shows still the values of the last update, when i switched off.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: OnWakeAction

Post by jsmorley »

QuakeGuy wrote: February 5th, 2020, 3:33 pm Wow, fast reply. Thanks JSMorley. Btw i am new here, maybe its not the right section, "Help: Rainmeter Skins" would be better?

To my problem: OnWakeAction=[!Delay 5000][!Refresh] would easily fix this. I will test it.
The described problem occurs on my desktop pc. When i use my Surface nothing happens at all. It shows still the values of the last update, when i switched off.
Either place is ok for this question.
User avatar
QuakeGuy
Posts: 36
Joined: February 3rd, 2020, 11:15 pm
Location: Germany

Re: OnWakeAction

Post by QuakeGuy »

Fine. The [!Delay 5000] does the trick. ;-)

Your are right, i maybe can directly update the measure. But i had no visual problems so far, because everything were always processed when i see my desktop.

The problem with my Surface still exists. I have no other laptop to test. Maybe OnWakeAction does'nt work here? I use the current Windows 10 Home on it.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: OnWakeAction

Post by jsmorley »

QuakeGuy wrote: February 5th, 2020, 4:01 pm Fine. The [!Delay 5000] does the trick. ;-)

Your are right, i maybe can directly update the measure. But i had no visual problems so far, because everything were always processed when i see my desktop.

The problem with my Surface still exists. I have no other laptop to test. Maybe OnWakeAction does'nt work here? I use the current Windows 10 Home on it.
I don't know, I don't have any experience with Windows Surface.
User avatar
QuakeGuy
Posts: 36
Joined: February 3rd, 2020, 11:15 pm
Location: Germany

Re: OnWakeAction

Post by QuakeGuy »

Ok. Has anybody here a Microsoft Surface and can test the OnWakeAction?
User avatar
QuakeGuy
Posts: 36
Joined: February 3rd, 2020, 11:15 pm
Location: Germany

Re: OnWakeAction

Post by QuakeGuy »

@JSMorley: I think it would be wise to move this thread or start a new one, so anybody can find it.

I noticed one difference:
The Rainmeter log at my Surface states something, that my desktop does not. But not every time!

System: "Show open windows" has been detected.
System: "Show desktop" has been detected.
Post Reply