Quantcast
Viewing all articles
Browse latest Browse all 1573

System Monitoring • Re: Monitor Rainmeter Process

I am trying to create an Addon in Rainmeter that allows me to count how many instances are open of a certain program, in this specific case I would like to have a counter of the open instances of "msedge.exe" is there a way to do it?
Sure there is, just not with the Process, AdvancedCPU (deprecated by now), PerfMon (deprecated by now, replaced by UsageMonitor) plugins, but by running the suited PowerShell command in a RunCommand measure:

Code:

[Variables]Process=Rainmeter[Rainmeter]Update=1000AccurateText=1DynamicWindowSize=1OnRefreshAction=[!CommandMeasure ProcessInstances "Run"]---Measures---[ProcessInstances]Measure=PluginPlugin=RunCommandProgram=PowerShellParameter=@(Get-Process -Name #Process# -ErrorAction 0).countState=HideOutputType=ANSIFinishAction=[!UpdateMeter *][!Redraw]DynamicVariables=1---Meters---[InstancesOfProcess]Meter=StringSolidColor=0,255,0,255AntiAlias=1MeasureName=ProcessInstancesText=Instances Of #Process# = %1LeftMouseUpAction=[!CommandMeasure ProcessInstances "Run"]DynamicVariables=1
Feel free to change the value of the Process variable to your liking. Or, if you find it more comfortable, you can use the literal name of the process you want and forget about using the said variable. The above runs the measure on skin refresh, but, for conveniency, allows you to run it when you left click on the meter as well - you can keep both or remove the one you're not interested in, of course.

References:
https://docs.rainmeter.net/manual/plugins/deprecated/
https://docs.rainmeter.net/manual/plugins/usagemonitor/
https://docs.rainmeter.net/manual/plugins/runcommand/
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-process?view=powershell-7.4

Statistics: Posted by Yincognito — Today, 5:50 pm



Viewing all articles
Browse latest Browse all 1573

Trending Articles