It is currently September 30th, 2024, 1:29 am

Does !RainmeterSetVariable doesn't set PrimaryColor of Histo

General topics related to Rainmeter.
LeftSide
Posts: 35
Joined: July 3rd, 2012, 6:16 pm

Does !RainmeterSetVariable doesn't set PrimaryColor of Histo

Post by LeftSide »

Code: Select all

[Variables]
PrimaryColorCpu1=0,0,0,0
PrimaryColorCpu1_Low=0,0,0,0
PrimaryColorCpu1_High=0,0,0,255

[MeasureCPUFast]
Measure=CPU
IfAboveValue=75
IfAboveAction=!RainmeterSetVariable PrimaryColorCpu1 PrimaryColorCpu1_High
IfBelowValue=75
fBelowAction=!RainmeterSetVariable PrimaryColorCpu1 PrimaryColorCpu1_Low

[CPUGraphFast]
Meter=HISTOGRAM
MeasureName=MeasureCPUFast
PrimaryColor=#PrimaryColorCpu1#

This doesn't work... the color of the graph doesn't change. But it works with a string.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Does !RainmeterSetVariable doesn't set PrimaryColor of H

Post by Kaelri »

You need to set DynamicVariables=1 on [CPUGraphFast] to make it react when the variable changes.

Alternatively, if this is the only meter that is affected, you could use the !SetOption bang to change the PrimaryColor option directly. This does not require dynamic variables.

Code: Select all

[MeasureCPUFast]
Measure=CPU
IfAboveValue=75
IfAboveAction=!SetOption CPUGraphFast PrimaryColor "0,0,0,255"
IfBelowValue=75
fBelowAction=!SetOption CPUGraphFast PrimaryColor "0,0,0,0"

[CPUGraphFast]
Meter=HISTOGRAM
MeasureName=MeasureCPUFast
See more about:
- Bangs
- Dynamic Variables