It is currently April 20th, 2024, 3:18 pm

exclude rainmeter process from readings

Get help with creating, editing & fixing problems with skins
condition
Posts: 4
Joined: September 18th, 2019, 8:00 am

exclude rainmeter process from readings

Post by condition »

Hello,

My main use of rainmeter is to display top cpu usage process with percentage. I am newbie in rainmeter language but I have concluded to a final script that suits me. My problem is that I cannot exclude the rainmeter process from the cpu readings. I have used the lines in my code but they definitely not working

Code: Select all

GlobalIgnoredProcesses=Idle|%Total|rundll32|wscript|userinit
SpecificIgnoredProcesses=Rainmeter|svchost*
My code is as follows:

Code: Select all

[Rainmeter]
Update=1000
MiddleMouseUpAction=[!Refresh]
DynamicWindowSize=1
AccurateText=1

[Variables]
TextName=Tahoma
TextColor=255,255,255,255
TextColorShadow=0,0,0,255
BGColor=0,0,0,1

TextSize=12

TextScale=1.65

;Increase this number to increase the number of decimals
;in the display of each processes usage. Valid ranges are 
;0 and above. No negative numbers.
DecimalAccuracy=2

;The Buffer is the number of pixels worth of padding
;to be added around all sides of each line of text.
;A larger Buffer will mean more spacing between lines
;of text.
Buffer=4

;===  Styles  ===;

