It is currently April 25th, 2024, 4:20 pm

Help with variables

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help with variables

Post by jsmorley »

About the best thing I can suggest is to run this skin:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Metadata]
Name=RainmeterProcess
Author=JSMorley
Information=Shows some process information for Rainmeter
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=May 26, 2015

[Variables]
Instance=Rainmeter

[MeasureDelay]
Measure=Calc
Formula=MeasureDelay + 1
IfCondition=MeasureDelay > 3
IfTrueAction=[!EnableMeasureGroup "Starting"][!UpdateMeasureGroup "Starting"]

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

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

[MeasureMaxCPU]
Measure=Plugin
Plugin=AdvancedCPU

[MeasureUsedCPU_Starting]
Measure=Plugin
Plugin=AdvancedCPU
Group=Starting
Disabled=1
CPUInclude=#Instance#
MaxValue=[MeasureMaxCPU]
DynamicVariables=1
UpdateDivider=-1

[MeasureUsedCPU]
Measure=Plugin
Plugin=AdvancedCPU
CPUInclude=#Instance#
MaxValue=[MeasureMaxCPU]
DynamicVariables=1

[MeasureIDProcess]
Measure=Plugin
Plugin=Perfmon
PerfMonObject=Process
PerfMonCounter=ID Process
PerfMonInstance=#Instance#
PerfMonDifference=0
UpdateDivider=-1

[MeasureHandleCount_Starting]
Measure=Plugin
Plugin=Perfmon
Group=Starting
Disabled=1
PerfMonObject=Process
PerfMonCounter=Handle Count
PerfMonInstance=#Instance#
PerfMonDifference=0
UpdateDivider=-1

[MeasureHandleCount]
Measure=Plugin
Plugin=Perfmon
PerfMonObject=Process
PerfMonCounter=Handle Count
PerfMonInstance=#Instance#
PerfMonDifference=0
UpdateDivider=5

[MeasureThreadCount_Starting]
Measure=Plugin
Plugin=Perfmon
Group=Starting
Disabled=1
PerfMonObject=Process
PerfMonCounter=Thread Count
PerfMonInstance=#Instance#
PerfMonDifference=0
UpdateDivider=-1

[MeasureThreadCount]
Measure=Plugin
Plugin=Perfmon
PerfMonObject=Process
PerfMonCounter=Thread Count
PerfMonInstance=#Instance#
PerfMonDifference=0
UpdateDivider=5

[MeasurePrivateBytes_Starting]
Measure=Plugin
Plugin=Perfmon
Group=Starting
Disabled=1
PerfMonObject=Process
PerfMonCounter=Private Bytes
PerfMonInstance=#Instance#
PerfMonDifference=0
UpdateDivider=-1

[MeasurePrivateBytes]
Measure=Plugin
Plugin=Perfmon
PerfMonObject=Process
PerfMonCounter=Private Bytes
PerfMonInstance=#Instance#
PerfMonDifference=0
UpdateDivider=2

[MeasureWorkingSet_Starting]
Measure=Plugin
Plugin=Perfmon
Group=Starting
Disabled=1
PerfMonObject=Process
PerfMonCounter=Working Set
PerfMonInstance=#Instance#
PerfMonDifference=0
UpdateDivider=-1

[MeasureWorkingSet]
Measure=Plugin
Plugin=Perfmon
PerfMonObject=Process
PerfMonCounter=Working Set
PerfMonInstance=#Instance#
PerfMonDifference=0
UpdateDivider=2

[MeasureWorkingSetPrivate_Starting]
Measure=Plugin
Plugin=Perfmon
Group=Starting
Disabled=1
PerfMonObject=Process
PerfMonCounter=Working Set - Private
PerfMonInstance=#Instance#
PerfMonDifference=0
UpdateDivider=-1

[MeasureWorkingSetPrivate]
Measure=Plugin
Plugin=Perfmon
PerfMonObject=Process
PerfMonCounter=Working Set - Private
PerfMonInstance=#Instance#
PerfMonDifference=0
UpdateDivider=2

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

[TextStyle]
FontFace=Segoe UI
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
MeasureName=MeasureIDProcess
Y=5
Text=#Instance# (pid %1)

[MeterTime]
Meter=String
MeterStyle=TextStyle | LeftStyle
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
Percentual=1
NumOfDecimals=1
Text=Percent CPU

[MeterUsedCPUStarting]
Meter=String
MeterStyle=TextStyle | NearRightStyle
MeasureName=MeasureUsedCPU_Starting
Percentual=1
NumOfDecimals=1
Text=%1%

[MeterUsedCPUCurrent]
Meter=String
MeterStyle=TextStyle | FarRightStyle
MeasureName=MeasureUsedCPU
Percentual=1
NumOfDecimals=1
Text=%1%

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

[MeterHandleCountStarting]
Meter=String
MeterStyle=TextStyle | NearRightStyle
MeasureName=MeasureHandleCount_Starting
Text=%1

