It is currently April 8th, 2020, 3:24 pm

UsageMonitor with ProcessName

Help with creating, editing & fixing problems with skins
Lanteust
Posts: 2
Joined: March 20th, 2020, 2:57 pm

UsageMonitor with ProcessName

Post by Lanteust »

Hello,
i'm trying to do a small skin to tell me if my IDE is running.
And show me her CPU & RAM usage.

So the first part rocks, it's OK.

But the 2nd part don't work because Name is different from the ProcessName.

Is there a way to get Name from ProcessName?

Code: Select all

[Rainmeter]
Update=1000
Background=#@#Pictures\Background.png
BackgroundMode=3
BackgroundMargins=0,34,0,14

[Metadata]
Name=Is it still running?
Version=2
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

[Variables]
fontName=Trebuchet MS
textSize=8
colorText=255,255,255,205
colorOn=255,000,000,205
colorOff=000,255,000,205
hText=14
hSeparator=1
sPicture=13
xImage=10
xLabel=25
xProcess=200
yOffsetLine=20
yDelphi=(#yOffsetLine#*2)
wLabel=100
wProcess=190
Delphi=bds.exe

;___STYLE___
	[styleTitle]
	StringAlign=Center
	StringCase=Upper
	StringStyle=Bold
	StringEffect=Shadow
	FontEffectColor=0,0,0,50
	FontColor=#colorText#
	FontFace=#fontName#
	FontSize=10
	AntiAlias=1
	ClipString=1

	[styleLeftText]
	StringAlign=Left
	StringCase=None
	StringStyle=Bold
	StringEffect=Shadow
	FontEffectColor=0,0,0,20
	FontColor=#colorText#
	FontFace=#fontName#
	FontSize=#textSize#
	AntiAlias=1
	ClipString=1

	[styleRightText]
	StringAlign=Right
	StringCase=None
	StringStyle=Bold
	StringEffect=Shadow
	FontEffectColor=0,0,0,20
	FontColor=#colorText#
	FontFace=#fontName#
	FontSize=#textSize#
	AntiAlias=1
	ClipString=1
	
	[styleRightTextON]
	StringAlign=Right
	StringCase=None
	StringStyle=Bold
	StringEffect=Shadow
	FontEffectColor=0,0,0,20
	FontColor=#colorOn#
	FontFace=#fontName#
	FontSize=#textSize#
	AntiAlias=1
	ClipString=1
	Text="ON"

	[styleRightTextOFF]
	StringAlign=Right
	StringCase=None
	StringStyle=Bold
	StringEffect=Shadow
	FontEffectColor=0,0,0,20
	FontColor=#colorOff#
	FontFace=#fontName#
	FontSize=#textSize#
	AntiAlias=1
	ClipString=1
	Text="OFF"

;___TITLE___
	[meterTitle]
	Meter=String
	MeterStyle=styleTitle
	X=100
	Y=12
	W=190
	H=18
	Text=Is it still running?

;___DELPHI___
	[MeasureProcessDelphi]
	Measure=Plugin
	Plugin=Process
	ProcessName=#Delphi#
	
	[MeasureCPUDelphi]
	Measure=Plugin
	Plugin=UsageMonitor
	Alias=CPU
	Name=#Delphi#
	
	[MeasureRAMDelphi]
	Measure=Plugin
	Plugin=UsageMonitor
	Alias=RAM
	Name=#Delphi#
	
	[MeasureRAMforScalingDelphi]
	Measure=Calc
	Formula=MeasureRAMDelphi
	
	[ToggleDelphi]
	Measure=Calc
	Formula=[MeasureDelphi]
	IfCondition=MeasureProcessDelphi > 0
	IfTrueAction=[!SetOption meterProcessDelphi MeterStyle styleRightTextON][!SetOption meterImageDelphi GreyScale 0][!EnableMouseAction meterImageDelphi "LeftMouseUpAction"][!SetOption meterImageDelphi ToolTipHidden 0]
	IfFalseAction=[!SetOption meterProcessDelphi MeterStyle styleRightTextOFF][!SetOption meterImageDelphi GreyScale 1][!DisableMouseAction meterImageDelphi "LeftMouseUpAction"][!SetOption meterImageDelphi ToolTipHidden 1]

	[meterImageDelphi]
	Meter=Image
	ImageName=#@#Pictures\Delphi.png
	X=#xImage#
	Y=#yDelphi#
	W=#sPicture#
	H=#sPicture#
	LeftMouseUpAction=["#@#Addons\TaskKiller.exe" "#Delphi#"]
	ToolTipTitle=taskkill #Delphi#
	ToolTipType=1
	ToolTipIcon=WARNING
	ToolTipText=taskkill /im #Delphi# /f
	DynamicVariables=1
	
	[meterLabelDelphi]
	Meter=String
	MeterStyle=styleLeftText
	X=#xLabel#
	Y=#yDelphi#
	W=#wLabel#
	H=#hText#
	Text=Delphi [#Delphi#]

	[meterProcessDelphi]
	Meter=String
	MeasureName=MeasureDelphi
	MeterStyle=styleRightText
	X=#xProcess#
	Y=0r
	W=#wProcess#
	H=#hText#
	
	[MeterCPUDelphi]
	Meter=String
	MeasureName=MeasureCPUDelphi
	MeterStyle=styleLeftText
	X=#xImage#
	Y=(#yDelphi#+#yOffsetLine#)
	W=#wProcess#
	H=#hText#
	AutoScale=1
	NumOfDecimals=1
	DynamicVariables=1
	Text=CPU : [MeasureCPUDelphi:1]%
	
	[MeterRAMDelphi]
	Meter=String
	MeasureName=MeasureRAMforScalingDelphi
	MeterStyle=styleRightText
	X=#xProcess#
	Y=(#yDelphi#+#yOffsetLine#)
	W=#wProcess#
	H=#hText#
	AutoScale=1
	NumOfDecimals=1
	DynamicVariables=1
	Text=RAM : %1B
Last edited by Lanteust on March 20th, 2020, 3:43 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 20457
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: UsageMonitor with ProcessName

Post by jsmorley »

What I would do is change the Variable to:

Delphi=bds

Then I would use that, appended with .exe, with the Process plugin:

ProcessName=#Delphi#.exe

and just the variable with the UsageMonitor plugin:

Name=#Delphi#
Lanteust
Posts: 2
Joined: March 20th, 2020, 2:57 pm

Re: UsageMonitor with ProcessName

Post by Lanteust »

Thanks, it works ;)
User avatar
jsmorley
Developer
Posts: 20457
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: UsageMonitor with ProcessName

Post by jsmorley »

Great. Glad to help.