[sProcess]
X=r
Y=R
H=(#TextSize# * #TextScale#)
Padding=#Buffer#,#Buffer#,#Buffer#,#Buffer#
StringEffect=Shadow
StringAlign=LeftCenter
StringCase=Proper
FontSize=#TextSize#
FontFace=#TextName#
FontColor=#TextColor#
FontEffectColor=#TextColorShadow#
SolidColor=#BGColor#
NumOfDecimals=#DecimalAccuracy#
AntiAlias=1


;===  Measure Max CPU  ===;

[mGetMaxCPU]
Measure=Plugin
Plugin=AdvancedCPU
;This grabs the total CPU usage (100%) for use late

;===  Measure Top Process 1  ===;

[mGetTopName_1]
Measure=Plugin
Plugin=AdvancedCPU
CPUExclude=Idle
TopProcess=2

[mGetTopPerc_1]
Measure=Plugin
Plugin=AdvancedCPU
TopProcess=1
CPUExclude=Idle
IfCondition=(#CURRENTSECTION# = 0)
IfTrueAction=[!HideMeter "TopProc_1"][!UpdateMeter "TopProc_1"][!Redraw]
IfFalseAction=[!ShowMeter "TopProc_1"][!UpdateMeter "TopProc_1"][!Redraw]

[mCalcTopPerc_1]
Measure=Calc
Formula=Round((([mGetTopPerc_1] / [mGetMaxCPU]) * 100),#DecimalAccuracy#)
DynamicVariables=1
;Divides current process usage by max CPU usage, scales it by 100 and
;rounds it to the nearest decimal place as determine by the Decimal
;Accuracy variable where a higher number = more decimals.


;===  Display Top Process 1  ===;

[TopProc_1]
Meter=String
MeterStyle=sProcess
MeasureName=mGetTopName_1
MeasureName2=mCalcTopPerc_1
X=0
Y=((#TextSize# * 0.5) + #Buffer#)
Text="%1 (%2%)"
So I need help to exclude above processes from the script.

Also please confirm that on WIN10 x64, its normal for the rainmeter to constantly use 1-2% of CPU

Thanks
User avatar
Mordasius
Posts: 1171
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: exclude rainmeter process from readings

Post by Mordasius »

Please note that the AdvancedCPU plugin has been deprecated, and should not be used in new skins.

Better to use the UsageMonitor plugin which will work like this.

Code: Select all

[Rainmeter]
Update=1000
MiddleMouseUpAction=[!Refresh]
DynamicWindowSize=1
AccurateText=1

[Variables]
TextName=Tahoma
TextColor=255,255,255,255
TextColorShadow=0,0,0,255
BGColor=0,0,0,1

TextSize=12
TextScale=1.65
DecimalAccuracy=2
Buffer=4

;===  Styles  ===;

[sProcess]
X=r
Y=R
H=(#TextSize# * #TextScale#)
Padding=#Buffer#,#Buffer#,#Buffer#,#Buffer#
StringEffect=Shadow
StringAlign=LeftCenter
StringCase=Proper
FontSize=#TextSize#
FontFace=#TextName#
FontColor=#TextColor#
FontEffectColor=#TextColorShadow#
SolidColor=#BGColor#
NumOfDecimals=#DecimalAccuracy#
AntiAlias=1

;---   [   measures   ]   ---
[CPU1]
Measure=Plugin
Plugin=UsageMonitor
Blacklist=_Total|Idle|Rainmeter
Alias=CPU
Index=1
IfCondition=CPU1>0.01
IfTrueAction=[!Showmeter TopCPU1] 
IfFalseAction=[!Hidemeter TopCPU1] 

;===  Display Top Process 1  ===;

[TopCPU1]
Meter=String
MeterStyle=sProcess
MeasureName=CPU1
X=0
Y=((#TextSize# * 0.5) + #Buffer#)
Text=%1 [CPU1:1]%
DynamicVariables=1  
Also please confirm that on WIN10 x64, its normal for the rainmeter to constantly use 1-2% of CPU
How much CPU Rainmeter uses depends on what skins are loaded. You'll hardly notice a simple little skin like this but if you use some fancy Spectrum Analyzer with Update=32 you can expect to use 30% or maybe even more depending on your processor.
Last edited by Mordasius on September 18th, 2019, 9:18 am, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16150
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: exclude rainmeter process from readings

Post by balala »

EDIT: Sorry Mordasius, you beat me...

I recommend not to use the AdvancedCPU plugin, because it is deprecated. Instead use the newer UsageMonitor plugin. It's much more versatile.
However if you still want to try the AdvancedCPU plugin, add Rainmeter to the CPUExclude option, as it follows: CPUExclude=Idle;Rainmeter.
condition
Posts: 4
Joined: September 18th, 2019, 8:00 am

Re: exclude rainmeter process from readings

Post by condition »

Mordasius, thanks that was what I was looking for, and with minimal cpu usage, less than 0.5%
Will study your code...
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: exclude rainmeter process from readings

Post by jsmorley »

How much CPU Rainmeter itself uses will vary a huge amount, depending on two things. How powerful your CPU is to start with, and how many and what kind of skins you have loaded and running.

I have a decently hefty PC, with an 8-core / 16-thread AMD Ryzen 2700X CPU, and a pretty recent nVIDIA 1660 ti GPU sharing the load, and even with 20+ skins running, Rainmeter uses about 0.1%-0.2% of total CPU. Pretty much nothing really. When I had an older machine with an older AMD CPU, it used to take 2.0%-4.0% with pretty much the same skins. Still not much, but the faster CPU and some offloading of cycles to a decent GPU via hardware acceleration certainly makes a difference.

One thing I don't do is use any "music visualizer" skins, which by their nature use a lot of CPU.

So it's hard to quantify. Your mileage will vary...

Code: Select all

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

[Metadata]
Name=RainmeterProcess
Author=JSMorley
Information=Shows some process information for Rainmeter, using the new UsageMonitor plugin.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=July 25, 2018

[Variables]
Instance=Rainmeter

[MeasureDelay]
Measure=Calc
Formula=MeasureDelay + 1
IfCondition=MeasureDelay > 4
IfTrueAction=[!UpdateMeasureGroup "Starting"][!Delay 2000][!UpdateMeasureGroup "Starting"]

[MeasureStartTime]
Measure=Time
Group=Starting
Disabled=1
Format=%H:%M:%S
UpdateDivider=-1

[MeasureCurrentTime]
Measure=Time
Format=%H:%M:%S

[MeasureUsedCPU_Starting]
Group=Starting
Measure=Plugin
Plugin=UsageMonitor
Alias=CPU
Name=#Instance#
UpdateDivider=-1

[MeasureUsedCPU]
Group=Starting
Measure=Plugin
Plugin=UsageMonitor
Alias=CPU
Name=#Instance#

[MeasureIDProcess]
Group=Starting
Measure=Plugin
Plugin=UsageMonitor
Category=Process
Counter=ID Process
Name=#Instance#

; Handles and Threads

[MeasureHandleCount_Starting]
Group=Starting
Measure=Plugin
Plugin=UsageMonitor
Category=Process
Counter=Handle Count
Name=#Instance#
UpdateDivider=-1

[MeasureHandleCount]
Group=Starting
Measure=Plugin
Plugin=UsageMonitor
Category=Process
Counter=Handle Count
Name=#Instance#

[MeasureThreadCount_Starting]
Group=Starting
Measure=Plugin
Plugin=UsageMonitor
Category=Process
Counter=Thread Count
Name=#Instance#
UpdateDivider=-1

[MeasureThreadCount]
Group=Starting
Measure=Plugin
Plugin=UsageMonitor
Category=Process
Counter=Thread Count
Name=#Instance#

; Memory

[MeasurePrivateBytes_Starting]
Group=Starting
Measure=Plugin
Plugin=UsageMonitor
Category=Process
Counter=Private Bytes
Name=#Instance#
UpdateDivider=-1

[MeasurePrivateBytes_Starting_Scaled]
Measure=Calc
Formula=MeasurePrivateBytes_Starting

[MeasurePrivateBytes]
Group=Starting
Measure=Plugin
Plugin=UsageMonitor
Category=Process
Counter=Private Bytes
Name=#Instance#

[MeasurePrivateBytes_Scaled]
Measure=Calc
Formula=MeasurePrivateBytes

[MeasureWorkingSet_Starting]
Group=Starting
Measure=Plugin
Plugin=UsageMonitor
Category=Process
Counter=Working Set
Name=#Instance#
UpdateDivider=-1

[MeasureWorkingSet_Starting_Scaled]
Measure=Calc
Formula=MeasureWorkingSet_Starting

[MeasureWorkingSet]
Group=Starting
Measure=Plugin
Plugin=UsageMonitor
Category=Process
Counter=Working Set
Name=#Instance#

[MeasureWorkingSet_Scaled]
Measure=Calc
Formula=MeasureWorkingSet

[MeasureWorkingSetPrivate_Starting]
Group=Starting
Measure=Plugin
Plugin=UsageMonitor
Category=Process
Counter=Working Set - Private
Name=#Instance#
UpdateDivider=-1

[MeasureWorkingSetPrivate_Starting_Scaled]
Measure=Calc
Formula=MeasureWorkingSetPrivate_Starting

[MeasureWorkingSetPrivate]
Group=Starting
Measure=Plugin
Plugin=UsageMonitor
Category=Process
Counter=Working Set - Private
Name=#Instance#

[MeasureWorkingSetPrivate_Scaled]
Measure=Calc
Formula=MeasureWorkingSetPrivate

; GPU

[MeasureInstanceGPU_Starting]
Measure=Plugin
Plugin=UsageMonitor
Group=Starting
Alias=GPU
Name=#Instance#
UpdateDivider=-1

[MeasureInstanceGPU]
Measure=Plugin
Plugin=UsageMonitor
Alias=GPU
Name=#Instance#

[MeasureInstanceVRAM_Starting]
Measure=Plugin
Plugin=UsageMonitor
Group=Starting
Alias=VRAM
Name=#Instance#
UpdateDivider=-1

[MeasureInstanceVRAM_Starting_Scaled]
Measure=Calc
Group=Starting
Formula=MeasureInstanceVRAM
UpdateDivider=-1

[MeasureInstanceVRAM]
Measure=Plugin
Plugin=UsageMonitor
Alias=VRAM
Name=#Instance#

[MeasureInstanceVRAM_Scaled]
Measure=Calc
Formula=MeasureInstanceVRAM

[MeasureInstanceVRAMSHARED_Starting]
Measure=Plugin
Plugin=UsageMonitor
Group=Starting
Alias=VRAMSHARED
Name=#Instance#
UpdateDivider=-1

[MeasureInstanceVRAMHARED_Starting_Scaled]
Measure=Calc
Group=Starting
Formula=MeasureInstanceVRAMSHARED_Starting
UpdateDivider=-1

[MeasureInstanceVRAMSHARED]
Measure=Plugin
Plugin=UsageMonitor
Group=Starting
Alias=VRAMSHARED
Name=#Instance#
UpdateDivider=-1

[MeasureInstanceVRAMHARED_Scaled]
Measure=Calc
Group=Starting
Formula=MeasureInstanceVRAMSHARED
UpdateDivider=-1

; Meters

[MeterBackground]
Meter=Image
W=320
H=261
SolidColor=0,0,0,255
SolidColor2=50,50,50,255
UpdateDivider=-1

[TextStyle]
FontSize=11
FontColor=200,200,200,255
AntiAlias=1

[LeftStyle]
X=5
Y=2R
StringAlign=Left

[NearRightStyle]
X=225
Y=0r
StringAlign=Right

[FarRightStyle]
X=315
Y=0r
StringAlign=Right

[MeterIDProcessL]
Meter=String
MeterStyle=TextStyle | LeftStyle
Y=5
Text=#Instance# (pid [MeasureIDProcess:0])
DynamicVariables=1

[MeterTime]
Meter=String
MeterStyle=TextStyle | LeftStyle
Y=10R
Text=Start / Current

[MeterStartTime]
Meter=String
MeterStyle=TextStyle | NearRightStyle
MeasureName=MeasureStartTime
Text=%1

[MeterCurrentTime]
Meter=String
MeterStyle=TextStyle | FarRightStyle
MeasureName=MeasureCurrentTime
Text=%1

[MeterUsedCPUL]
Meter=String
MeterStyle=TextStyle | LeftStyle
Y=10R
Percentual=1
NumOfDecimals=1
Text=Percent CPU

[MeterUsedCPUStarting]
Meter=String
MeterStyle=TextStyle | NearRightStyle
Text=[MeasureUsedCPU_Starting:1]%
DynamicVariables=1

[MeterUsedCPUCurrent]
Meter=String
MeterStyle=TextStyle | FarRightStyle
Text=[MeasureUsedCPU:1]%
DynamicVariables=1

[MeterHandleCountL]
Meter=String
MeterStyle=TextStyle | LeftStyle
Y=10R
Text=Handle Count

[MeterHandleCountStarting]
Meter=String
MeterStyle=TextStyle | NearRightStyle
MeasureName=MeasureHandleCount_Starting
Text=[MeasureHandleCount_Starting:0]
DynamicVariables=1

[MeterHandleCountCurrent]
Meter=String
MeterStyle=TextStyle | FarRightStyle
Text=[MeasureHandleCount:0]
DynamicVariables=1

[MeterThreadCountL]
Meter=String
MeterStyle=TextStyle | LeftStyle
Text=Thread Count

[MeterThreadCountStarting]
Meter=String
MeterStyle=TextStyle | NearRightStyle
Text=[MeasureThreadCount_Starting:0]
DynamicVariables=1

[MeterThreadCountCurrent]
Meter=String
MeterStyle=TextStyle | FarRightStyle
MeasureName=MeasureThreadCount
Text=[MeasureThreadCount:0]
DynamicVariables=1

[MeterPrivateBytesL]
Meter=String
MeterStyle=TextStyle | LeftStyle
Y=10R
Text=Private Bytes

[MeterPrivateBytesStarting]
Meter=String
MeterStyle=TextStyle | NearRightStyle
MeasureName=MeasurePrivateBytes_Starting_Scaled
AutoScale=1
NumOfDecimals=3
Text=%1

[MeterPrivateBytesCurrent]
Meter=String
MeterStyle=TextStyle | FarRightStyle
MeasureName=MeasurePrivateBytes_Scaled
AutoScale=1
NumOfDecimals=3
Text=%1

[MeterWorkingSetL]
Meter=String
MeterStyle=TextStyle | LeftStyle
Text=Working Set

[MeterWorkingSetStarting]
Meter=String
MeterStyle=TextStyle | NearRightStyle
MeasureName=MeasureWorkingSet_Starting_Scaled
AutoScale=1
NumOfDecimals=3
Text=%1

[MeterWorkingSetCurrent]
Meter=String
MeterStyle=TextStyle | FarRightStyle
MeasureName=MeasureWorkingSet_Scaled
AutoScale=1
NumOfDecimals=3
Text=%1

[MeterWorkingSetPrivateL]
Meter=String
MeterStyle=TextStyle | LeftStyle
Text=Working Set Private

[MeterWorkingSetPrivateStarting]
Meter=String
MeterStyle=TextStyle | NearRightStyle
MeasureName=MeasureWorkingSetPrivate_Starting_Scaled
AutoScale=1
NumOfDecimals=3
Text=%1

[MeterWorkingSetPrivateCurrent]
Meter=String
MeterStyle=TextStyle | FarRightStyle
MeasureName=MeasureWorkingSetPrivate_Scaled
AutoScale=1
NumOfDecimals=3
Text=%1

[MeterInstanceGPUL]
Meter=String
MeterStyle=TextStyle | LeftStyle
Y=10R
Text=Percent GPU

[MeterInstanceGPUStarting]
Meter=String
MeterStyle=TextStyle | NearRightStyle
Text=[MeasureInstanceGPU_Starting:1]%
DynamicVariables=1

[MeterInstanceGPUCurrent]
Meter=String
MeterStyle=TextStyle | FarRightStyle
AutoScale=1
NumOfDecimals=3
Text=[MeasureInstanceGPU:1]%
DynamicVariables=1

[MeterInstanceVRAMStartingL]
Meter=String
MeterStyle=TextStyle | LeftStyle
Y=10R
Text=Video RAM Private

[MeterInstanceVRAMStartingScaled]
Meter=String
MeterStyle=TextStyle | NearRightStyle
MeasureName=MeasureInstanceVRAM_Starting_Scaled
AutoScale=1
NumOfDecimals=3
Text=%1

[MeterInstanceVRAMCurrent]
Meter=String
MeterStyle=TextStyle | FarRightStyle
MeasureName=MeasureInstanceVRAM_Scaled
AutoScale=1
NumOfDecimals=3
Text=%1

[MeterInstanceVRAMSHAREDStartingL]
Meter=String
MeterStyle=TextStyle | LeftStyle
Text=Video RAM Shared

[MeterInstanceVRAMSHAREDStartingScaled]
Meter=String
MeterStyle=TextStyle | NearRightStyle
MeasureName=MeasureInstanceVRAMHARED_Starting_Scaled
AutoScale=1
NumOfDecimals=3
Text=%1

[MeterInstanceVRAMSHAREDCurrent]
Meter=String
MeterStyle=TextStyle | FarRightStyle
MeasureName=MeasureInstanceVRAMHARED_Scaled
AutoScale=1
NumOfDecimals=3
Text=%1

1.jpg
You do not have the required permissions to view the files attached to this post.
condition
Posts: 4
Joined: September 18th, 2019, 8:00 am

Re: exclude rainmeter process from readings

Post by condition »

Here are my percentages, but as I understand the same window that meters rainmeter consumption, actually makes rainmeter use a bit more as its foremost. (I don't know why it got so big in the attachment
rmtr cpu.png
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: exclude rainmeter process from readings

Post by jsmorley »

Certainly that RainmeterProcess skin will use a tiny, tiny bit of CPU in and of itself, but of course you won't be running that all the time.

There is actually no way to monitor your CPU use without the act of monitoring it using some CPU. Running TaskManager, or ProcessExplorer or whatever you want to use to see what it going on will in and of themselves use a bit of CPU. This Rainmeter skin is actually one of lightest ways I can think of to do this. You already have whatever overhead Rainmeter is using in the mix, and this single skin will use so little extra CPU that it will round to zero.
condition
Posts: 4
Joined: September 18th, 2019, 8:00 am

Re: exclude rainmeter process from readings

Post by condition »

Thank you for your reply. I had CPU problems only during first post as I was using an outdated script language. After Mordasius' reply my little skin works pretty well, excludes processes I choose and use absolute minimal cpu cycles. I have to study it a bit to display 2nd cpu usage process and top network usage process...
User avatar
Mordasius
Posts: 1171
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: exclude rainmeter process from readings

Post by Mordasius »

You'll need to add one measure to get the second highest process and add one meter to display the second name and value. Something like this:

Code: Select all

[Rainmeter]
Update=1000
MiddleMouseUpAction=[!Refresh]
DynamicWindowSize=1
AccurateText=1

[Variables]
TextName=Tahoma
TextColor=255,255,255,255
TextColorShadow=0,0,0,255
BGColor=0,0,0,1
TextSize=12
TextScale=1.65
DecimalAccuracy=2
Buffer=4

;===  Styles  ===;

[sProcess]
X=r
Y=R
H=(#TextSize# * #TextScale#)
Padding=#Buffer#,#Buffer#,#Buffer#,#Buffer#
StringEffect=Shadow
StringAlign=LeftCenter
StringCase=Proper
FontSize=#TextSize#
FontFace=#TextName#
FontColor=#TextColor#
FontEffectColor=#TextColorShadow#
SolidColor=#BGColor#
AntiAlias=1

;---   [   measures   ]   ---
[mProcess1]
Measure=Plugin
Plugin=UsageMonitor
Blacklist=_Total|Idle|Rainmeter
Alias=CPU
Index=1
IfCondition= #CurrentSection# >0.01
IfTrueAction=[!Showmeter MtProcessName1] 
IfFalseAction=[!Hidemeter MtProcessName1] 

[mProcess2]
Measure=Plugin
Plugin=UsageMonitor
Blacklist=_Total|Idle|Rainmeter
Alias=CPU
Index=2
IfCondition= #CurrentSection# >0.01
IfTrueAction=[!Showmeter MtProcessName2] 
IfFalseAction=[!Hidemeter MtProcessName2] 

;---    [  meters   ]   ---
[MtProcessName1]
Meter=String
MeterStyle=sProcess
MeasureName=mProcess1
X=0
Y=((#TextSize# * 0.5) + #Buffer#)
Text=%1 [mProcess1:#DecimalAccuracy#]%
DynamicVariables=1

[MtProcessName2]
Meter=String
MeterStyle=sProcess
MeasureName=mProcess2
Text=%1 [mProcess2:#DecimalAccuracy#]%
DynamicVariables=1
Take a look at the manual section on Usage Monitor for an explanation of what Alias=CPU and Index=1 or Index=2 do in the measures.

And then take a look at Measure Parameters for for an explanation of how Text=%1 [mProcess1:#DecimalAccuracy#]% shows both the string value and the numeric value of the measure mProcess1