It is currently March 28th, 2024, 4:21 pm

InlineSetting for Digital Clock

General topics related to Rainmeter.
Post Reply
Vetsus
Posts: 27
Joined: March 7th, 2017, 5:29 pm

InlineSetting for Digital Clock

Post 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
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: InlineSetting for Digital Clock

Post 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.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: InlineSetting for Digital Clock

Post 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
Vetsus
Posts: 27
Joined: March 7th, 2017, 5:29 pm

Re: InlineSetting for Digital Clock

Post by Vetsus »

worked perfectly! thank you very much!
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: InlineSetting for Digital Clock

Post by balala »

FreeRaider wrote:Edit: balala beat me
Don't worry, it was just a matter of minutes.
Post Reply