It is currently October 15th, 2019, 10:44 pm

Requesting Help with Making Windows 10 Widgets

Help with creating, editing & fixing problems with skins
Darwing
Posts: 5
Joined: March 28th, 2019, 4:17 pm

Requesting Help with Making Windows 10 Widgets

Darwing » March 28th, 2019, 4:21 pm

Hey Guys I posted on reddit for this help to make my monitoring include what I want, can you take a look at the reddit post it has everything in the request

https://www.reddit.com/r/Rainmeter/comments/b6kiys/requesting_help_with_making_windows_10_widgets/
User avatar
CyberTheWorm
Posts: 661
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Requesting Help with Making Windows 10 Widgets

CyberTheWorm » March 28th, 2019, 5:48 pm

I would ask the author of the skin or look here https://docs.rainmeter.net/manual/

Try and figure it out yourself then ask for help when needed, after you try.
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
Yincognito
Posts: 657
Joined: February 27th, 2015, 2:38 pm

Re: Requesting Help with Making Windows 10 Widgets

Yincognito » March 28th, 2019, 7:01 pm

To get the core usages like you want to, you'd have to include something like this in your skin (add the needed position/background/padding and font/text/style options to the meters as desired):

Code: Select all

[MeasureCPU1]
Measure=CPU
Processor=1

[MeasureCPU2]
Measure=CPU
Processor=2

[MeasureCPU3]
Measure=CPU
Processor=3

[MeasureCPU4]
Measure=CPU
Processor=4

[MeterCPUCoresLabel]
Meter=String
Text="CPU Load"

[MeterCPUCores]
Meter=String
MeasureName=MeasureCPU1
MeasureName2=MeasureCPU2
MeasureName3=MeasureCPU3
MeasureName4=MeasureCPU4
NumOfDecimals=0
Text="%1% %2% %3% %4%"
To have the GPU usage/temp available, you'd have to use a plugin that allows Rainmeter to get the relevant data from either MSI Afterburner, HWiNFO and such, make sure the program you get the data from is running, copy the needed .DLL in the appropriate @Vault folder location, and then get data from it using something like (MSI Afterburner plugin used here to get the first GPU usage - add the needed meter options, just as above):

Code: Select all

[MeasureGPUUsage]
Measure=Plugin
Plugin=MSIAfterburner.dll
GPU=0
SourceId=48

[MeterGPUUsageLabel]
Meter=String
Text="GPU Load"

[MeterGPUUsage]
Meter=String
MeasureName=MeasureGPUUsage
NumOfDecimals=0
Text="%1%"
All in all, it's not that complicated, and just like CyberTheWorm pointed out, the manual is of great help when building the skins/widgets, just as this forum is when you get to things that are not that clear or obvious in the manual.
Darwing
Posts: 5
Joined: March 28th, 2019, 4:17 pm

Re: Requesting Help with Making Windows 10 Widgets

Darwing » March 28th, 2019, 7:45 pm

Thanks guys, I did try of corse, just dont have coding background, I can review how they created the widgets, and then linked the CPU and GPU temps and load, I know you have to link it with the CoreTemp or Hwinfo for it to read the ID of the sensors.

I know you guys do this all the time and understand the connections between INI files, but yeah this isnt second nature to most people ;) You're just smarter than most :)
User avatar
CyberTheWorm
Posts: 661
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Requesting Help with Making Windows 10 Widgets

CyberTheWorm » March 28th, 2019, 8:50 pm

Darwing wrote:
March 28th, 2019, 7:45 pm
me and understand the connections between INI files, but yeah this isnt second nature to most people ;) You're just smarter than most :)
Not really, we all started out with no idea how to do stuff. Best thing I can suggest is try simple ones for yourself. You will be amazed how fast it is to learn how to make skins.
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
Yincognito
Posts: 657
Joined: February 27th, 2015, 2:38 pm

Re: Requesting Help with Making Windows 10 Widgets

Yincognito » March 28th, 2019, 9:23 pm

The key in this is experimenting. You'll never learn how to ride a bike if you just stare at it. You'd have to get on it and try to make things work. You'll fall a few times in the process, but eventually you'll be able to ride it and in the end you'll look back and think to yourself: "If I only knew it was that easy when I started..." ;-)

That being said, apart from starting your own skin attempts with something simple like CyberTheWorm suggested, you can always take inspiration from other skins: if you see something in a skin and want to do the same in yours, just look how it's done in the sample skin and then try to replicate things in yours. Needless to say, for someone less experienced, simpler sample skins (like the ones all throughout the manual) are recommended, since they only focus on the task you'd like to replicate, while other, more complex skins, can be confusing if you only want to know how a specific thing is done.
Darwing
Posts: 5
Joined: March 28th, 2019, 4:17 pm

Re: Requesting Help with Making Windows 10 Widgets

Darwing » March 29th, 2019, 2:50 pm

Yincognito wrote:
March 28th, 2019, 7:01 pm
To get the core usages like you want to, you'd have to include something like this in your skin (add the needed position/background/padding and font/text/style options to the meters as desired):

Code: Select all

[MeasureCPU1]
Measure=CPU
Processor=1

[MeasureCPU2]
Measure=CPU
Processor=2

[MeasureCPU3]
Measure=CPU
Processor=3

[MeasureCPU4]
Measure=CPU
Processor=4

[MeterCPUCoresLabel]
Meter=String
Text="CPU Load"

[MeterCPUCores]
Meter=String
MeasureName=MeasureCPU1
MeasureName2=MeasureCPU2
MeasureName3=MeasureCPU3
MeasureName4=MeasureCPU4
NumOfDecimals=0
Text="%1% %2% %3% %4%"
okay I think I'll start with this as it seems to be the easiest to perform, then I'll try to replicate the CPU temps with this template but having to use the DLL for that..

I get lost in the styles templates sometimes where to add the stuff etc, but you have outlined pretty good steps here to follow!
Yincognito
Posts: 657
Joined: February 27th, 2015, 2:38 pm

Re: Requesting Help with Making Windows 10 Widgets

Yincognito » March 29th, 2019, 5:08 pm

Darwing wrote:
March 29th, 2019, 2:50 pm
okay I think I'll start with this as it seems to be the easiest to perform, then I'll try to replicate the CPU temps with this template but having to use the DLL for that..
Good idea. A skin doesn't have to be complete right from the start. You can always start small and add things along the way, and before you know it, it'll become more sophisticated and achieve its goals.
Darwing wrote:
March 29th, 2019, 2:50 pm
I get lost in the styles templates sometimes where to add the stuff etc, but you have outlined pretty good steps here to follow!
Rainmeter's system is quite simple and easy to grasp: you have a couple of elements in any skin and everything revolves around them.
- the skin file has a simple syntax in the form of Key=Value and the contents of the elements below is usually a line feed (i.e. ENTER on keyboard) separated list of Key=Value pairs, which we call "options".
- the elements and generally, certain parts of a skin, are identified by enclosing their "tags" between [ and ], and we call these parts "sections". Everything that follows a [Section] tag (until the next [Section] tag, that is) is the section's contents.

You also have a couple of elements:
- measures, that get data, either as a number, a string (aka text), or both. A measure "tag" is enclosed between [ and ], like [MeasureSomething], in effect being a "section".
- meters, that display data, and these can be more diverse (like string/text meters, image meters, etc). Same "tag" syntax as above, e.g. [DisplaySomething], thus, also being a "section".
- while the 2 above have their "contents" updated on a regular basis (what we call the update rate), you can also do things "right now" (i.e. on demand), with the help of what we call bangs. Their syntax is usually [!DoSomething MeasureOrMeterToActOn MeasureOrMeterOptionToActOn ValueToAssignToThatOption SkinToActOn], with SkinToActOn generally being optional. Skins are also called "configs" (you call them widgets).
- actions, which are a type of Keys that act when a certain event is happening, like a mouse click, a measure/meter update, etc.

Along these, there are other things that are used frequently, like plugins (which you can incorporate in measures, like you probably know already), variables (that you use to store values or strings/text, including values of measures if desired), LUA scripts, etc.
Darwing
Posts: 5
Joined: March 28th, 2019, 4:17 pm

Re: Requesting Help with Making Windows 10 Widgets

Darwing » March 29th, 2019, 7:28 pm

Yincognito wrote:
March 29th, 2019, 5:08 pm
Good idea. A skin doesn't have to be complete right from the start. You can always start small and add things along the way, and before you know it, it'll become more sophisticated and achieve its goals.

Along these, there are other things that are used frequently, like plugins (which you can incorporate in measures, like you probably know already), variables (that you use to store values or strings/text, including values of measures if desired), LUA scripts, etc.
Thank you for the elaboration on how to incorporate the config changes!

Unfortunately, this is a disaster thus far hahaha, Ill do my best to outline where I am in the process:

The feature that SK Neon Meters has on its CPU core percentage, I'm trying to port that over to the windows 10 CPU template.

Neon uses the HWiNFO.dll plugin, which is called by Meters.ini with a

Code: Select all

[MeasureDataBox4]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=#CPUTEMPSensorId#
HWiNFOSensorInstance=#CPUTEMPSensorInstance#
HWiNFOEntryId=#CPUTEMPEntryId#
HWiNFOType=CurrentValue
MinValue=0
MaxValue=100
AverageSize=2		-- Smoothing

Win10 Widgets CPU performance doesnt seem to call any CPU plugin, so Im not sure if I need to call it.

2ndly, SK Neon calls the CPU processes in cpusuch as

Code: Select all

[MeterLabelBox5]
Meter=String
MeterStyle=StyleGraphLabels
X=(#BoxWidth#/2)+#BoxPos5#
Y=0
Text="CPU Load"

; Gets data from the rainmeter - this is CPU LOAD.
[MeasureDataBox5]
Measure=CPU

; Gets data for specific cores for quad core etc
[MeasureCPU1]
Measure=CPU
Processor=1

[MeasureCPU2]
Measure=CPU
Processor=2

[MeasureCPU3]
Measure=CPU
Processor=3

[MeasureCPU4]
Measure=CPU
Processor=4

[MeterDataTextBox5]
Meter=String
MeterStyle=StyleGraphData
MeasureName=MeasureCPU1
MeasureName2=MeasureCPU2
MeasureName3=MeasureCPU3
MeasureName4=MeasureCPU4
X=(#BoxWidth#/2)+#BoxPos5#
Y=75
Scale=1
NumOfDecimals=0
Text="%1%  %2%  %3%  %4%"
but Windows 10 calls it from CpuTemplate.ini

Code: Select all

[MeasureCPU]
; Returns percent utilization of CPU.
Measure=CPU
OnUpdateAction=[!UpdateMeter Graph1][!UpdateMeter GraphBackground1][!UpdateMeter Value1]
UpdateDivider=10


I tried mapping just the

Code: Select all

MeasureName=MeasureCPU1
MeasureName2=MeasureCPU2
MeasureName3=MeasureCPU3
MeasureName4=MeasureCPU4

[MeasureCPU]
; Returns percent utilization of CPU.
Measure=CPU
OnUpdateAction=[!UpdateMeter Graph1][!UpdateMeter GraphBackground1][!UpdateMeter Value1]
UpdateDivider=10

[MeasureCPU1]
Measure=CPU
Processor=1

[MeasureCPU2]
Measure=CPU
Processor=2

[MeasureCPU3]
Measure=CPU
Processor=3

[MeasureCPU4]
Measure=CPU
Processor=4
into windows template and output inside performanceTemplateX4.ini as

Code: Select all

[MeterDataTextBox5]
Meter=String
MeterStyle=StyleGraphData
MeasureName=MeasureCPU1
MeasureName2=MeasureCPU2
MeasureName3=MeasureCPU3
MeasureName4=MeasureCPU4
X=(#BoxWidth#/2)+#BoxPos5#
Y=75
Scale=1
NumOfDecimals=0
Text="%1%  %2%  %3%  %4%"

Anyways needless to say I'm in a vortex that is way off simply adding additional cores to the original windows 10 CPU load
Image

I feel stupid haha this is the most basic mod Im trying to do, I'm not even getting the temps put into this template yet thats a whole other world...
Yincognito
Posts: 657
Joined: February 27th, 2015, 2:38 pm

Re: Requesting Help with Making Windows 10 Widgets

Yincognito » March 29th, 2019, 8:58 pm

Darwing wrote:
March 29th, 2019, 7:28 pm
The feature that SK Neon Meters has on its CPU core percentage, I'm trying to port that over to the windows 10 CPU template.

Neon uses the HWiNFO.dll plugin, which is called by Meters.ini with a

Code: Select all

[MeasureDataBox4]
Measure=Plugin
Plugin=HWiNFO.dll
HWiNFOSensorId=#CPUTEMPSensorId#
HWiNFOSensorInstance=#CPUTEMPSensorInstance#
HWiNFOEntryId=#CPUTEMPEntryId#
HWiNFOType=CurrentValue
MinValue=0
MaxValue=100
AverageSize=2		-- Smoothing
First of all, let's not mix getting the CPU usage with getting the CPU temp, they are two different things. Best thing to do is take them one at a time and go to the next task only after finishing the previous one. Below we handle the CPU usage issue.
Darwing wrote:
March 29th, 2019, 7:28 pm
Win10 Widgets CPU performance doesnt seem to call any CPU plugin, so Im not sure if I need to call it. 2ndly, SK Neon calls the CPU processes in cpusuch as ..., but Windows 10 calls it from CpuTemplate.ini into windows template and output inside performanceTemplateX4.ini as ...

Anyways needless to say I'm in a vortex that is way off simply adding additional cores to the original windows 10 CPU load. I feel stupid haha this is the most basic mod Im trying to do, I'm not even getting the temps put into this template yet thats a whole other world...
Things are simpler than you thought, actually. The good thing you did is that you correctly identified the files that need to be modified in order to achieve what you want - that's a start, and a good one, so don't panic, just, as I said before, take things one at a time.

Now, I assume the code of the skin(s) is unchanged, like you took it from the Win10 Widgets link at the top-right corner of this page (the .rmskin file link). The best thing to do when approaching this is try to keep the original structure of those skins unchanged, and just modify or add the things we're interested in. That's why, instead of just copy pasting stuff from SK Neon and replacing in the Win10 Widgets skin, we'll keep the original format and add the necessary measures, followed by slightly modifying the original meters.

First, adding the measures, in cpuTemplate.ini. As you can see, we left things unchanged for the most part, and just added the appropriate measures to get the CPU usage of all 4 "cores" (actually, they are threads, but cores is easier to understand for most people). Not only that, but since the performanceTemplateX4.ini uses variables (the names enclosed by #) to identify the measures being used, we'll add one variable for each new measure we made (for the sake of consistency with how things are originially handled in Win10 Widgets). This is the whole file, since it was short enough to not bother cropping only the things of interest:

Code: Select all

; ------------------------------------------------------------------------
;    _       ___      _______     _       ___     __           __
;   | |     / (_)___ /  / __ \   | |     / (_)___/ /___  ___  / /______
;   | | /| / / / __ \/ / / / /   | | /| / / / __  / __ \/ _ \/ __/ ___/
;   | |/ |/ / / / / / / /_/ /    | |/ |/ / / /_/ / /_/ /  __/ /_(__  ) 
;   |__/|__/_/_/ /_/_/\____/     |__/|__/_/\__,_/\__, /\___/\__/____/
;                                               /____/
;
;	Win10 Widgets for Rainmeter - CPU template
;		Author  - TJ Markham, http://tjmarkham.com
;		Website - http://win10widgets.com
;		Donate  - http://donate.win10widgets.com
;
; ------------------------------------------------------------------------

; About:
;	Template for CPU performance monitor.

[Variables]
GraphMeasure1Core1=MeasureCPU1
GraphMeasure1Core2=MeasureCPU2
GraphMeasure1Core3=MeasureCPU3
GraphMeasure1Core4=MeasureCPU4
GraphMeasure1=MeasureCPU


; ------------------------------------------------------------------------
; MEASURES
; ------------------------------------------------------------------------

[MeasureCPU1]
; Returns percent utilization of CPU Core 1.
Measure=CPU
Processor=1
UpdateDivider=10

[MeasureCPU2]
; Returns percent utilization of CPU Core 2.
Measure=CPU
Processor=2
UpdateDivider=10

[MeasureCPU3]
; Returns percent utilization of CPU Core 3.
Measure=CPU
Processor=3
UpdateDivider=10

[MeasureCPU4]
; Returns percent utilization of CPU Core 4.
Measure=CPU
Processor=4
UpdateDivider=10

[MeasureCPU]
; Returns percent utilization of CPU.
Measure=CPU
OnUpdateAction=[!UpdateMeter Graph1][!UpdateMeter GraphBackground1][!UpdateMeter Value1]
UpdateDivider=10

; ------------------------------------------------------------------------
; METERS
; ------------------------------------------------------------------------

[Graph1]
Hidden=0

[GraphBackground1]
Hidden=0

[Top1]
Hidden=0

[Left1]
Hidden=0

[Bottom1]
Hidden=0

[Right1]
Hidden=0

[Label1]
Hidden=0

[Value1]
Hidden=0
Secondly, modifying the appropriate meter, in performanceTemplateX4.ini. The meter that needs to be modified is [Value1], since this is the meter that contains the reference to the [MeasureCPU] measure (actually, the variable assigned to it, i.e. #GraphMeasure1#) from the previously edited cpuTemplate.ini file. Therefore, we change the [Value1] meter to:

Code: Select all

[Value1]
; Value corresponding to graph.
Meter=String
MeterStyle=StyleSmallText
MeasureName=#GraphMeasure1Core1#
MeasureName2=#GraphMeasure1Core2#
MeasureName3=#GraphMeasure1Core3#
MeasureName4=#GraphMeasure1Core4#
MeasureName5=#GraphMeasure1#
X=1r
Y=-2R
Group=Monitor1
Text="%1% %2% %3% %4%"
FontSize=9
UpdateDivider=-1
Hidden=1
What we did was add the MeasureNameN=... lines to it (changing the option that we assign #GraphMeasure1# to to MeasureName5, to "make room" for the "cores" measures; of course, that line can be removed entirely, since it won't be used, but why bother anyway?). Next, we modify the Text=... line to reference the newly added MeasureNameN=... options (as you probably know already, in a meter, you reference a measure from a MeasureNameN line with %N, where N is the number after MeasureName).

There we go, first step completed. Since all the variants of the Performance - CPU skin (e.g. CPU-Tiny.ini, CPU-Small.ini, etc.) use the same "templates" to get or display data, the change will be present in each one of them.

See? It's wasn't that hard, was it? 8-)