Page 1 of 1

InlineSetting for Digital Clock

Posted: April 20th, 2017, 3:32 pm
by Vetsus
what i'm trying to do is have the time set for ##:####

this format would end up as HH:MMSS

what i want is for just the seconds to be a different size, but either i don't understand the docs enough or i'm missing something. i cannot get just the seconds to be a different pattern. in my case i'm trying to make the seconds smaller here:

Code: Select all

[Digital_Time]
Meter=String
MeasureName=MeasureHour
MeasureName2=MeasureMinute
MeasureName3=MeasureSecond
X=(#Scale# * 100)
Y=(#Scale# * 100)
StringAlign=CenterCenter
StringStyle=Bold
StringEffect=Border
FontFace=Arial
FontSize=(#Scale# * 36)
FontColor=#FontColor#,255
FontEffectColor=#FontEffectColor#,255
Text=%1:%2%3
InlineSetting=Size | (#Scale# * 18)
InlinePattern=^(:[/d]{2})
;Hidden=1

Re: InlineSetting for Digital Clock

Posted: April 20th, 2017, 4:16 pm
by balala
Vetsus wrote:what i'm trying to do is have the time set for ##:####

this format would end up as HH:MMSS

what i want is for just the seconds to be a different size, but either i don't understand the docs enough or i'm missing something. i cannot get just the seconds to be a different pattern. in my case i'm trying to make the seconds smaller here:
Try the following options:

Code: Select all

InlineSetting=Size | (#Scale# * 18)
InlinePattern=^\d{1,2}:\d{2}(\d{2})$
The InlinePattern is constructed in the following form: the ^ and $ characters mean the beginning respectively the end of the expression. Between these two, we have three group of digits: the first one has one or two digits (\d{1,2}) and is followed by a colon (:). Then comes two groups of two digits each (\d{2}). From these last two groups, the second one is captured, because it is included into parenthesis. The setting given into the InlineSetting option is applied to this last captured group.

Re: InlineSetting for Digital Clock

Posted: April 20th, 2017, 4:21 pm
by FreeRaider
Try this code

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
Scale=2.0

[MeasureHour]
Measure=Time
Format=%H

[MeasureMinute]
Measure=Time
Format=%M

[MeasureSecond]
Measure=Time
Format=%S

[Digital_Time]
Meter=String
MeasureName=MeasureHour
MeasureName2=MeasureMinute
MeasureName3=MeasureSecond
X=(#Scale# * 100)
Y=(#Scale# * 100)
StringAlign=CenterCenter
StringStyle=Bold
StringEffect=Border
FontFace=Arial
FontSize=(#Scale# * 36)
FontColor=#FontColor#,255
FontEffectColor=#FontEffectColor#,255
Text=%1:%2%3
InlineSetting=Size | (#Scale# * 18)
InlinePattern=^.*:\d+(\d{2})$
;Hidden=1

Edit: balala beat me

Re: InlineSetting for Digital Clock

Posted: April 20th, 2017, 4:30 pm
by Vetsus
worked perfectly! thank you very much!

Re: InlineSetting for Digital Clock

Posted: April 20th, 2017, 4:36 pm
by balala
FreeRaider wrote:Edit: balala beat me
Don't worry, it was just a matter of minutes.