It is currently September 7th, 2024, 6:13 pm

Clock Skin Not Auto-Refreshing

Get help with creating, editing & fixing problems with skins
Cosmo74
Posts: 5
Joined: July 25th, 2024, 11:16 am

Clock Skin Not Auto-Refreshing

Post by Cosmo74 »

I've made a Clock Skin to tell me at 9 a Clock "Guten Morgen" and at 12 a Clock "Guten Tag" and at 18 a Clock "guten Abend", but it's not auto-refreshing so if I want the current value I have to manually refresh the skin. How can I make it auto-refresh?

If I shut down the computer after 6pm and turn it on the next day at 12pm, the skin shows "Guten Abend" :(

Please help. Thanks



The Code:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1


[Metadata]
Name=
Author=
Version=4.0
License=
Information=


[MeasureTime]
Measure=Time
Format=%H:%M:%S


[MeasureMorningEvening]
Measure=Time
Format=%H

IfCondition=MeasureMorningEvening < 12
IfTrueAction=[!SetOption MeterWelcome Text "Guten Morgen"]
IfFalseAction=[!Redraw]

IfCondition2=MeasureMorningEvening >= 12 
IfTrueAction2=[!SetOption MeterWelcome Text "Guten Tag"]
IfFalseAction=[!Redraw]

IfCondition3=MeasureMorningEvening >= 18
IfTrueAction3=[!SetOption MeterWelcome Text "Guten Abend"]
IfFalseAction=[!Redraw]



[MeterTime]
Meter=String
MeasureName=MeasureTime
FontColor=255,153,0
FontSize=56
;FontFace=Roboto
FontFace=Roboto
AntiAlias=1
W=310
H=85
X=136
Y=28R
StringAlign=CenterCenter
ClipString=1

[MeterWelcome]
Meter=String
MeasureName=MeasureWindowsVersion
;FontColor=255,153,0
FontColor=255,255,255
FontSize=20
AntiAlias=1
FontFace=Lato Bold
W=270
H=40
X=135
Y=105
StringAlign=CenterCenter
ClipString=1
Last edited by Cosmo74 on July 25th, 2024, 4:09 pm, edited 3 times in total.
User avatar
Yincognito
Rainmeter Sage
Posts: 8028
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Clock Skin Not Auto-Refreshing

Post by Yincognito »

Cosmo74 wrote: July 25th, 2024, 11:57 amHow can I make it auto-refresh?
You don't actually want auto-refreshing the skin itself, but to evaluate these IfConditions every time the measure updates:
https://docs.rainmeter.net/manual/measures/general-options/ifconditions/#IfConditionMode
Given that such an approach will run the corresponding conditional branches every second as per your code, you should get rid of the [!Redraw] in your IfFalseActions, or even of all IfFalseActions altogether. No point in redrawing the skin (which is normally the thing that takes the most CPU in a skin) every time those conditions are false, since eventually some IfTrueAction will be executed anyway.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Cosmo74
Posts: 5
Joined: July 25th, 2024, 11:16 am

Re: Clock Skin Not Auto-Refreshing

Post by Cosmo74 »

Hello,

I have now changed the code and it seems to work. Thanks

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1


[Metadata]
Name=
Author=
Version=4.0
License=
Information=


[MeasureTime]
Measure=Time
Format=%H:%M:%S


[MeasureMorningEvening]
Measure=Time
Format=%H

IfCondition=MeasureMorningEvening < 12 
IfTrueAction=[!SetOption MeterWelcome Text "Guten Morgen"]

IfCondition2=MeasureMorningEvening >= 12 
IfTrueAction2=[!SetOption MeterWelcome Text "Guten Tag"]

IfCondition3=MeasureMorningEvening >= 18
IfTrueAction3=[!SetOption MeterWelcome Text "Guten Abend"]
IffalseAction3=[!SetOption MeterWelcome Text "Guten Tag"]

OnUpdateAction=[!UpdateMeter MeterWelcome][!Redraw]


[MeterTime]
Meter=String
MeasureName=MeasureTime
FontColor=255,153,0
FontSize=56
;FontFace=Roboto
FontFace=Roboto
AntiAlias=1
W=310
H=85
X=136
Y=28R
StringAlign=CenterCenter
ClipString=1

[MeterWelcome]
Meter=String
MeasureName=MeasureWindowsVersion
;FontColor=255,153,0
FontColor=255,255,255
FontSize=20
AntiAlias=1
FontFace=Lato Bold
W=270
H=40
X=135
Y=105
StringAlign=CenterCenter
ClipString=1
Last edited by Yincognito on July 25th, 2024, 2:26 pm, edited 1 time in total.
Reason: To post code, select it and click the </> button above the message box.
User avatar
Yincognito
Rainmeter Sage
Posts: 8028
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Clock Skin Not Auto-Refreshing

Post by Yincognito »

Cosmo74 wrote: July 25th, 2024, 2:14 pmI have now changed the code and it seems to work. Thanks
You're welcome, glad to help. ;-)

P.S. Just so you know, you forgot to remove the IffalseAction3 line. Also, while not wrong in principle, the OnUpdateAction line is not really needed in this code: Rainmeter will update MeterWelcome and redraw the skin each second anyway, based on the Update=1000 earlier in the code. Typically, updating the relevant sections (measures and / or meters) and redrawing the skin would be needed to reflect changes immediately in the skin only if you used UpdateDivider=-1 to the said sections.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Cosmo74
Posts: 5
Joined: July 25th, 2024, 11:16 am

Re: Clock Skin Not Auto-Refreshing

Post by Cosmo74 »

Unfortunately, the skin still doesn't work properly. It is now 10:55 a.m. and the skin shows "guten Tag". But it should say "guten morgen" here.
If I refresh the skin manually then everything is fine. There must be an error here. Thanks

Code: Select all

IfCondition=MeasureMorningDayEvening < 12
IfTrueAction=[!SetOption MeterWelcome Text "Guten Morgen"]

IfCondition2=MeasureMorningDayEvening >= 12
IfTrueAction2=[!SetOption MeterWelcome Text "Guten Tag"]

IfCondition3=MeasureMorningDayEvening >= 17
IfTrueAction3=[!SetOption MeterWelcome Text "Guten Abend"]
;IffalseAction3=[!SetOption MeterWelcome Text "Guten Tag"]

OnUpdateAction=[!UpdateMeter MeterWelcome][!Redraw]
Last edited by Cosmo74 on July 27th, 2024, 10:05 am, edited 1 time in total.
User avatar
ikarus1969
Posts: 588
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Clock Skin Not Auto-Refreshing

Post by ikarus1969 »

First a warm welcome to the rainmeter-community!
Then, please would you embed code you are posting in code-tags? You can do that by first mark your code and then click on the small button above; it's the one with </> on it.
ssrm.jpg
Regarding your skin: i took the skin from your first post and adapt it to use the lines from your latest post and it works. For future posts: please post your whole skin - that's better for us to reproduce an error-situation.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1


[Metadata]
Name=
Author=
Version=4.0
License=
Information=


[MeasureTime]
Measure=Time
Format=%H:%M:%S


[MeasureMorningDayEvening]
Measure=Time
Format=%H

IfCondition=MeasureMorningDayEvening < 12
IfTrueAction=[!SetOption MeterWelcome Text "Guten Morgen"]

IfCondition2=MeasureMorningDayEvening >= 12
IfTrueAction2=[!SetOption MeterWelcome Text "Guten Tag"]

IfCondition3=MeasureMorningDayEvening >= 17
IfTrueAction3=[!SetOption MeterWelcome Text "Guten Abend"]
;IffalseAction3=[!SetOption MeterWelcome Text "Guten Tag"]

; OnUpdateAction=[!UpdateMeter MeterWelcome][!Redraw]

[MeterTime]
Meter=String
MeasureName=MeasureTime
FontColor=255,153,0
FontSize=56
;FontFace=Roboto
FontFace=Roboto
AntiAlias=1
W=310
H=85
X=136
Y=28R
StringAlign=CenterCenter
ClipString=1

[MeterWelcome]
Meter=String
MeasureName=MeasureWindowsVersion
;FontColor=255,153,0
FontColor=255,255,255
FontSize=20
AntiAlias=1
FontFace=Lato Bold
W=270
H=40
X=135
Y=105
StringAlign=CenterCenter
ClipString=1
You do not have the required permissions to view the files attached to this post.
Cosmo74
Posts: 5
Joined: July 25th, 2024, 11:16 am

Re: Clock Skin Not Auto-Refreshing

Post by Cosmo74 »

Thank you very much for the information. Unfortunately the skin doesn't work properly. When I shut down the PC at 10:24 p.m. it says "Guten Abend". When I turn it back on at 12:24 p.m. it still says "Guten Abend" but it should say "Guten Tag".


Image
User avatar
Yincognito
Rainmeter Sage
Posts: 8028
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Clock Skin Not Auto-Refreshing

Post by Yincognito »

Cosmo74 wrote: July 27th, 2024, 10:41 am Unfortunately the skin doesn't work properly.
Like already mentioned, it's because you didn't add the:
Yincognito wrote: July 25th, 2024, 1:06 pm You don't actually want auto-refreshing the skin itself, but to evaluate these IfConditions every time the measure updates:
https://docs.rainmeter.net/manual/measures/general-options/ifconditions/#IfConditionMode
option to the MeasureMorningDayEvening measure from your code, as advised earlier. Again, there is no need for the OnUpdateAction line in your current code.

As a side note, we don't post links from the manual for nothing. If you don't check them or at least follow an advice asked by you in the first place, then reaching a solution to the problem is difficult. :confused:

Mea culpa as well, since I failed to notice that you didn't add the linked option in your 2nd reply. :oops:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
ikarus1969
Posts: 588
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Clock Skin Not Auto-Refreshing

Post by ikarus1969 »

i suppose that when you write "shutdown" it's not a real shutdown but your computer is just in sleep mode and rainmeter keeps running in the background.
When you wake him up the condtion IfCondtion2 has not changed (the hour is still greater than 12) so the corresponding action is not triggered. The same for IfCondition3 and its action.

For this case i recommend you try OnWakeAction=[!Refresh] and place that line in the rainmeter-section of your skin. It should make a refresh when your computer wakes up from "sleeping".

Could you try that please?

OnWakeAction: https://docs.rainmeter.net/manual/skins/rainmeter-section/#OnWakeAction
User avatar
Yincognito
Rainmeter Sage
Posts: 8028
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Clock Skin Not Auto-Refreshing

Post by Yincognito »

Ikarus1969 raised an interesting possibility so you can check if that's the case too, but to give a "face" to my explanation earlier, here's the code I tested ever since mentioning the IfConditionMode in this thread (I got rid of all the comments, to make the code cleaner):

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[MeasureTime]
Measure=Time
Format=%H:%M:%S

[MeasureMorningEvening]
Measure=Time
Format=%H
IfCondition=MeasureMorningEvening < 12
IfTrueAction=[!SetOption MeterWelcome Text "Guten Morgen"]
IfCondition2=MeasureMorningEvening >= 12 
IfTrueAction2=[!SetOption MeterWelcome Text "Guten Tag"]
IfCondition3=MeasureMorningEvening >= 18
IfTrueAction3=[!SetOption MeterWelcome Text "Guten Abend"]
IfConditionMode=1

[MeterTime]
Meter=String
MeasureName=MeasureTime
FontColor=255,153,0
FontSize=56
FontFace=Roboto
AntiAlias=1
W=310
H=85
X=136
Y=28R
StringAlign=CenterCenter
ClipString=1

[MeterWelcome]
Meter=String
MeasureName=MeasureWindowsVersion
FontColor=255,255,255
FontSize=20
AntiAlias=1
FontFace=Lato Bold
W=270
H=40
X=135
Y=105
StringAlign=CenterCenter
ClipString=1
You don't even need to wait a whole day to test if it works, just change the time or the hour from Control Panel > Date And Time and see what message is displayed by the skin. After you're done with the testing, you can easily synchronize with an online atomic clock (don't know about Win 11, but it works for me on Win 10):
TimeSync.jpg


Alternatively, if for some reason you don't want to use IfConditionMode=1 in that measure, you could write those conditions in a more precise way that prevents them from "overlapping" each other, e.g.:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[MeasureTime]
Measure=Time
Format=%H:%M:%S

[MeasureMorningEvening]
Measure=Time
Format=%H
IfCondition=(MeasureMorningEvening >= 0) && (MeasureMorningEvening < 12)
IfTrueAction=[!SetOption MeterWelcome Text "Guten Morgen"]
IfCondition2=(MeasureMorningEvening >= 12) && (MeasureMorningEvening < 18)
IfTrueAction2=[!SetOption MeterWelcome Text "Guten Tag"]
IfCondition3=(MeasureMorningEvening >= 18) && (MeasureMorningEvening <= 23)
IfTrueAction3=[!SetOption MeterWelcome Text "Guten Abend"]

[MeterTime]
Meter=String
MeasureName=MeasureTime
FontColor=255,153,0
FontSize=56
FontFace=Roboto
AntiAlias=1
W=310
H=85
X=136
Y=28R
StringAlign=CenterCenter
ClipString=1

[MeterWelcome]
Meter=String
MeasureName=MeasureWindowsVersion
FontColor=255,255,255
FontSize=20
AntiAlias=1
FontFace=Lato Bold
W=270
H=40
X=135
Y=105
StringAlign=CenterCenter
ClipString=1
The above will use the && aka the logical AND operator to set the Text in MeterWelcome only / strictly if the hour belongs to the corresponding interval. In your original code, if the hour was, for example, 19, then it matched both IfCondition2 and IfCondition3 - which is what I meant by "overlapping" and which represented the root cause of your incorrect message in the skin, given the way how IfCondition works by default when IfConditionMode=1 is not present.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth