It is currently March 1st, 2024, 10:12 pm

MYiniMeter - A minimalistic title-bar skin suite

A package of skins with a "theme" or by a single author
User avatar
Yincognito
Rainmeter Sage
Posts: 6838
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MYiniMeter - A minimalistic title-bar skin suite

Post by Yincognito »

sendblink23 wrote: February 9th, 2022, 5:09 pmTime: Is there a way to show AM / PM on the time clock? I want it to be shown on both the display OSD and the mouse hover "TIME" window
[...]
GPU: I want it to also show the Memory Clock on the OSD, currently it only shows the Core Clock - so I want both Core and Memory Clock displayed on OSD. Also on the mouse hover "GPU" I believe it is showing the wrong amount of VRAM GB of my RTX 3080 Ti it says 4GB when it should be 12GB... unless the 4Gb is something else.
[...]
RAM: What is the "unknown" that is showing here? And can I alter or manually change the TEXT of what it says there? I would like to write down or display the timings Tcas, Trcd, Trp, Tras, Trc and Command Rate from HWiNFO. Example of what I want: Corsair blahmodelnumberblah, 16GB, 3600Mhz, 16-19-20-38-60-1T, DIMM, 64-Bit. If not possible from HWiNFO then I would like to manually write it in to replace the "unknown".
I don't normally follow these type of requests because they usually open the Pandora's box and force the skin designer to please every user and their different views on what should and should not be in skins, not to mention that restricting "OSD" info to a max of 3 "columns" or "fields" is precisely one of the reasons why I ended up with skins that small and simple (not that simple if you look at the code though, LOL), but given the circumstances particular to someone new to Rainmeter, I'll make an exception this time... :D

----------------
Time - replace [SkinsFolder]\MYiniMeter\Clock\Clock.ini with the file below, adjust the new PrimaryColAdd variable from the [Variables] section to change the width of the enlarged time "column" if needed:
Clock.ini
Clock.jpg

----------------
GPU - replace [SkinsFolder]\MYiniMeter\Video\Video.ini with the file below.
Video.ini
Video.jpg
The GPU info you mentioned is the pretty form of the output of the following PowerShell command, which you can test in your PowerShell as well:

Code: Select all

gcim -classname Win32_VideoController -filter "DeviceID like '%VideoController%'" | select Name,@{n='AdapterRAM';e={[string][math]::round($_.AdapterRAM/1GB,2)}},CurrentNumberOfColors,Availability,CurrentBitsPerPixel,CurrentRefreshRate,CurrentScanMode,VideoArchitecture,VideoMemoryType,CurrentHorizontalResolution,CurrentVerticalResolution | sort DeviceID | format-list
Now if the above command shows the same amount of RAM in your PowerShell window after running, there's not much I can do, since I take the said info right from the PS result, the only thing I do is make some string substitutions to properly fit the content in the "custom tooltip" window. It might just be that some of your RAM is added to the video card's own memory, I've seen this happen in other cases, though not so much shared memory indeed.

