First of all I am a Non-Coder and new to Rainmeter-Scripting. I was working on a "simple" Meter that can read a Disk's capacity to get an understanding of how things work. The 'DiskMeter' itself is reading the Drive in two ways: "[MeasureDrive]" (White-Bar) and "[MeasureDriveInvert]" (Gray-Bar) by design/as intended to get me two status bars + a "%" to show of what is left of Disk-Space. So far the "DIskMeter" works just fine.
Problem Now:
I want to have my gray "[DriveMeterBarInvert]" -that is linked to "[MeasureDriveInvert]"- to change its color only to RED whenever the Disk's is reaching 10% left of free Disk-Space (Threshold). In theory all I have to do is to place the "IfTrue" information in the "[DriveMeterBarInvert]" - "BarColor=" section, but in reality with no success.
While searching for solutions I found two threads in here and tried both of those (Option A) and (Option B) which can be found inside the attached Script. Unfortunately I can't wrap my brain around it, even if both ways seems logical to me, so I will post my .ini file here in hope someone can help me out.
"Thank you" to anyone who can point me to the correct solution.
Code: Select all
[Rainmeter]
Update=1000
MiddleMouseUpAction=!Refresh
BackgroundMode=1
SolidColor=0,0,0,1
[Meta]
Changes Color whenever the Threshold of 10% left is reached.
[Variables]
FONT=Calibri 65
COLOR=255,255,255
COLORDIAG=255,255,255,190
COLORS=255,255,255,170
COLORBACK=255,255,255,95
COLORGRAPH=255,255,255,70
COLORRED=255,110,110,95
[StyleLeft]
FontFace=#FONT#
StringStyle=NORMAL
FontColor=#COLOR#
StringAlign=Left
AntiAlias=1
FontSize=8
SolidColor=0,0,0,1
[StyleCenter]
FontFace=#FONT#
StringStyle=Normal
FontColor=#COLOR#
StringAlign=Center
AntiAlias=1
FontSize=8
SolidColor=0,0,0,1
;----------MEASURES----------
[MeasureDrive]
Measure=FreeDiskSpace
Drive=C:
[MeasureDriveInvert]
Measure=FreeDiskSpace
Drive=C:
InvertMeasure=1
========== Meter Flex-Bar =====
[DriveMeterBar]
MeasureName=MeasureDriveInvert
Meter=BAR
X=37
Y=14
W=100
H=15
BarOrientation=HORIZONTAL
BarColor=#COLORS#
[DriveMeterBarInvert]
MeasureName=MeasureDrive
Meter=BAR
X=37
Y=19
W=100
H=5
BarOrientation=HORIZONTAL
Flip=1
BarColor=#COLORBACK#
;==== MeasureColorBar
; OPTION A:
;[MeasureColorBar]
;Measure=Calc
;Formula=( MeasureDrive / MeasureDriveInvert )
;IfCondition=(MesureDrive>0.1) ;<< If 10% is left Change color to 255,110,110,95 aka. COLORRED
;IfTrueAction=[!SetOption DriveMeterBarInvert BarColor "255,110,110,95"][!UpdateMeter "DriveMeterBarInvert"][!Redraw]
;IfFalseAction=[!SetOption DriveMeterBarInvert BarColor "255,255,255,95"][!UpdateMeter "DriveMeterBarInvert"][!Redraw]
;OPTION B:
;[MeasureColorBar]
;Measure=Calc
;Formula=( MeasureDrive )
;IfCondition=(DriveMeterBar>0.1)
;IfTrueAction=[!SetOption MeterBarInvert BarColor 255,110,110,95][!Redraw]
;IfCondition=(DriveMeterBar<0.1)
;IfTrueAction=[!SetOption MeterBarInvert BarColor 255,255,255,95][!Redraw]
;=====[MeterBarInvert] >> Exchange "MeasureName=DriveMeterBarInvert in [DriveMeterBarInvert]+ Delete Rest
;[MeterBarInvert]
;MeasureName=MeasureDrive
;Meter=BAR
;X=37
;Y=19
;W=100
;H=5
;BarOrientation=HORIZONTAL
;Flip=1
;BarColor=#MeasureColorBar#
;--------[HDD Elements]---------
[MeterDriveBlock]
Meter=Image
x=138
y=19
w=3
h=5
SolidColor=#COLORS#
[MeterHDDPercent]
Meter=STRING
MeasureName=MeasureDrive
MeterStyle=StyleLeft
X=145
Y=12
Postfix=%
Text="%1"
Percentual=1
AutoScale=1
[MeterHDDLabel]
Meter=STRING
MeterStyle=StyleCenter
X=100
Y=3
Text="[ C ]"
LeftMouseUpAction=["C:"]