[MeterHandleCountCurrent]
Meter=String
MeterStyle=TextStyle | FarRightStyle
MeasureName=MeasureHandleCount
Text=%1

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

[MeterThreadCountStarting]
Meter=String
MeterStyle=TextStyle | NearRightStyle
MeasureName=MeasureThreadCount_Starting
Text=%1

[MeterThreadCountCurrent]
Meter=String
MeterStyle=TextStyle | FarRightStyle
MeasureName=MeasureThreadCount
Text=%1

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

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

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

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

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

[MeterWorkingSetCurrent]
Meter=String
MeterStyle=TextStyle | FarRightStyle
MeasureName=MeasureWorkingSet
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
AutoScale=1
NumOfDecimals=3
Text=%1

[MeterWorkingSetPrivateCurrent]
Meter=String
MeterStyle=TextStyle | FarRightStyle
MeasureName=MeasureWorkingSetPrivate
AutoScale=1
NumOfDecimals=3
Text=%1
1.png
And then load and unload skins while watching what impact it has on the various measurements.

Note that this skin itself will use a % or two of CPU, as the Perfmon plugin is a bit piggy...
You do not have the required permissions to view the files attached to this post.
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

Re: Help with variables

Post by Codger »

jsmorley wrote: Let me know if you have questions.
I know this should be its own thread but I'm just hoping to pick your brain on the probably simple but big unknown workings part of the application that if I knew the answer to I'd be able to relax and work on tightening the error and bizarre scenario handlers.

[hr][/hr]
jsmorley edit: Removed the politics. Not really appropriate for these forums.
https://forum.rainmeter.net/viewtopic.php?f=2&t=19826
The Rainmeter forums are about Rainmeter : Posts that contain material about politics, religion, world affairs or other topics likely to cause controversy irrelevant to the purpose of the forums will be removed. Persisting in this behavior can get the user account banned for a period of time, up to and including a permanent ban.
[hr][/hr]

Sorry, for the long exposition. So my tiny contribution, because there isn't much I can help with but it really feels good to have a purpose in these final times, is to kill a program on a computer that the IP becomes exposed.

I've got the when detection all figured out. It is the killing the program part that is the unknown.

So there is an application ("เสียงฟรี.com") I can have then rename it if the characters are a problem. I have no idea what the process(s) are called. There is, unfortunately no shortcut key for the exit command. The menu thankfully is in English and it is "File" menu, option "Exit" to shut it down.

Less ideally, but acceptable is to end the process if someone can tell me what it is called.

Also acceptable if all else can't be done would be to force to computer offline.

In this one instance I would love a fully formed routine rather than being shoved in the right direction as then I could concentrate on making the rest as tight as possible.

Thanks again in advance and sorry for not making a new thread but I sort of wanted to hide it a bit. Feel free to put it where you think it should be (hopefully not the trash :) ) if that is the best move.
[hr][/hr][hr][/hr]
"If you are the smartest one in the room, you are in the wrong room."
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help with variables

Post by jsmorley »

If I understand correctly, you want to kill a running process in Windows from Rainmeter. That is not that hard to do:

You can use the RunCommand plugin to execute a DOS/CMD command to kill the process by name. I would in fact suggest renaming that program, as I think the Unicode characters are likely to just complicate things.

https://technet.microsoft.com/en-us/library/bb491009.aspx
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help with variables

Post by jsmorley »

Code: Select all

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

[Variables]

[MeasureRunNotepad]
Measure=Plugin
Plugin=RunCommand
Parameter=notepad.exe
State=Hide
OutputType=ANSI

[MeasureKillNotepad]
Measure=Plugin
Plugin=RunCommand
Parameter=taskkill.exe /IM notepad.exe
State=Hide
OutputType=ANSI

[MeterRunNotepad]
Meter=String
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Run Notepad
LeftMouseUpAction=[!CommandMeasure MeasureRunNotepad "Run"]

[MeterKillNotepad]
Meter=String
Y=10R
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Kill Notepad
LeftMouseUpAction=[!CommandMeasure MeasureKillNotepad "Run"]
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

Re: Help with variables

Post by Codger »

jsmorley wrote:If I understand correctly, you want to kill a running process in Windows from Rainmeter. That is not that hard to do:

You can use the RunCommand plugin to execute a DOS/CMD command to kill the process by name. I would in fact suggest renaming that program, as I think the Unicode characters are likely to just complicate things.

https://technet.microsoft.com/en-us/library/bb491009.aspx
I've become slightly surprised how English centric the computer world has remained. Even a company as worldwide in its scope as Google and my girlfriend can't have a gmail address in her native name. She is forced to westernize it. That is beginning to seem messed up to me.

But I'm running off the trail here. The point is: thank you. I will play with that code you provided in the next message. It looks straight forward enough.

Off to work on time outs and error conditions :thumbup: :great: :D :rosegift:
[hr][/hr][hr][/hr]
"If you are the smartest one in the room, you are in the wrong room."