I've created some groups of meters and named them Core1, Core2 and so on, up to Core8.
(Eg, [Core1UsageText], [CPUCore1BarGraphUsage] and [CPU1UsagePercent] belong to Core1 group, [Core2UsageText], [CPUCore2BarGraphUsage] and [CPU2UsagePercent] to Core2 and so on). Now it's much easier to show or hide these meters, because we can do this by groups.
I also made a few more small changes. The new code uses the same background and resizes it accordingly to the number of cores.
Code: Select all
;READ THE [Variables] SECTION BELOW FOR SETUP INFORMATION
[Rainmeter]
AppVersion=v1.1
Update=1000
Background=#@#Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,15
[Variables]
;CPU Name or Title for widget/gadget
CPUName=cpu-ram
FontFace=Trebuchet MS
textSize=8
colorBar=255,140,0,200
colorText=255,255,255,205
barHeight=1
barWidth=90
;=========================
;CPU AND RAM INFO
;=========================
[styleTitle]
StringAlign=CENTER
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#FontFace#
FontSize=10
AntiAlias=1
ClipString=1
[meterTitle]
Meter=STRING
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=100
Y=12
W=190
H=18
Text="#CPUNAME#"
;___________________________________________________________________CPU TEMP
[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=WMIC CPU Get NumberOfLogicalProcessors
State=Hide
OutputType=ANSI
RegExpSubstitute=1
Substitute="\n":"","NumberOfLogicalProcessors":""
IfCondition=([#CURRENTSECTION#]=1)
IfTrueAction=[!ShowMeterGroup "Core1"][!HideMeterGroup "Core2"][!HideMeterGroup "Core3"][!HideMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition2=([#CURRENTSECTION#]=2)
IfTrueAction2=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!HideMeterGroup "Core3"][!HideMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition3=([#CURRENTSECTION#]=4)
IfTrueAction3=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!HideMeterGroup "Core5"][!HideMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition4=([#CURRENTSECTION#]=6)
IfTrueAction4=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!ShowMeterGroup "Core5"][!ShowMeterGroup "Core6"][!HideMeterGroup "Core7"][!HideMeterGroup "Core8"]
IfCondition5=([#CURRENTSECTION#]=8)
IfTrueAction5=[!ShowMeterGroup "Core1"][!ShowMeterGroup "Core2"][!ShowMeterGroup "Core3"][!ShowMeterGroup "Core4"][!ShowMeterGroup "Core5"][!ShowMeterGroup "Core6"][!ShowMeterGroup "Core7"][!ShowMeterGroup "Core8"]
DynamicVariables=1
[CPUTotalTemp]
Meter=STRING
x=100
Y=40
W=1
H=1
MeasureName=MCPUTemp
Text="%1°C"
FontColor=[MCPUTempCalc]
StringStyle=BOLD
FontSize=8
NumofDecimals=0
FontFace=#FontFace#
StringAlign=CENTER
AntiAlias=1
DynamicVariables=1
[MCPUTemp]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\FinalWire\AIDA64\SensorValues
RegValue=Value.TCPU
[MCPUTempCalc]
Measure=Calc
Formula=MCPUTemp< 25 ? -1 : (MCPUTemp < 40 ? -2 : (MCPUTemp < 50 ? -3 : (MCPUTemp < 60 ? -4 : -5)))
Substitute="-1":"255,255,255","-2":"255,255,102","-3":"255,153,51","-4":"255,0,0","-5":"204,0,0"
;___________________________________________________________________CPU USAGE
[TotalCPUUsageText]
Meter=STRING
X=10
Y=40
Text="Total:"
StringStyle=NORMAL
FontColor=255, 255, 255, 255
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
[CPUTotalBarGraphUsage]
Meter=BAR
MeasureName=MCLOADTOTAL
X=10
Y=52
W=190
H=#barHeight#
BarColor=[CPUBARWARNT]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
[TotalCPUUsagePercent]
Meter=String
MeasureName=CPUPERCENTCALC
X=200
Y=40
FontColor=255, 255, 255
StringStyle=NORMAL
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
;[CPU CORE 1 INFO]
[Core1UsageText]
Meter=STRING
X=15
Y=57
Text="Core1:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core1
[CPUCore1BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE1
X=50
Y=64
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN1]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core1
[CPU1UsagePercent]
Meter=String
MeasureName=CPU1PercentCalc
X=200
Y=52
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core1
;[CPU CORE 2 INFO]
[Core2UsageText]
Meter=STRING
X=15
Y=([Core1UsageText:Y]+12)
Text="Core2:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core2
[CPUCore2BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE2
X=50
Y=([CPUCore1BarGraphUsage:Y]+12)
W=150
w=#barWidth#
h=#barHeight#
BarColor=[CPUBARWARN2]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core2
[CPU2UsagePercent]
Meter=String
MeasureName=CPU2PERCENTCALC
X=200
Y=([CPU1UsagePercent:Y] + 12)
FontColor=255, 255, 255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core2
;[CPU CORE 3 INFO]
[Core3UsageText]
Meter=STRING
X=15
Y=([Core2UsageText:Y]+12)
Text="Core3:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core3
[CPUCore3BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE3
X=50
Y=([CPUCore2BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN3]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core3
[CPU3UsagePercent]
Meter=String
MeasureName=CPU3PercentCalc
X=200
Y=([CPU2UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core3
;[CPU CORE 4 INFO]
[Core4UsageText]
Meter=STRING
X=15
Y=([Core3UsageText:Y]+12)
Text="Core4:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core4
[CPUCore4BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE4
X=50
Y=([CPUCore3BarGraphUsage:Y]+12)
W=150
w=#barWidth#
h=#barHeight#
BarColor=[CPUBARWARN4]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core4
[CPU4UsagePercent]
Meter=String
MeasureName=CPU4PERCENTCALC
X=200
Y=([CPU3UsagePercent:Y] + 12)
FontColor=255, 255, 255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core4
;[CPU CORE 5 INFO]
[Core5UsageText]
Meter=STRING
X=15
Y=([Core4UsageText:Y]+12)
Text="Core5:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core5
[CPUCore5BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE5
X=50
Y=([CPUCore4BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN5]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core5
[CPU5UsagePercent]
Meter=String
MeasureName=CPU5PercentCalc
X=200
Y=([CPU4UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core5
;[CPU CORE 6 INFO]
[Core6UsageText]
Meter=STRING
X=15
Y=([Core5UsageText:Y]+12)
Text="Core6:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core6
[CPUCore6BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE6
X=50
Y=([CPUCore5BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN6]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core6
[CPU6UsagePercent]
Meter=String
MeasureName=CPU6PercentCalc
X=200
Y=([CPU5UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core6
;[CPU CORE 7 INFO]
[Core7UsageText]
Meter=STRING
X=15
Y=([Core6UsageText:Y]+12)
Text="Core7:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core7
[CPUCore7BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE7
X=50
Y=([CPUCore6BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN7]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core7
[CPU7UsagePercent]
Meter=String
MeasureName=CPU7PercentCalc
X=200
Y=([CPU6UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core7
;[CPU CORE 8 INFO]
[Core8UsageText]
Meter=STRING
X=15
Y=([Core7UsageText:Y]+12)
Text="Core8:"
StringStyle=NORMAL
FontColor=255, 255, 255,100
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Group=Core8
[CPUCore8BarGraphUsage]
Meter=BAR
MeasureName=MCLOADCORE8
X=50
Y=([CPUCore7BarGraphUsage:Y]+12)
W=150
w=#barWidth#
H=#barHeight#
BarColor=[CPUBARWARN8]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
Autoscale=1
Group=Core8
[CPU8UsagePercent]
Meter=String
MeasureName=CPU8PercentCalc
X=200
Y=([CPU7UsagePercent:Y]+12)
FontColor=255,255,255,100
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
StringStyle=NORMAL
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Group=Core8
;Total CPU Usage Measures
[MCLOADTOTAL]
Measure=CPU
Processor=0
[CPUPERCENTCALC]
Measure=Calc
Formula=MCLOADTOTAL * 1
;Individual Core Measures
[MCLOADCORE1]
Measure=CPU
Processor=1
[CPU1PercentCalc]
Measure=Calc
Formula=MCLOADCORE1 * 1
[MCLOADCORE2]
Measure=CPU
Processor=2
[CPU2PercentCalc]
Measure=Calc
Formula=MCLOADCORE2 * 1
[MCLOADCORE3]
Measure=CPU
Processor=3
[CPU3PercentCalc]
Measure=Calc
Formula=MCLOADCORE3 * 1
[MCLOADCORE4]
Measure=CPU
Processor=4
[CPU4PercentCalc]
Measure=Calc
Formula=MCLOADCORE4 * 1
[MCLOADCORE5]
Measure=CPU
Processor=5
[CPU5PercentCalc]
Measure=Calc
Formula=MCLOADCORE5 * 1
[MCLOADCORE6]
Measure=CPU
Processor=6
[CPU6PercentCalc]
Measure=Calc
Formula=MCLOADCORE6 * 1
[MCLOADCORE7]
Measure=CPU
Processor=7
[CPU7PercentCalc]
Measure=Calc
Formula=MCLOADCORE7 * 1
[MCLOADCORE8]
Measure=CPU
Processor=8
[CPU8PercentCalc]
Measure=Calc
Formula=MCLOADCORE8 * 1
;_________________CPU USAGE BAR WARN
[CPUBARWARNT]
Measure=Calc
Formula=CPUPERCENTCALC> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"
[CPUBARWARN1]
Measure=Calc
Formula=CPU1PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"
[CPUBARWARN2]
Measure=Calc
Formula=CPU2PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"
[CPUBARWARN3]
Measure=Calc
Formula=CPU3PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"
[CPUBARWARN4]
Measure=Calc
Formula=CPU4PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"
[CPUBARWARN5]
Measure=Calc
Formula=CPU5PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"
[CPUBARWARN6]
Measure=Calc
Formula=CPU6PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"
[CPUBARWARN7]
Measure=Calc
Formula=CPU7PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"
[CPUBARWARN8]
Measure=Calc
Formula=CPU8PercentCalc> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"
;___________________________________________________________________CPU CLOCK
[MCLOCK]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\FinalWire\AIDA64\SensorValues
RegValue=Value.SCPUCLK
[MeasureNumCores]
Measure=Calc
Formula=[MeasureRun]
IfCondition=(#CURRENTSECTION#=1)
IfTrueAction=[!SetOption MeterMHz Y "([Core1UsageText:Y]+18)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition2=(#CURRENTSECTION#=2)
IfTrueAction2=[!SetOption MeterMHz Y "([Core2UsageText:Y]+18)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition3=(#CURRENTSECTION#=4)
IfTrueAction3=[!SetOption MeterMHz Y "([Core4UsageText:Y]+18)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition4=(#CURRENTSECTION#=6)
IfTrueAction4=[!SetOption MeterMHz Y "([Core6UsageText:Y]+18)"][!UpdateMeter "MeterMHz"][!Redraw]
IfCondition5=(#CURRENTSECTION#=8)
IfTrueAction5=[!SetOption MeterMHz Y "([Core8UsageText:Y]+18)"][!UpdateMeter "MeterMHz"][!Redraw]
DynamicVariables=1
[MeterMHz]
Meter=STRING
MeasureName=MCLOCK
X=10
;Y=([Core8UsageText:Y])+14
FontColor=255,255,255,170
FontSize=8
StringStyle=NORMAL
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
Text="CLOCK: %1 MHz"
;___________________________________________________________________CPU FAN RPM
[CPUFanText]
Meter=STRING
MeasureName=cpufan0
X=200
Y=r
Text="FAN: %1rpm"
StringStyle=NORMAL
FontColor=255, 255, 255,170
FontSize=8
StringAlign=RIGHT
FontFace=#FontFace#
AntiAlias=1
[CPUFAN0]
Measure=Registry
RegHKey=HKEY_CURRENT_USER
RegKey=Software\FinalWire\AIDA64\SensorValues
RegValue=Value.FCPU
;____________________________________________________________________RAM
[MeasureRAMTotal]
Measure=PhysicalMemory
Total=1
UpdateDivider=600
[MeasureRAMUsed]
Measure=PhysicalMemory
UpdateDivider=2
[MeasureRAMFree]
Measure=PhysicalMemory
InvertMeasure=1
[RAMUsageLabel]
Meter=String
x=10
y=20r
Text="RAM:"
StringStyle=NORMAL
FontColor=255, 255, 255, 255
FontSize=8
StringAlign=LEFT
FontFace=#FontFace#
AntiAlias=1
[RAMUsage]
Meter=BAR
MeasureName=MeasureRAMUsed
X=10
Y=-1R
W=190
w=#barWidth#
H=#barHeight#
BarColor=[RAMWarn]
SolidColor=105,105,105,150
BarOrientation=HORIZONTAL
DynamicVariables=1
[RAMUsedGB]
Meter=STRING
StringStyle=Normal
X=95
Y=[RAMUsageLabel:y]
W=1
H=1
MeasureName=MeasureRAMTotal
MeasureName2=MeasureRAMUsed
MeasureName3=MeasureRAMFree
Text="%2B/%1B"
FontColor=255, 255, 255, 100
FontSize=8
StringAlign=Center
NumofDecimals=1
FontFace=#FontFace#
AntiAlias=1
Autoscale=1
UpdateDivider=2
DynamicVariables=1
[RAMUsagePercent]
Meter=STRING
MeasureName=MeasureRAMUsed
X=200
Y=r
W=145
H=14
StringAlign=RIGHT
FontFace=#FontFace#
FontColor=#colorText#
FontSize=8
StringStyle=BOLD
AntiAlias=1
NumofDecimals=1
Text="[%1%]"
Percentual=1
UpdateDivider=2
;____________________________________________________________________RAM Warning
[measureRAMGBCalc]
Measure=Calc
Formula=MeasureRAMUsed * 100 / MeasureRAMTotal
[measureRAMGBCalc2]
Measure=Calc
Formula=measureRAMGBCalc
MinValue=0
MaxValue=100
Percentual=1
[RAMWarn]
Measure=Calc
Formula=measureRAMGBCalc2> 75 ? -1 : -2
Substitute="-1":"220,20,60,200","-2":"#colorBar#"
option to the [RAMUsedGB] meter. This meter uses a section variable (in its Y option) and because the option is missing, the meter is not placed properly. I fixed this issue.
Please check the above code and let me know what you think about it.