It is currently February 25th, 2021, 10:56 pm

Color variable not set at startup

Help with creating, editing & fixing problems with skins
antonio0421
Posts: 24
Joined: January 6th, 2021, 7:01 am

Color variable not set at startup

Post by antonio0421 »

Hi,

Im using wifi meter of Sonder skin. I've tried to set the color variables to another color but it's seem they are not worked.

Here my code

Code: Select all

[Variables]
@include=#@#Variables.ini

WifiState=0
WifiIconBGColorCurrent=#WindowsColorDark#
WifiIconColorCurrent=#WindowsColorBGD#
The WifiIconBGColorCurrent are get nothing from #WindowsColorDark#, it's blank and my skin turned white.

After I change my wifi status by turning it off and on, the color change as same as the ones I've added from the WifiIconBGColorCurrent variable

Code: Select all

[MeasureInternet]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
SysInfoData=Best
IfCondition=MeasureInternet = -1
IfTrueAction=[!SetVariable WifiState 0][!SetVariable WifiIconBGColorCurrent #WindowsColorDark#][!SetVariable WifiIconColorCurrent #WindowsColorBGD#][!UpdateMeasure MeasureStrengthImg][!UpdateMeter MeterBackContainer2][!UpdateMeter MeterWifiImage][!Redraw][!Update]
IfFalseAction=[!SetVariable WifiState 1][!SetVariable WifiIconBGColorCurrent #WindowsColorBGL#][!SetVariable WifiIconColorCurrent #WindowsColorText#][!UpdateMeasure MeasureStrengthImg][!UpdateMeter MeterBackContainer2][!UpdateMeter MeterWifiImage][!Redraw][!Update]
DynamicVariables=1
I've come to conclusion that #WindowsColorDark# wont add to WifiIconBGColorCurrent at statup.

Later, I've added another code

Code: Select all

[Rainmeter]
Update=1
AccurateText=1
RightMouseDownAction=!Execute [!Refresh]
OnRefreshAction=[!SetVariable WifiIconColorCurrent #WindowsColorBGD#][!SetVariable WifiIconBGColorCurrent #WindowsColorDark#][!Redraw][!Update]
I hope OnRefreshAction will made it work but it's not.

Here the picture I've checked from the log.
As the two lines I've highlight, #WindowsColorDark# has value, WifiIconBGColorCurrent which's should set color from #WindowsColorDark# but it's blank
Image
You do not have the required permissions to view the files attached to this post.
Last edited by antonio0421 on February 23rd, 2021, 5:03 am, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 12279
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Color variable not set at startup

Post by balala »

antonio0421 wrote: February 15th, 2021, 12:28 pm Im using wifi meter of Sonder skin.
What are you using? You can't use a meter, you have to have loaded a skin. Sonder is a quite large suite, there are more skins. Which skin have you loaded? Might be for instance Sonder\Network\Network.ini, but please indicate precisely which skin are you working with.
antonio0421 wrote: February 15th, 2021, 12:28 pm After I change my wifi status by turning it off and on, the color change as same as the ones I've added from the WifiIconBGColorCurrent variable

Code: Select all

[MeasureInternet]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
SysInfoData=Best
IfCondition=MeasureInternet = -1
IfTrueAction=[!SetVariable WifiState 0][!SetVariable WifiIconBGColorCurrent #WindowsColorDark#][!SetVariable WifiIconColorCurrent #WindowsColorBGD#][!UpdateMeasure MeasureStrengthImg][!UpdateMeter MeterBackContainer2][!UpdateMeter MeterWifiImage][!Redraw][!Update]
IfFalseAction=[!SetVariable WifiState 1][!SetVariable WifiIconBGColorCurrent #WindowsColorBGL#][!SetVariable WifiIconColorCurrent #WindowsColorText#][!UpdateMeasure MeasureStrengthImg][!UpdateMeter MeterBackContainer2][!UpdateMeter MeterWifiImage][!Redraw][!Update]
DynamicVariables=1
Note a few mistakes in this code:
  • Recommend to get used to always (but always) quote what you have to set to a variable (through a !SetVariable bang), especially when this is a string (which I suppose #WindowsColorDark#, #WindowsColorBGL# and so on, are - if they are color codes, as I believe. If they indeed are color codes, even if they are composed by three or four numbers, they are strings). Will avoid a lot of headaches: https://forum.rainmeter.net/viewtopic.php?f=5&t=15253&p=85604#p85604
    In fact the best practice seems to be to quote even the meter name into a !UpdateMeter bang, for instance ([!UpdateMeter "MeterBackContainer2"] instead of [!UpdateMeter MeterBackContainer2]).
  • It's not needed to redraw a skin (with a !Redraw bang), if you just updated it (with !Update). On each update (no matter if that's the normal update or an updat made with a !Update bang) the skin is redrawn, so no need to redraw it once again.
  • The !Execute bang is deprecated, you should get rid of it. Simply not needed.
The last two mentions for sure don't fix the issue, however worth to take them into account.
antonio0421 wrote: February 15th, 2021, 12:28 pm Later, I've added another code

Code: Select all

[Rainmeter]
Update=1
AccurateText=1
RightMouseDownAction=!Execute [!Refresh]
OnRefreshAction=[!SetVariable WifiIconColorCurrent #WindowsColorBGD#][!SetVariable WifiIconBGColorCurrent #WindowsColorDark#][!Redraw][!Update]
Update can't be less than 16. This is the lowest possible value of Update (second paragraph here). If you're using a lower value (Update=1 for instance in this case), Rainmeter anyway uses the lowest possible Update=16.
Question is if it does worth to have a such low Update. In most cases the default Update=1000 is the best choice. However since I don't know which skin are you working with, I'm not sure what Update would be the best.

So, the first thing we should know is what skin are you working with. Please give us this information.
antonio0421
Posts: 24
Joined: January 6th, 2021, 7:01 am

Re: Color variable not set at startup

Post by antonio0421 »

balala wrote: February 15th, 2021, 8:48 pm What are you using? You can't use a meter, you have to have loaded a skin. Sonder is a quite large suite, there are more skins. Which skin have you loaded? Might be for instance Sonder\Network\Network.ini, but please indicate precisely which skin are you working with.

Note a few mistakes in this code:
  • Recommend to get used to always (but always) quote what you have to set to a variable (through a !SetVariable bang), especially when this is a string (which I suppose #WindowsColorDark#, #WindowsColorBGL# and so on, are - if they are color codes, as I believe. If they indeed are color codes, even if they are composed by three or four numbers, they are strings). Will avoid a lot of headaches: https://forum.rainmeter.net/viewtopic.php?f=5&t=15253&p=85604#p85604
    In fact the best practice seems to be to quote even the meter name into a !UpdateMeter bang, for instance ([!UpdateMeter "MeterBackContainer2"] instead of [!UpdateMeter MeterBackContainer2]).
  • It's not needed to redraw a skin (with a !Redraw bang), if you just updated it (with !Update). On each update (no matter if that's the normal update or an updat made with a !Update bang) the skin is redrawn, so no need to redraw it once again.
  • The !Execute bang is deprecated, you should get rid of it. Simply not needed.
The last two mentions for sure don't fix the issue, however worth to take them into account.

Update can't be less than 16. This is the lowest possible value of Update (second paragraph here). If you're using a lower value (Update=1 for instance in this case), Rainmeter anyway uses the lowest possible Update=16.
Question is if it does worth to have a such low Update. In most cases the default Update=1000 is the best choice. However since I don't know which skin are you working with, I'm not sure what Update would be the best.

So, the first thing we should know is what skin are you working with. Please give us this information.
Hi,

I'm using WiFi.ini of Sonder skin inside system folder (if I remember correctly)

Don't worry about the update, the default is 1000 but I'm have to refresh rapidly due to testing on it.

Thank for your mention. I'll try as soon as possible once I'm home.

Edit:

Hi, I'm home.

As you said, I've updated my skin.

The codes should be like this right?

Code: Select all

[Rainmeter]
Update=1
AccurateText=1
RightMouseDownAction=[!Refresh]
OnRefreshAction=[!SetVariable WifiIconColorCurrent "#WindowsColorBGD#"][!SetVariable WifiIconBGColorCurrent "#WindowsColorDark#"][!Update]
BackgroundMode=2
SolidColor=0,0,0,0

Code: Select all

[Variables]
@include=#@#Variables.ini
WifiState=0
WifiIconBGColorCurrent="#WindowsColorDark#"
WifiIconColorCurrent="#WindowsColorBGD#"

Code: Select all

[MeasureInternet]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
SysInfoData=Best
IfCondition=MeasureInternet = -1
IfTrueAction=[!SetVariable WifiState 0][!SetVariable "WifiIconBGColorCurrent" "#WindowsColorDark#"][!SetVariable "WifiIconColorCurrent" "#WindowsColorBGD#]"[!UpdateMeasure "MeasureStrengthImg"][!UpdateMeter "MeterBackContainer2"][!UpdateMeter "MeterWifiImage"][!Update]
IfFalseAction=[!SetVariable WifiState 1][!SetVariable "WifiIconBGColorCurrent" "#WindowsColorText#"][!SetVariable "WifiIconColorCurrent" "#WindowsColorBGL#"][!UpdateMeasure "MeasureStrengthImg"][!UpdateMeter "MeterBackContainer2"][!UpdateMeter "MeterWifiImage"][!Update]
DynamicVariables=1
The skin still white at startup which is mean it did not get color value at startup.

Yes! It's only not set value at startup. If I click the icon which is triggered the code, the color are set.

Also, WindowsColorDark and WindowsColorBGD are varriables get from SystemColor.ini which is created from this thread https://forum.rainmeter.net/viewtopic.php?f=5&t=36667
User avatar
balala
Rainmeter Sage
Posts: 12279
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Color variable not set at startup

Post by balala »

antonio0421 wrote: February 15th, 2021, 12:28 pm Im using wifi meter of Sonder skin. I've tried to set the color variables to another color but it's seem they are not worked.
The variables added by you to the [Variables] section (WifiIconBGColorCurrent=#WindowsColorDark# and WifiIconColorCurrent=#WindowsColorBGD#) are completely useless as you've added them, because the WifiIconBGColorCurrent and WifiIconColorCurrent variables are set through the IfTrueAction and IfFalseAction options of the [MeasureInternet] measure. Whatever values are you setting to them into the [Variables] section, these values are immediately overwritten by the !SetVariable bangs of the mentioned IfTrueAction and IfFalseAction options.
There is an extremely easy solution: you have to modify the WifiIconBGColorOff, WifiIconColorOff, WifiIconBGColorOn and WifiIconColorOn variables into the Sonder\@Resources\Variables.inc file, to the desired codes. Even if this has not too much importance, recommend to put back the original values of the variables into the [Variables] section of the skin (WifiIconBGColorCurrent=#WifiIconBGColorOff# and WifiIconColorCurrent=#WifiIconColorOff#).
antonio0421 wrote: February 15th, 2021, 12:28 pm

Code: Select all

[Rainmeter]
Update=1
AccurateText=1
RightMouseDownAction=!Execute [!Refresh]
OnRefreshAction=[!SetVariable WifiIconColorCurrent #WindowsColorBGD#][!SetVariable WifiIconBGColorCurrent #WindowsColorDark#][!Redraw][!Update]
Also recommend to check the Update value of the skin and in case you've modified it to Update=1, set it back to the default Update=1000.
antonio0421
Posts: 24
Joined: January 6th, 2021, 7:01 am

Re: Color variable not set at startup

Post by antonio0421 »

balala wrote: February 16th, 2021, 8:19 pm The variables added by you to the [Variables] section (WifiIconBGColorCurrent=#WindowsColorDark# and WifiIconColorCurrent=#WindowsColorBGD#) are completely useless as you've added them, because the WifiIconBGColorCurrent and WifiIconColorCurrent variables are set through the IfTrueAction and IfFalseAction options of the [MeasureInternet] measure. Whatever values are you setting to them into the [Variables] section, these values are immediately overwritten by the !SetVariable bangs of the mentioned IfTrueAction and IfFalseAction options.
There is an extremely easy solution: you have to modify the WifiIconBGColorOff, WifiIconColorOff, WifiIconBGColorOn and WifiIconColorOn variables into the Sonder\@Resources\Variables.inc file, to the desired codes. Even if this has not too much importance, recommend to put back the original values of the variables into the [Variables] section of the skin (WifiIconBGColorCurrent=#WifiIconBGColorOff# and WifiIconColorCurrent=#WifiIconColorOff#).

Also recommend to check the Update value of the skin and in case you've modified it to Update=1, set it back to the default Update=1000.
I too, thinking about put it back to default.

I just want to know any possible solution exist so all my skins can synchronized with my windows color.
User avatar
balala
Rainmeter Sage
Posts: 12279
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Color variable not set at startup

Post by balala »

antonio0421 wrote: February 17th, 2021, 6:08 am I just want to know any possible solution exist so all my skins can synchronized with my windows color.
How those WindowsColorDark, WindowsColorBGD, WindowsColorText or WindowsColorBGL variables are defined? As far as I can tell, they don't exist anywhere in the skins of the Sonder package, or am I mistaken?
antonio0421
Posts: 24
Joined: January 6th, 2021, 7:01 am

Re: Color variable not set at startup

Post by antonio0421 »

balala wrote: February 17th, 2021, 4:29 pm How those WindowsColorDark, WindowsColorBGD, WindowsColorText or WindowsColorBGL variables are defined? As far as I can tell, they don't exist anywhere in the skins of the Sonder package, or am I mistaken?
They are from SystemColor.ini I added and modified them.
User avatar
balala
Rainmeter Sage
Posts: 12279
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Color variable not set at startup

Post by balala »

antonio0421 wrote: February 20th, 2021, 1:37 am They are from SystemColor.ini I added and modified them.
You've added, however I don't have them.
antonio0421
Posts: 24
Joined: January 6th, 2021, 7:01 am

Re: Color variable not set at startup

Post by antonio0421 »

balala wrote: February 20th, 2021, 6:40 pm You've added, however I don't have them.
They are from SystemColors.ini
From this https://forum.rainmeter.net/viewtopic.php?f=5&t=36667

Which other skins, it's worked.
User avatar
balala
Rainmeter Sage
Posts: 12279
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Color variable not set at startup

Post by balala »

antonio0421 wrote: February 21st, 2021, 11:18 am They are from SystemColors.ini
From this https://forum.rainmeter.net/viewtopic.php?f=5&t=36667
Yes, but systemColors.ini belongs to another skin, Win10 Widgets, so in my Sonder config it's not present. Did you copy it somewhere in the sonder config?