----------------
RAM - like for the video card skin above, the info in that area is grabbed via the following powershell command, in the [MS_RunCommand_MemoryInfo] measure from the [SkinsFolder]\MYiniMeter\Memory\Memory.ini (running such commands from the command prompt requires escaping double quotes (") using \, if you wonder about the slight differences between that measure's Parameter option and what I pasted here for PowerShell use):

Code: Select all

gcim -classname Win32_PhysicalMemory -filter "Tag like '%Physical Memory%'" | select @{n='Capacity';e={[string][math]::round($_.Capacity/1GB,2)}},DataWidth,FormFactor,Manufacturer,MemoryType,Model,PartNumber,Speed | sort Tag | format-list
In that measure, I shuffle a bit the data using a long Substitute line, which at one point does something like:

Code: Select all

"\nCapacity=(.*)\nDataWidth=(.*)\nFormFactor=(.*)\nManufacturer=(.*)\nMemoryType=(.*)\nModel=(.*)\nPartNumber=(.*)\nSpeed=(.*)\n":"#CRLF#∆ \4 \6 \7, \1 GB, \8 MHz, \5, \3, \2-bit#CRLF#"
which basically means that the 4th data followed by a comma (i.e. the "unknown" you mentioned) is the \5 part at the end of the code above, aka the 5th (.*) part at the beginning of the same code, meaning it's the MemoryType field. That field is 0 for me and probably for you as well, which according to Microsoft's documentation of the corresponding Windows Management Instrumentation (aka WMI) class is ... you guessed it ... "Unknown". So again, not my fault, if Microsoft says it doesn't know stuff... :confused:

That being said, to do what you want using HWiNFO, replace [SkinsFolder]\MYiniMeter\Memory\Memory.ini with the file below:
Memory.ini
Memory.jpg
This assumes that you followed the instructions here and those memory timings are added to "report value in gadget" precisely in the order that you mentioned and having the said "indexes" ranging from 0 (TCAS) to 5 (Command Rate). If not, just adjust the N in the RegValue=ValueRawN lines from the corresponding newly created HWiNFO measures (i.e. [MS_HWiNFO64_TCAS], etc.) from the above file.

Note: this suite is the one I also use personally, so the fact that for me MSIAfterburner provides much more than sensor values (e.g. screen recording as images or videos, skin-like "gadget" in D3D or game applications, Rainmeter interaction for the skins in desktop mode, etc.) and I'm in an area where military time is the "normal" time and AM/PM time is the "odd" time explain why I chose certain ways to do things in my skins. Hopefully the help I provided above will be of good use to you! ;-)

P.S. If you really like the suite, you should know that sometime in the near future I'll release the 1.5.0 version of the suite, with some changes to the PowerShell commands, ability to kill processes that overwork the CPU, some more accurate CPU usage and frequency, some minor calendar fixes, a slight weather skin update, a stopwatch / timer skin with the precision of milliseconds and probably more.
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
sendblink23
Posts: 9
Joined: February 9th, 2022, 3:54 pm
Location: Puerto Rico

Re: MYiniMeter - A minimalistic title-bar skin suite

Post by sendblink23 »

Yincognito wrote: February 9th, 2022, 10:55 pm I don't normally follow these type of requests because they usually open the Pandora's box and force the skin designer to please every user and their different views on what should and should not be in skins, not to mention that restricting "OSD" info to a max of 3 "columns" or "fields" is precisely one of the reasons why I ended up with skins that small and simple (not that simple if you look at the code though, LOL), but given the circumstances particular to someone new to Rainmeter, I'll make an exception this time... :D

----------------
Time - replace [SkinsFolder]\MYiniMeter\Clock\Clock.ini with the file below, adjust the new PrimaryColAdd variable from the [Variables] section to change the width of the enlarged time "column" if needed:
Clock.ini
Clock.jpg


----------------
GPU - replace [SkinsFolder]\MYiniMeter\Video\Video.ini with the file below.
Video.ini
Video.jpg
The GPU info you mentioned is the pretty form of the output of the following PowerShell command, which you can test in your PowerShell as well:

Code: Select all

gcim -classname Win32_VideoController -filter "DeviceID like '%VideoController%'" | select Name,@{n='AdapterRAM';e={[string][math]::round($_.AdapterRAM/1GB,2)}},CurrentNumberOfColors,Availability,CurrentBitsPerPixel,CurrentRefreshRate,CurrentScanMode,VideoArchitecture,VideoMemoryType,CurrentHorizontalResolution,CurrentVerticalResolution | sort DeviceID | format-list
Now if the above command shows the same amount of RAM in your PowerShell window after running, there's not much I can do, since I take the said info right from the PS result, the only thing I do is make some string substitutions to properly fit the content in the "custom tooltip" window. It might just be that some of your RAM is added to the video card's own memory, I've seen this happen in other cases, though not so much shared memory indeed.

----------------
RAM - like for the video card skin above, the info in that area is grabbed via the following powershell command, in the [MS_RunCommand_MemoryInfo] measure from the [SkinsFolder]\MYiniMeter\Memory\Memory.ini (running such commands from the command prompt requires escaping double quotes (") using \, if you wonder about the slight differences between that measure's Parameter option and what I pasted here for PowerShell use):

Code: Select all

gcim -classname Win32_PhysicalMemory -filter "Tag like '%Physical Memory%'" | select @{n='Capacity';e={[string][math]::round($_.Capacity/1GB,2)}},DataWidth,FormFactor,Manufacturer,MemoryType,Model,PartNumber,Speed | sort Tag | format-list
In that measure, I shuffle a bit the data using a long Substitute line, which at one point does something like:

Code: Select all

"\nCapacity=(.*)\nDataWidth=(.*)\nFormFactor=(.*)\nManufacturer=(.*)\nMemoryType=(.*)\nModel=(.*)\nPartNumber=(.*)\nSpeed=(.*)\n":"#CRLF#∆ \4 \6 \7, \1 GB, \8 MHz, \5, \3, \2-bit#CRLF#"
which basically means that the 4th data followed by a comma (i.e. the "unknown" you mentioned) is the \5 part at the end of the code above, aka the 5th (.*) part at the beginning of the same code, meaning it's the MemoryType field. That field is 0 for me and probably for you as well, which according to Microsoft's documentation of the corresponding Windows Management Instrumentation (aka WMI) class is ... you guessed it ... "Unknown". So again, not my fault, if Microsoft says it doesn't know stuff... :confused:

That being said, to do what you want using HWiNFO, replace [SkinsFolder]\MYiniMeter\Memory\Memory.ini with the file below:
Memory.ini
Memory.jpg
This assumes that you followed the instructions here and those memory timings are added to "report value in gadget" precisely in the order that you mentioned and having the said "indexes" ranging from 0 (TCAS) to 5 (Command Rate). If not, just adjust the N in the RegValue=ValueRawN lines from the corresponding newly created HWiNFO measures (i.e. [MS_HWiNFO64_TCAS], etc.) from the above file.

Note: this suite is the one I also use personally, so the fact that for me MSIAfterburner provides much more than sensor values (e.g. screen recording as images or videos, skin-like "gadget" in D3D or game applications, Rainmeter interaction for the skins in desktop mode, etc.) and I'm in an area where military time is the "normal" time and AM/PM time is the "odd" time explain why I chose certain ways to do things in my skins. Hopefully the help I provided above will be of good use to you! ;-)

P.S. If you really like the suite, you should know that sometime in the near future I'll release the 1.5.0 version of the suite, with some changes to the PowerShell commands, ability to kill processes that overwork the CPU, some more accurate CPU usage and frequency, some minor calendar fixes, a slight weather skin update, a stopwatch / timer skin with the precision of milliseconds and probably more.
Thank you so much for using your time on responding helping me out on how to implement some of these things and mentioning on how the data was read from, I can see now why the military time was used which makes complete sense ;). I'll go try doing these later on tonight and hopefully I'll achieve them and post the outcome. Sounds awesome that you are on the way working in the future releasing a new version(v 1.5.0) of this suite, you have done tons of great things to it at upkeep. I definitely like it for its visual simplicity and how small it is(no mess or big things onscreen and plus super light weight on resources), I am certainly keeping it for 24/7 daily use.
sendblink23
Posts: 9
Joined: February 9th, 2022, 3:54 pm
Location: Puerto Rico

Re: MYiniMeter - A minimalistic title-bar skin suite

Post by sendblink23 »

Great thanks, I replaced those files(did the hwinfo settings and gadget changes) and everything worked directly plug n play(no change needed) - Time Clock 12hr AM/PM, GPU Memory Clock added, RAM timing added in mouse hover.

What I got so far - GIF Animation:
Image

As to the GPU VRAM(yes the powershell code you provided also shows 4gb) I guess there is a reason on why it only shows 4GB, the code with "Win32_VideoController" might have a limitation for 32bits / x86 meaning it doesn't know how to read above 4GB. I am probably completely wrong hehe but someone mentions "Windows utilities have not been updated to 64-bit so can't show more than 4GB" about it here: https://superuser.com/questions/1461858/fetch-correct-vram-for-gpu-via-command-line-on-windows

Now at the bottom in that same page someone posted this:

Code: Select all

$qwMemorySize = (Get-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*" -Name HardwareInformation.qwMemorySize -ErrorAction SilentlyContinue)."HardwareInformation.qwMemorySize" 
[math]::round($qwMemorySize/1GB)
and he also links this: https://github.com/farag2/PC-information/blob/master/PC.ps1#L174

He also posted this elsewhere(at the end): https://www.titanwolf.org/Network/q/361c9bab-a9a6-4335-b2cb-11f148f6bd56/x

Code: Select all

$qwMemorySize = (Get-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*" -Name HardwareInformation.qwMemorySize -ErrorAction SilentlyContinue)."HardwareInformation.qwMemorySize"
$VRAM = [math]::round($qwMemorySize/1GB)
Get-CimInstance -ClassName CIM_VideoController | Where-Object -FilterScript {$_.AdapterDACType -ne "Internal"} | ForEach-Object -Process {
    [PSCustomObject] @{
        Model = $_.Caption
        "VRAM, GB" = $VRAM
    }
}
Those actually do provide the correct VRAM number for the GPU on PowerShell, now of course I have zero idea if that can even be applied here :P besides its a long code for just that simple text value alone compared to the string of your code which gives out several info data. So I instead began to try to edit the "math" line of your code to manually add the 12GB text, ended up with this:
"e={[string][math]::round(0.000000011GB)}}" ... I just kept typing random numbers save/refresh until it got close to 2 digits which eventually that gave me 12GB :D sorry for my awful brute forced manual text hehe I just couldn't figure out a simpler way for manual text on there(you probably know a simpler way).

Again thank you very much for this.
User avatar
Yincognito
Rainmeter Sage
Posts: 6838
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MYiniMeter - A minimalistic title-bar skin suite

Post by Yincognito »

sendblink23 wrote: February 10th, 2022, 5:35 amAs to the GPU VRAM(yes the powershell code you provided also shows 4gb) I guess there is a reason on why it only shows 4GB, the code with "Win32_VideoController" might have a limitation for 32bits / x86 meaning it doesn't know how to read above 4GB. I am probably completely wrong hehe but someone mentions "Windows utilities have not been updated to 64-bit so can't show more than 4GB" about it here: https://superuser.com/questions/1461858/fetch-correct-vram-for-gpu-via-command-line-on-windows

Now at the bottom in that same page someone posted this:

Code: Select all

$qwMemorySize = (Get-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*" -Name HardwareInformation.qwMemorySize -ErrorAction SilentlyContinue)."HardwareInformation.qwMemorySize" 
[math]::round($qwMemorySize/1GB)
and he also links this: https://github.com/farag2/PC-information/blob/master/PC.ps1#L174

He also posted this elsewhere(at the end): https://www.titanwolf.org/Network/q/361c9bab-a9a6-4335-b2cb-11f148f6bd56/x

Code: Select all

$qwMemorySize = (Get-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*" -Name HardwareInformation.qwMemorySize -ErrorAction SilentlyContinue)."HardwareInformation.qwMemorySize"
$VRAM = [math]::round($qwMemorySize/1GB)
Get-CimInstance -ClassName CIM_VideoController | Where-Object -FilterScript {$_.AdapterDACType -ne "Internal"} | ForEach-Object -Process {
    [PSCustomObject] @{
        Model = $_.Caption
        "VRAM, GB" = $VRAM
    }
}
Those actually do provide the correct VRAM number for the GPU on PowerShell, now of course I have zero idea if that can even be applied here :P besides its a long code for just that simple text value alone compared to the string of your code which gives out several info data. So I instead began to try to edit the "math" line of your code to manually add the 12GB text, ended up with this:
"e={[string][math]::round(0.000000011GB)}}" ... I just kept typing random numbers save/refresh until it got close to 2 digits which eventually that gave me 12GB :D sorry for my awful brute forced manual text hehe I just couldn't figure out a simpler way for manual text on there(you probably know a simpler way).
Thanks for this information, I had no idea VRAM was limited like that on that class - I wonder if it's not the same for other classes as well. The solution you mentioned (unfortunately the only one, it seems) can easily be implemented in my skin, but the problem is whether that registry path and value is properly updated, the same on all Windows 7+ computers - in short whether or not that route can be relied on in ALL cases. Oh, and that registry value can be edited by any user via regedit.exe, which can lead to incorrect results, of course.

I'll look into this further, before making a call. It's not a problem of difficulty in implementation, but rather a poorly confirmed reliability. Nice find, by the way! :thumbup:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
sendblink23
Posts: 9
Joined: February 9th, 2022, 3:54 pm
Location: Puerto Rico

Re: MYiniMeter - A minimalistic title-bar skin suite

Post by sendblink23 »

Yincognito wrote: February 10th, 2022, 9:17 am Thanks for this information, I had no idea VRAM was limited like that on that class - I wonder if it's not the same for other classes as well. The solution you mentioned (unfortunately the only one, it seems) can easily be implemented in my skin, but the problem is whether that registry path and value is properly updated, the same on all Windows 7+ computers - in short whether or not that route can be relied on in ALL cases. Oh, and that registry value can be edited by any user via regedit.exe, which can lead to incorrect results, of course.

I'll look into this further, before making a call. It's not a problem of difficulty in implementation, but rather a poorly confirmed reliability. Nice find, by the way! :thumbup:
The thing that I believe on which it might be always like that for now(the registry part) is that his solution is from 2019... we're already on Windows 11 in 2022 and its still working(as in he most likely posted that solution when he was on Windows 10). As for Windows 7 users, that is no longer supported anymore by Microsoft since Jan 2020 so users should not really be still using it if they care for security updates(but who knows people still use old stuff - if I had a spare hard drive[virtualization maybe? wouldn't think that would be accurate] I would test it). However for current Win 11, I can only confirm of me with Nvidia(I also tested on my other PC with the RTX 2080 with the powershell string and it does also give the correct vram) we will now need someone on AMD(that has a graphic card with larger than 4gb vram) to see if it also shows the right GB with that powershell string. Also we need users of lower GB vram cards to test too. Or maybe if it were implemented, have both options and the USER has to manually replace the text with the [above_4gb_name] in the exact # line of the Video.ini needed so that way its optional by default it should be what your code originally has. As in provide instruction inside Video.ini, here is a fake none working example:

Code: Select all

---Measures RunCommand---
; If your graphics card has above 4GB VRAM, please search in line #29:  e={[string][math]::round($_.AdapterRAM/1GB,2)}    replace it with:    e={[above_4gb_name]}
Now since you taught me about the HWiNFO Gadget thing with the ram, I kinda realized the CPU GHz frequency(on OSD and hover mouse) it wasn't correctly updating, it seemed to be stuck with these two for me 3.06/3057 and 3.40/3400(when I should be on usage between 4.3 and 5ghz, only at idle 3.06ghz). I decided to look into the Memory.ini file you gave me and finally understood how to implement the stuff from hwinfo(Edited Processor.ini and used Core Clocks for the Frequency) - besides copy pasting your written part, understanding what I need to change is giving it a new name inside the brackets [new_name_here] and then changing the ValueRaw# according to the index # on the hwinfo gadget, I then looked carefully in the code to find what I want to replace and use the [new_name_here] for it to work. Although I noticed it now any new gadget enabled I need to refix for all the index #'s. :P anyways thanks for teaching me that so I could correct or add stuff on my side. Your suite in mines has basically turned into a MSI Afterburner + HWiNFO64 mix.
User avatar
Yincognito
Rainmeter Sage
Posts: 6838
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MYiniMeter - A minimalistic title-bar skin suite

Post by Yincognito »

sendblink23 wrote: February 11th, 2022, 4:01 pmThe thing that I believe ...
Yep, it looks like the solution you mentioned is relatively stable. I found out that if I edit the value in registry (which by the way, exists in CurrentControlSet branch as well) Windows will overwrite it with the correct amount after restart, so I guess it's safe to use. Anyway, long story short, the new way will be there in the new version (among other things that still need some polishing). You can apply it by yourself already to test it out and let me know if it works properly, by editing [SkinsFolder]\MYiniMeter\Video\Video.ini and replace the [MS_RunCommand_VideoInfo] measure's Parameter option / line with:

Code: Select all

Parameter=-command $items = Get-CimInstance -classname Win32_VideoController -filter \"DeviceID like '%VideoController%'\" | select Name,@{n='AdapterRAM';e={[string][math]::round($_.'AdapterRAM'/1GB,2)}},CurrentNumberOfColors,Availability,CurrentBitsPerPixel,CurrentRefreshRate,CurrentScanMode,VideoArchitecture,VideoMemoryType,CurrentHorizontalResolution,CurrentVerticalResolution | sort PNPDeviceID; $edits = Get-ItemProperty -path \"HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*\" -name * -erroraction SilentlyContinue | select @{n='HardwareInformation.qwMemorySize';e={[string][math]::round($_.'HardwareInformation.qwMemorySize'/1GB,2)}} | sort MatchingDeviceId; for ($i=0; $i -lt $items.Count; $i++) {$items[$i].'AdapterRAM' = [string][math]::max($items[$i].'AdapterRAM',$edits[$i].'HardwareInformation.qwMemorySize')}; $items | format-list
That's all there is. This basically uses powershell to get the old info (sorted by the PNPDeviceID field of the said CIM class) in a variable called $items, the new info (sorted by the MatchingDeviceId key of the said registry path) in a variable called $edits, then iterates through all elements of the $items array variable to replace the old value of the AdapterRAM field with the maximum between the old value and the new one from the corresponding element and field of the $edits array variable.

Regarding the CPU thing, I believe that's already fixed in the (unreleased yet) 1.5.0 version of Processor.ini, you can confirm if you like, so that I'd know it works well on other computers when I'll release it:
Processor.ini

Yeah, you can turn the suite into a MSI AB - HWiNFO hybrid without problems, as long as you're happy with it - you learn new things in the process too. From a functional point of view I went with MSI AB also because at the time its querying syntax was much simpler than the HWiNFO one (though things have changed for the better in the latter case lately). Regarding editing skins, it's not extremely complicated, but you need a basic understanding of how things work (which you already started to acquire, of course). :thumbup:
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
sendblink23
Posts: 9
Joined: February 9th, 2022, 3:54 pm
Location: Puerto Rico

Re: MYiniMeter - A minimalistic title-bar skin suite

Post by sendblink23 »

Yincognito wrote: February 12th, 2022, 2:41 pm Yep, it looks like the solution you mentioned is relatively stable. I found out that if I edit the value in registry (which by the way, exists in CurrentControlSet branch as well) Windows will overwrite it with the correct amount after restart, so I guess it's safe to use. Anyway, long story short, the new way will be there in the new version (among other things that still need some polishing). You can apply it by yourself already to test it out and let me know if it works properly, by editing [SkinsFolder]\MYiniMeter\Video\Video.ini and replace the [MS_RunCommand_VideoInfo] measure's Parameter option / line with:

Code: Select all

Parameter=-command $items = Get-CimInstance -classname Win32_VideoController -filter \"DeviceID like '%VideoController%'\" | select Name,@{n='AdapterRAM';e={[string][math]::round($_.'AdapterRAM'/1GB,2)}},CurrentNumberOfColors,Availability,CurrentBitsPerPixel,CurrentRefreshRate,CurrentScanMode,VideoArchitecture,VideoMemoryType,CurrentHorizontalResolution,CurrentVerticalResolution | sort PNPDeviceID; $edits = Get-ItemProperty -path \"HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*\" -name * -erroraction SilentlyContinue | select @{n='HardwareInformation.qwMemorySize';e={[string][math]::round($_.'HardwareInformation.qwMemorySize'/1GB,2)}} | sort MatchingDeviceId; for ($i=0; $i -lt $items.Count; $i++) {$items[$i].'AdapterRAM' = [string][math]::max($items[$i].'AdapterRAM',$edits[$i].'HardwareInformation.qwMemorySize')}; $items | format-list
That's all there is. This basically uses powershell to get the old info (sorted by the PNPDeviceID field of the said CIM class) in a variable called $items, the new info (sorted by the MatchingDeviceId key of the said registry path) in a variable called $edits, then iterates through all elements of the $items array variable to replace the old value of the AdapterRAM field with the maximum between the old value and the new one from the corresponding element and field of the $edits array variable.

Regarding the CPU thing, I believe that's already fixed in the (unreleased yet) 1.5.0 version of Processor.ini, you can confirm if you like, so that I'd know it works well on other computers when I'll release it:
Processor.ini


Yeah, you can turn the suite into a MSI AB - HWiNFO hybrid without problems, as long as you're happy with it - you learn new things in the process too. From a functional point of view I went with MSI AB also because at the time its querying syntax was much simpler than the HWiNFO one (though things have changed for the better in the latter case lately). Regarding editing skins, it's not extremely complicated, but you need a basic understanding of how things work (which you already started to acquire, of course). :thumbup:
Sorry got lost in other stuff, nice you implementing it. Alright I just tested in the Video.ini replacing the Parameter line for MS_RunCommand_VideoInfo ...
Sadly it shows 4GB :/ hehe :P did also just in case restarted the PC to recheck, then retested the powershell command which was still working showing 12.

Testing the Processor.ini,
CPU usage % seems incorrect when I did a cinebench run it was over 100% - I max saw: 127.17% :rofl: - comparing HWinfo at idle its higher than it(note that the old cpu usage % was correct).
Frequency(GHz and MHz) seems nearly close to HWinfo so I will say yes that its good and reliable what you have there
User avatar
Yincognito
Rainmeter Sage
Posts: 6838
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MYiniMeter - A minimalistic title-bar skin suite

Post by Yincognito »

sendblink23 wrote: February 18th, 2022, 2:53 pmTesting the Processor.ini,
CPU usage % seems incorrect when I did a cinebench run it was over 100% - I max saw: 127.17% :rofl: - comparing HWinfo at idle its higher than it(note that the old cpu usage % was correct).
Frequency(GHz and MHz) seems nearly close to HWinfo so I will say yes that its good and reliable what you have there
Actually, the CPU usage is correct, depending on purpose and system, according to Microsoft (these are taken right from Perfmon.msc's counters):

% Processor Time (i.e. more or less what I used before):
% Processor Time is the percentage of elapsed time that the processor spends to execute a non-Idle thread. It is calculated by measuring the percentage of time that the processor spends executing the idle thread and then subtracting that value from 100%. (Each processor has an idle thread to which time is accumulated when no other threads are ready to run). This counter is the primary indicator of processor activity, and displays the average percentage of busy time observed during the sample interval. It should be noted that the accounting calculation of whether the processor is idle is performed at an internal sampling interval of the system clock tick. On todays fast processors, % Processor Time can therefore underestimate the processor utilization as the processor may be spending a lot of time servicing threads between the system clock sampling interval. Workload based timer applications are one example of applications which are more likely to be measured inaccurately as timers are signaled just after the sample is taken.
% Processor Utility (i.e. more or less what I use now or in the code I posted before):
Processor Utility is the amount of work a processor is completing, as a percentage of the amount of work the processor could complete if it were running at its nominal performance and never idle. On some processors, Processor Utility may exceed 100%.
For the record, the 2nd choice is used by Task Manager (though it might apply some clamping of values to make sure that it doesn't display a value greater than 100%, which can be easily done in Rainmeter as well). That being said, you can choose - or keep - whichever system you're the most comfortable with, it's not set in stone (not even for experts, go figure). For example, if you want the "old" CPU usages that you said are correct, but the "new" CPU frequency that matches what you know is right, use this "mix", dubbed version 1.4.5:
Processor.ini
The value of than 127% might be related to the difference between your nominal CPU frequency (probably the 3.4 GHz you mentioned) and your actual one (apparently 4.3 Ghz mostly), since 4.3/3.4 = 1.26. By the way, did you overclock your CPU?

sendblink23 wrote: February 18th, 2022, 2:53 pm Sorry got lost in other stuff, nice you implementing it. Alright I just tested in the Video.ini replacing the Parameter line for MS_RunCommand_VideoInfo ...
Sadly it shows 4GB :/ hehe :P did also just in case restarted the PC to recheck, then retested the powershell command which was still working showing 12.
Can you post a screenshot of the corresponding powershell command (which is basically what you have after -command in the Parameter option, bar the double quote escaping) from PowerShell:

Code: Select all

$items = Get-CimInstance -classname Win32_VideoController -filter "DeviceID like '%VideoController%'" | select Name,@{n='AdapterRAM';e={[string][math]::round($_.'AdapterRAM'/1GB,2)}},CurrentNumberOfColors,Availability,CurrentBitsPerPixel,CurrentRefreshRate,CurrentScanMode,VideoArchitecture,VideoMemoryType,CurrentHorizontalResolution,CurrentVerticalResolution | sort PNPDeviceID; $edits = Get-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*" -name * -erroraction SilentlyContinue | select @{n='HardwareInformation.qwMemorySize';e={[string][math]::round($_.'HardwareInformation.qwMemorySize'/1GB,2)}} | sort MatchingDeviceId; for ($i=0; $i -lt $items.Count; $i++) {$items[$i].'AdapterRAM' = [string][math]::max($items[$i].'AdapterRAM',$edits[$i].'HardwareInformation.qwMemorySize')}; $items | format-list
... or, even better, each of the two queries at a time:

Code: Select all

Get-CimInstance -classname Win32_VideoController -filter "DeviceID like '%VideoController%'" | select Name,@{n='AdapterRAM';e={[string][math]::round($_.'AdapterRAM'/1GB,2)}},CurrentNumberOfColors,Availability,CurrentBitsPerPixel,CurrentRefreshRate,CurrentScanMode,VideoArchitecture,VideoMemoryType,CurrentHorizontalResolution,CurrentVerticalResolution | sort PNPDeviceID
and

Code: Select all

Get-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*" -name * -erroraction SilentlyContinue | select @{n='HardwareInformation.qwMemorySize';e={[string][math]::round($_.'HardwareInformation.qwMemorySize'/1GB,2)}} | sort MatchingDeviceId
The said Parameter should work, because all it does is get the maximum between the value reported by the old method (the Win32_VideoController class) and the new one (from the registry key you mentioned). For example, here I edited and faked my VRAM value in the registry to show almost double than what I have (i.e. around 8 GB instead of the correct 4 GB, in my case), and the registry, powershell and my video skin are all showing the bigger registry value instead of the lesser 4 GB reported by the Win32_VideoController class:
VRAM.jpg
I also made sure the video cards are listed in the same order for the CIM class and the registry, since they are both ordered by their PNPDeviceID / MatchingDeviceId. :???:
You do not have the required permissions to view the files attached to this post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
sendblink23
Posts: 9
Joined: February 9th, 2022, 3:54 pm
Location: Puerto Rico

Re: MYiniMeter - A minimalistic title-bar skin suite

Post by sendblink23 »

Yincognito wrote: February 18th, 2022, 4:47 pm Actually, the CPU usage is correct, depending on purpose and system, according to Microsoft (these are taken right from Perfmon.msc's counters):

% Processor Time (i.e. more or less what I used before):

% Processor Utility (i.e. more or less what I use now or in the code I posted before):


For the record, the 2nd choice is used by Task Manager (though it might apply some clamping of values to make sure that it doesn't display a value greater than 100%, which can be easily done in Rainmeter as well). That being said, you can choose - or keep - whichever system you're the most comfortable with, it's not set in stone (not even for experts, go figure). For example, if you want the "old" CPU usages that you said are correct, but the "new" CPU frequency that matches what you know is right, use this "mix", dubbed version 1.4.5:
Processor.ini
The value of than 127% might be related to the difference between your nominal CPU frequency (probably the 3.4 GHz you mentioned) and your actual one (apparently 4.3 Ghz mostly), since 4.3/3.4 = 1.26. By the way, did you overclock your CPU?
No I have not overclocked it, at stock the PBO of the 5950x boosts up to 5.1ghz... 2 of the best cores do that, a few 5ghz and the rest between 4.9/4.7ghz. The 3.40ghz while its supposed to be the stock clock(according to AMD) but in reality like on mine its barely ever there, I see it mostly idling at 3.05ghz. Now when stressed(this is specific on cinebench) all cores do 4.4/4.3 depending how the cpu cooler is doing... if i do TestMem5 that pushes much higher it goes 4.5/4.6 all cores while destroying the ram nearly maxed out. This CPU runs depending of the CPU Cooler, the cooler it is the higher it will automatically go to... so its just wierd :P - we can say it automatically overclocks based on temps.

The higher idle % usage and the 127.6% stuff :P lol you mentioning the words Processor Utility... I missed that on HWiNFO that is "Total CPU Utility", but it should be "Core Usage" or "Total CPU Usage"(old code certainly goes close to that).
Image
:P so yeah the 127.6% was not wrong(which also shows higher idle from your previous new code), I just actually did not ever noticed that in HWiNFO hehee

Anyways using the new Processor.ini you just included its a good one mixed like that at least for mines how I like it :P
Can you post a screenshot of the corresponding powershell command (which is basically what you have after -command in the Parameter option, bar the double quote escaping) from PowerShell:

Code: Select all

$items = Get-CimInstance -classname Win32_VideoController -filter "DeviceID like '%VideoController%'" | select Name,@{n='AdapterRAM';e={[string][math]::round($_.'AdapterRAM'/1GB,2)}},CurrentNumberOfColors,Availability,CurrentBitsPerPixel,CurrentRefreshRate,CurrentScanMode,VideoArchitecture,VideoMemoryType,CurrentHorizontalResolution,CurrentVerticalResolution | sort PNPDeviceID; $edits = Get-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*" -name * -erroraction SilentlyContinue | select @{n='HardwareInformation.qwMemorySize';e={[string][math]::round($_.'HardwareInformation.qwMemorySize'/1GB,2)}} | sort MatchingDeviceId; for ($i=0; $i -lt $items.Count; $i++) {$items[$i].'AdapterRAM' = [string][math]::max($items[$i].'AdapterRAM',$edits[$i].'HardwareInformation.qwMemorySize')}; $items | format-list
... or, even better, each of the two queries at a time:

Code: Select all

Get-CimInstance -classname Win32_VideoController -filter "DeviceID like '%VideoController%'" | select Name,@{n='AdapterRAM';e={[string][math]::round($_.'AdapterRAM'/1GB,2)}},CurrentNumberOfColors,Availability,CurrentBitsPerPixel,CurrentRefreshRate,CurrentScanMode,VideoArchitecture,VideoMemoryType,CurrentHorizontalResolution,CurrentVerticalResolution | sort PNPDeviceID
and

Code: Select all

Get-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*" -name * -erroraction SilentlyContinue | select @{n='HardwareInformation.qwMemorySize';e={[string][math]::round($_.'HardwareInformation.qwMemorySize'/1GB,2)}} | sort MatchingDeviceId
The said Parameter should work, because all it does is get the maximum between the value reported by the old method (the Win32_VideoController class) and the new one (from the registry key you mentioned). For example, here I edited and faked my VRAM value in the registry to show almost double than what I have (i.e. around 8 GB instead of the correct 4 GB, in my case), and the registry, powershell and my video skin are all showing the bigger registry value instead of the lesser 4 GB reported by the Win32_VideoController class:
VRAM.jpg
I also made sure the video cards are listed in the same order for the CIM class and the registry, since they are both ordered by their PNPDeviceID / MatchingDeviceId. :???:
Image

Hopefully you can figure it out
User avatar
Yincognito
Rainmeter Sage
Posts: 6838
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MYiniMeter - A minimalistic title-bar skin suite

Post by Yincognito »

sendblink23 wrote: February 19th, 2022, 5:37 amAnyways using the new Processor.ini you just included its a good one mixed like that at least for mines how I like it :P
[...]
Hopefully you can figure it out
Excellent - at least one thing went out the way it was supposed to do, LOL. I also prefer having usages no more than 100%, and I eventually have to use that new utility counter since it allows multiple physical processors, thread count above 64, and so on. By the way, have you noticed when you had that 127% usage, was the frequency also close to the max? Cause the way I want it to be is to have "normal" 0 to 100% usages, but let the user correlate the usage with the frequency, e.g. 100% at 3 GHz is going to mean less usage than 100% at 4 GHz and such. There is a % Processor Performance counter which I already use in the skin to get the right frequency, maybe I can use it to proportionally lower down the utility counter values so that they don't go past 100% and more or less match what the old "counter" (i.e. what you have in your current code) yields. In other wors, I'd like to use the new counter (and take advantage of its benefits) to get the old (what you deemed correct) usages - will see what can be done.

The other issue is baffling, really. It's the same freaking code, which on my computer gives the correct result and on yours not. About the only difference between our systems is that I have 2 GPU cards (one integrated, one discrete) and you only have 1 (the discrete one), so the issue is either related to the index of the card or the way the max part is written. Can you please post here (either via copy pasting it into a code - the </> button - box or attaching a screenshot) the output of the following from PowerShell:

Code: Select all

$items = Get-CimInstance -classname Win32_VideoController -filter "DeviceID like '%VideoController%'" | select Name,@{n='AdapterRAM';e={[string][math]::round($_.'AdapterRAM'/1GB,2)}},CurrentNumberOfColors,Availability,CurrentBitsPerPixel,CurrentRefreshRate,CurrentScanMode,VideoArchitecture,VideoMemoryType,CurrentHorizontalResolution,CurrentVerticalResolution | sort PNPDeviceID; $edits = Get-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*" -name * -erroraction SilentlyContinue | select @{n='HardwareInformation.qwMemorySize';e={[string][math]::round($_.'HardwareInformation.qwMemorySize'/1GB,2)}} | sort MatchingDeviceId; write-host 'Item Count =' $items.Count; for ($i=0; $i -lt $items.Count; $i++) {write-host 'Item Index =' $i; write-host 'Item [' $i '] =' $items[$i]; write-host 'Edit [' $i '] =' $edits[$i]; write-host 'Item [' $i '].AdapterRAM =' $items[$i].'AdapterRAM'; write-host 'Edit [' $i '].HardwareInformation.qwMemorySize =' $edits[$i].'HardwareInformation.qwMemorySize'; write-host 'Max  ( Items [' $i '] , Edits [' $i '] ) =' [string][math]::max($items[$i].'AdapterRAM',$edits[$i].'HardwareInformation.qwMemorySize') '=' ([string][math]::max($items[$i].'AdapterRAM',$edits[$i].'HardwareInformation.qwMemorySize')); $items[$i].'AdapterRAM' = ([string][math]::max($items[$i].'AdapterRAM',$edits[$i].'HardwareInformation.qwMemorySize'))}; $items | format-list
Here, I output to the console everything, at each step of the process, so hopefully that will help more in identifying exactly where this process fails on your system. You can try the alternate method as well, it creates a whole new powershell object instead of modifying the first one, though it should output the same 4 GB and not the 12 GB:

Code: Select all

$items0 = Get-CimInstance -classname Win32_VideoController -filter "DeviceID like '%VideoController%'" | select Name,@{n='AdapterRAM';e={[string][math]::round($_.'AdapterRAM'/1GB,2)}},CurrentNumberOfColors,Availability,CurrentBitsPerPixel,CurrentRefreshRate,CurrentScanMode,VideoArchitecture,VideoMemoryType,CurrentHorizontalResolution,CurrentVerticalResolution | sort PNPDeviceID; $items1 = Get-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*" -name * -erroraction SilentlyContinue | select @{n='HardwareInformation.qwMemorySize';e={[string][math]::round($_.'HardwareInformation.qwMemorySize'/1GB,2)}} | sort MatchingDeviceId; $items = @(); for ($i=0; $i -lt $items0.Count; $i++) {$items += New-Object PSObject -Property @{'Name' = $items0[$i].'Name'; 'AdapterRAM' = [string][math]::max($items0[$i].'AdapterRAM',$items1[$i].'HardwareInformation.qwMemorySize'); 'CurrentNumberOfColors' = $items0[$i].'CurrentNumberOfColors'; 'Availability' = $items0[$i].'Availability'; 'CurrentBitsPerPixel' = $items0[$i].'CurrentBitsPerPixel'; 'CurrentRefreshRate' = $items0[$i].'CurrentRefreshRate'; 'CurrentScanMode' = $items0[$i].'CurrentScanMode'; 'VideoArchitecture' = $items0[$i].'VideoArchitecture'; 'VideoMemoryType' = $items0[$i].'VideoMemoryType'; 'CurrentHorizontalResolution' = $items0[$i].'CurrentHorizontalResolution'; 'CurrentVerticalResolution' = $items0[$i].'CurrentVerticalResolution'}}; $items | format-list
By the way, thanks for your patience and willingness to follow these steps and identify / correct these issues. Unfortunately, a skin designer usually has only his computer to test things out, so if problems appear for another user, his environment is best suited to debug whatever the problem is. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth