It is currently March 29th, 2024, 1:48 am

Rainmeter startup

Report bugs with the Rainmeter application and suggest features.
Resike
Posts: 33
Joined: May 1st, 2015, 1:25 am

Rainmeter startup

Post by Resike »

When starting Windows and loading the skins the network card is not always ready to use, which will make any WebParser measures fail untill the next update.
Would be nice if Rainmeter could automatically capture when the network card is ready to use and refresh every WebParser measures if it was failed to get their data before.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rainmeter startup

Post by jsmorley »

I don't think there is any way for that to happen as a part of core Rainmeter functionality, but you can work around this somewhat with a skin:

Code: Select all

[Rainmeter]
Update=1000

[MeasureOnLoad]
Measure=Calc
Formula=Counter
IfCondition=MeasureOnLoad = 5
IfTrueAction=[!SetOption MeasureNetwork Disabled "0"]

[MeasureNetwork]
Measure=Plugin
Plugin=SysInfo
SysInfoType=LAN_CONNECTIVITY
UpdateRate=1
Disabled=1
IfCondition=MeasureNetWork = 1
IfTrueAction=[!RefreshApp]

[MeterDummy]
Meter=String
Just have that skin loading when you start Rainmeter.

The key to it is that the built-in Counter function is not reset on a "refresh" of the skin, only when the skin is "loaded".

So when you start Rainmeter (or more to the point when you load this skin) it will check the Counter value. If it is "5", it will enable that [MeasureNetwork] measure, which will check the status of your network. We are waiting 5 seconds to ensure that Rainmeter has had time to completely "stand up". If you refresh it before it is done starting up, you can sometimes get a crash.

If the network is present, it will refresh all of Rainmeter, presumably then having any skins you use that require a network, like WebParser, get data pretty much the instant your network becomes available. There is no danger of an endless loop, since Counter is not reset, and will not ever be "5" again until you restart Rainmeter, or unload and load this skin.

If the network is not available, it will just keep checking once a second until the network becomes active.
Resike
Posts: 33
Joined: May 1st, 2015, 1:25 am

Re: Rainmeter startup

Post by Resike »

That could work, but i don't get it if you can make a skin to do this, then why is this not part of the program by default?