It is currently April 26th, 2024, 8:18 am

WAN & LAN and SysInfoType/s [SOLVED]

Get help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

WAN & LAN and SysInfoType/s [SOLVED]

Post by CodeCode »

Hello.
I got an idea from another topic thread, but without further reference, a bit of really nifty code took my interest:

Code: Select all

[Variables]
NICID=0

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

---Measures---

[measureAdapterName]
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_DESCRIPTION
SysInfoData=#NICID#
RegExpSubstitute=1
Substitute="(^$|^0$)":"Unavailable"
IfMatch=^.{2,}$
IfMatchAction=[!SetOption measureIP SysInfoData "[measureAdapterName]"]
IfNotMatchAction=[!SetOption measureIP SysInfoData 999]
IfMatchMode=1
DynamicVariables=1

[measureIP]
Measure=Plugin
Plugin=SysInfo
Group=SysInfo
SysInfoType=IP_ADDRESS
SysInfoData=
RegExpSubstitute=1
Substitute="(^$|^0$)":"Unavailable"
DynamicVariables=1

---Meters---

[meterNICInfo]
Meter=String
StringEffect=Shadow
FontEffectColor=0,0,0,50
SolidColor=47,47,47,255
FontColor=255,255,255,255
FontFace=Consolas
FontSize=16
AntiAlias=1
MeasureName=measureAdapterName
MeasureName2=measureIP
Text=Number : #NICID##CRLF#Adapter: %1#CRLF#IP     : %2
MouseScrollUpAction=[!SetVariable NICID (Clamp(#NICID#-1,0,20))][!UpdateMeasure *][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable NICID (Clamp(#NICID#+1,0,20))][!UpdateMeasure *][!UpdateMeter *][!Redraw]
DynamicVariables=1
I noticed that from that the IPs identified from SysInfoType=some number (1 to 20) for each adapter don't match the IPs identified from SysInfoType=Best.
I have a rather long bit of code of my own that allows the user to toggle between an abbreviated Adapter type eg "Realtek Gaming GbE Family Controller" or "Standard" for short, and the actual numerical IP address - in the interest of keeping things tidy depending on the users preferences.
Here is the whole thing (a long as it is):

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Variables]
@include=#@#RoundVariables.inc
m=>
n=>
Largest=10000000
MinValDn=#Largest#
MinValUp=#Largest#
Gothd=#Gothicd#
NICID=0

;==================================Styles=========================

[TextStyle]
FontFace=VertigoFLF
FontSize=31
FontColor=#GlobalFontAltColor#
AntiAlias=1

[TextStyle1]
FontFace=Segoe UI
FontSize=14
FontColor=#GlobalFontAltColor#
AntiAlias=1
StringStyle=Bold

[AllStyle]
FontSize=14
FontWeight=100
FontColor=#GlobalFontAltColor#
AntiAlias=1
DynamicVariables=1

[RightStyle]
StringAlign=Right

;==================================Measures=========================

[MeasureNetIn]
Measure=NetIn
updatedivider=2

[MeasureNetOut]
Measure=NetOut
updatedivider=2

[MeasureNetInC]
Measure=NetIn
Cumulative=1

[MeasureNetOutC]
Measure=NetOut
Cumulative=1

;===================================Calculations====================

[ValK]
updatedivider=-1
Measure=Calc
Formula=2048

[ValIn]
Measure=Calc
DynamicVariables=1
Formula=MeasureNetIn/1.05

[MeasureIN]
Measure=Calc
Formula=ValK > [ValIn] ? 0 : ValIn
DynamicVariables=1

[ValOut]
Measure=Calc
DynamicVariables=1
AverageSize=#avg#
Formula=MeasureNetOut/1.05

[MeasureNetInCumulative]
Measure=Calc
Formula=MeasureNetInC/6

[MeasureNetOutCumulative]
Measure=Calc
Formula=MeasureNetOutC/6

[MeasureOUT]
Measure=Calc
Formula=ValK > [ValOut] ? 0 : ValOut
DynamicVariables=1

[MeasureIN2]
Measure=Calc
Formula=(MeasureIN*2)/8.2
DynamicVariables=1

[MeasureOUT2]
Measure=Calc
Formula=(MeasureOUT*2)/16.8
DynamicVariables=1

[MeasureUpMax]
Measure=Calc
Formula=( Max ( MeasureUpMax, MeasureOUT2 ))

[MeasureUpMin]
Measure=Calc
Formula=(( #MinValUp# > 0 ) ? (( #MinValUp# > MeasureOUT2 ) ? MeasureOUT2 : #MinValUp# ) : #Largest# )
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!SetVariable MinValUp "[MeasureUpMin]"]
IfFalseAction=[!SetVariable MinValUp "#Largest#"]
IfConditionMode=1
DynamicVariables=1

[MeasureDnMax]
Measure=Calc
Formula=( Max ( MeasureDnMax, MeasureIN2 ))

[MeasureDnMin]
Measure=Calc
Formula=(( #MinValDn# > 0 ) ? (( #MinValDn# > MeasureIN2 ) ? MeasureIN2 : #MinValDn# ) : #Largest# )
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!SetVariable MinValDn "[MeasureDnMin]"]
IfFalseAction=[!SetVariable MinValDn "#Largest#"]
IfConditionMode=1
DynamicVariables=1

[SwitchUp]
Measure=Calc
Formula=0 < MeasureOUT2 ? 1 : 0
IfAboveValue=0
IfAboveAction=[!SetVariable m <]

[SwitchDn]
Measure=Calc
Formula=0 < MeasureIN2 ? 1 : 0
IfAboveValue=0
IfAboveAction=[!SetVariable n "<"][!UpdateMeasure "MeasureDnMin"]

[Val5]
updatedivider=-1
Measure=Calc
Formula=0

[Val6]
updatedivider=-1
Measure=Calc
Formula=1

;=====================================Shape=========================

[GraphBack]
Meter=Shape
Shape=Rectangle 43,45,913,202 | Fill Color 0,0,0,255 | StrokeWidth 1 | Stroke Color 0,0,0,255
AntiAlias=1

;=======================================Text Meters=================

[MeterTextSpeed]
UpdateDivider=-1
Meter=String
X=694
Y=42
MeterStyle=TextStyle1
StringAlign=right
Text="Speed"

[MeterTextMax]
UpdateDivider=-1
Meter=String
X=734
Y=r
MeterStyle=TextStyle1
StringAlign=left
Text="Maximum"

[MeterTextMin]
UpdateDivider=-1
Meter=String
X=845
Y=r
MeterStyle=TextStyle1
StringAlign=left
Text="Minimum"

[MeterTextUP]
Meter=String
X=505
Y=80
StringAlign=left
Text="UPLOAD"
DynamicVariables=1
FontFace=VertigoFLF
FontSize=31
StringCase=Upper
StringAlign=Left
StringEffect=Border
InlineSetting=Case | Upper
InlineSetting2=CharacterSpacing | .3 | .3
FontEffectColor=#VolMain#
FontColor=#NetFontColor1#
AntiAlias=1
StringStyle=Bold

[UpSpeed]
Meter=String
updatedivider=1
MeasureName=MeasureOUT2
X=219r
Y=-3r
StringAlign=right
MeterStyle=TextStyle
NumOfDecimals=2
AutoScale=1
Text="%1Bps"

[TextUpMin]
Meter=String
updatedivider=1
MeasureName=MeasureUpMin
X=220r
Y=r
MeterStyle=TextStyle
StringAlign=right
NumOfDecimals=2
AutoScale=1
Text=%1B

[TextUpMax]
updatedivider=1
Meter=String
MeasureName=MeasureUpMax
X=-110r
Y=r
MeterStyle=TextStyle
StringAlign=right
NumOfDecimals=2
AutoScale=1
Text=%1B
DynamicVariables=1

[MeterTextDN]
Meter=String
X=505
Y=147
StringAlign=left
Text="DOWNLOAD"
DynamicVariables=1
FontFace=VertigoFLF
FontSize=31
StringCase=Upper
StringAlign=Left
StringEffect=Border
InlineSetting=Case | Upper
InlineSetting2=CharacterSpacing | .3 | .3
FontEffectColor=#VolMain#
FontColor=#NetFontColor2#
AntiAlias=1
StringStyle=Bold

[DnSpeed]
Meter=String
updatedivider=1
MeasureName=MeasureIN2
X=219r
Y=-1r
StringAlign=right
MeterStyle=TextStyle
NumOfDecimals=2
AutoScale=1
Text="%1Bps"

[DnData]
Meter=String
updatedivider=1
MeasureName=MeasureDnMin
X=220r
Y=r
MeterStyle=TextStyle
StringAlign=right
NumOfDecimals=2
AutoScale=1
Text=%1B

[DnSession]
updatedivider=1
Meter=String
MeasureName=MeasureDnMax
X=-110r
Y=r
MeterStyle=TextStyle
StringAlign=right
NumOfDecimals=2
AutoScale=1
Text=%1B

;======================================Connectivity=================

[MeasureAdapter]
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_DESCRIPTION
SysInfoData=Best
Substitute="#IPSkinVPNFullName#":"Private  Internet  Adapter","#IPSkinAdapterFullName#":"Standard  Internet  Adapter"
DynamicVariables=1

[MeasureWANIP]
Measure=WebParser
Url=http://checkip.dyndns.org/%22
RegExp="(?siU)<body>(.+)Address: (.+)</body>"
StringIndex=2
UpdateDivider=1
OnChangeAction=[!SetOption MeterWANIP Text "Current IP: %1"][!UpdateMeasure "MeasureAdapter"][!UpdateMeter MeterWANIP][!Redraw]
DynamicVariables=1

[MeterTextAdapter]
Meter=String
MeasureName=MeasureAdapter
Fontsize=31
FontFace=VertigoFLF
AntiAlias=1
X=503
Y=202
StringAlign=Left
FontColor=#GlobalFontAltColor#
InlineSetting=CharacterSpacing | .7 | .7
Hidden=0
Group=ADAP

[MeterWANIP]
Meter=String
MeasureName=MeasureWANIP
X=503
Y=202
StringAlign=Left
FontColor=#GlobalFontAltColor#
Fontsize=31
FontFace=VertigoFLF
AntiAlias=1
InlineSetting=CharacterSpacing | .7 | .7
Text=
DynamicVariables=1
Hidden=1
Group=VPN

[TextOpenVPN]
Meter=String
updatedivider=1
SolidColor=0,0,0,1
X=945
Y=r
FontColor=#GlobalFontAltColor#
Fontsize=31
FontFace=VertigoFLF
AntiAlias=1
StringAlign=right
Text=@VPN
InlineSetting=CharacterSpacing | .7 | .7
LeftMouseUpAction=#VPNFullPath#
Hidden=0
Group=

[FPSClickBig]
Meter=Image
X=490
Y=203
W=240
H=45
LeftMouseUpAction=[!ToggleMeterGroup ADAP][!ToggleMeterGroup VPN][!Update]
SolidColor=0,0,0,1

;=====================================Lines=========================

[MeterGraph0]
Meter=Line
MeasureName=MeasureOUT2
MeasureName2=MeasureIN2
X=0
Y=44
H=200
W=28
LineCount=2
LineWidth=3
LineColor=#NetLineColorOut#
LineColor2=#NetLineColorIn1#
Autoscale=1
AntiAlias=1
UpdateDivider=1
TransformationMatrix=16.52; 0; 0; 1; 44; 0
TransformStroke=Fixed

[MeterGraph2]
Meter=Line
MeasureName=MeasureOUT2
MeasureName2=MeasureIN2
X=0
Y=45
H=199
W=28
LineCount=2
LineWidth=1
LineColor=#NetLineColorIn2#
Autoscale=1
AntiAlias=1
UpdateDivider=1
TransformationMatrix=16.52; 0; 0; 1; 44; 0
TransformStroke=Fixed

;=========================================Boxes=====================

[MeterUpLeft]
Meter=Image
ImageName=#@#Border.png
ImageTint=#VolMain#
X=0
Y=0
W=130
H=130
AntiAlias=1
Group=Stat Border

[ScrollR]
Meter=Image
ImageName=#@#Edge.png
ImageFlip=Vertical
ImageTint=#VolMain#
X=([CentreText:X]-[ScrollL:W] -4)
Y=14
W=133
H=26
DynamicVariables=1
Group=ExtHUD | Scroll
Hidden=0

[CentreText]
Meter=String
MeasureName=MeasureUPTIME
X=490
Y=-10r
StringAlign=Center
Text=" Computer Uptime: %1 "
InlineSetting=Case | Upper
InlineSetting2=CharacterSpacing | .5 | .5
InlineSetting3=CharacterSpacing | -3.5 | 2.0
InlinePattern3=a|A
FontColor=#GlobalFontAltColor# 
FontFace=VertigoFLF
FontSize=24

[ScrollL]
Meter=Image
ImageName=#@#Edge.png
ImageFlip=Both
ImageTint=#VolMain#
X=([CentreText:X]+[CentreText:W] +11)
Y=8r
W=133
H=26
DynamicVariables=1
Group=ExtHUD | Scroll
Hidden=0

[MeterUpRight]
Meter=Image
ImageFlip=Horizontal
ImageName=#@#Border.png
ImageTint=#VolMain#
X=869
Y=0
W=130
H=130
AntiAlias=1
Group=Stat Border

[MeterLowLeft]
Meter=Image
ImageFlip=Vertical
ImageName=#@#Border.png
ImageTint=#VolMain#
X=0
Y=163
W=130
H=130
AntiAlias=1
Group=Stat Border

[VictorianB]
Meter=Image
ImageName=#@#Victorian.png
ImageTint=#VolMain#
X=285
Y=254
W=420
H=30
AntiAlias=1
Group=Stat Border

[MeterLowRight]
Meter=Image
ImageFlip=Both
ImageName=#@#Border.png
ImageTint=#VolMain#
X=869
Y=163
W=130
H=130
AntiAlias=1
Group=Stat Border

[MeterUpInLeft]
Meter=Image
ImageName=#@#Corner.png
ImageTint=#VolMain#
X=47
Y=48
W=45
H=45
AntiAlias=1
Group=Stat Border

[MeterUpInRight]
Meter=Image
ImageName=#@#Corner.png
ImageFlip=Horizontal
ImageTint=#VolMain#
X=442
Y=48
W=45
H=45
AntiAlias=1
Group=Stat Border

[MeterDnInLeft]
Meter=Image
ImageName=#@#Corner.png
ImageFlip=Vertical
ImageTint=#VolMain#
X=47
Y=202
W=45
H=45
AntiAlias=1
Group=Stat Border

[MeterDnInRight]
Meter=Image
ImageName=#@#Corner.png
ImageFlip=Both
ImageTint=#VolMain#
X=442
Y=202
W=45
H=45
AntiAlias=1
Group=Stat Border

[LowerHoriz]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=(0+43)
Y=(205+43)
H=2
W=912
LineWidth=2
LineColor=#NetBorder#

[TopLine]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=(0+43)
Y=(0+43)
H=2
W=912
LineWidth=2
LineColor=#NetBorder#

[Line1]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=(447+43)
Y=(-177+43)
H=200
W=466
LineWidth=2
LineColor=#NetBorder#

[Line2]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=(447+43)
Y=(-107+43)
H=200
W=466
LineColor=#Main#

[Line3]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=(447+43)
Y=(-39+43)
H=200
W=466
LineWidth=2
LineColor=#Main#

[Bar0]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#NetBorder#
H=205
W=2
X=(0+43)
Y=(0+43)

[Bar01]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=0,0,0,255
H=200
W=3
X=(2+43)
Y=(2+43)

[Bar1]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#Main#
H=160
W=1
X=(561+43)
Y=(1+43)

[Bar2]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#Main#
H=160
W=1
X=(686+43)
Y=(1+43)

[Bar3]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#Main#
H=160
W=1
X=(796+43)
Y=(1+43)

[Bar04]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=0,0,0,255
H=200
W=2
X=(445+43)
Y=(2+43)

[Bar4]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#NetBorder#
H=205
W=2
X=(447+43)
Y=(1+43)

[Bar6]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#NetBorder#
H=207
W=2
X=954
Y=43

[MeterImageClick]
Meter=Image
W=105
H=80
X=(457+43)
Y=(20+43)
DynamicVariables=1
LeftMouseUpAction=[!Refresh]
SolidColor=0,0,0,1
The images are just for appearances and I didn't include those so I attached the skin (which is rather long and involved).
Apologies for the large chunks here.
So the first question is how can I somehow have both the LAN and the WAN be available within the function of the skin? (there are several questions, all in their own time though). The click action go between the adapter type with the option of entering the physical name found with the much simpler and pragmantical code provided by Yincognito (the first bit of code),and the numerical IPs.
The scroll action would cycle through the available IPs both WAN and LAN, as well as the physical names in the default 'unclicked' options added on the Variables.inc.
Again apologies if this seems very long, but my design is meant to be both 'pretty' and functional - but not without some preparations by editing the Variables.inc. (see attached).
The skin that is relevant to these questions is named "Mega Net.ini".
Victorian Monitors Mini Suite_1.0.rmskin
You do not have the required permissions to view the files attached to this post.
Last edited by CodeCode on August 11th, 2021, 1:26 am, edited 1 time in total.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
Yincognito
Rainmeter Sage
Posts: 7165
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: WAN & LAN and SysInfoType/s

Post by Yincognito »

CodeCode wrote: August 7th, 2021, 4:14 pmSo the first question is how can I somehow have both the LAN and the WAN be available within the function of the skin? (there are several questions, all in their own time though). The click action go between the adapter type with the option of entering the physical name found with the much simpler and pragmantical code provided by Yincognito (the first bit of code),and the numerical IPs.
The scroll action would cycle through the available IPs both WAN and LAN, as well as the physical names in the default 'unclicked' options added on the Variables.inc.
Again apologies if this seems very long, but my design is meant to be both 'pretty' and functional - but not without some preparations by editing the Variables.inc. (see attached).
The skin that is relevant to these questions is named "Mega Net.ini".
Wow, that's not Mega Net, it's mega skin, LOL. Joking aside, a bit of clarification is needed (a bit of simplification too, but anyway):
- you want to be able to scroll on both LAN and WAN adapter names and IPs?
- what is the meaning of "in the default 'unclicked' options added on the Variables.inc"?
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
SilverAzide
Rainmeter Sage
Posts: 2610
Joined: March 23rd, 2015, 5:26 pm

Re: WAN & LAN and SysInfoType/s

Post by SilverAzide »

CodeCode wrote: August 7th, 2021, 4:14 pm Hello.
I noticed that from that the IPs identified from SysInfoType=some number (1 to 20) for each adapter don't match the IPs identified from SysInfoType=Best.
In regard to this particular observation of yours... (I assume you meant SysInfoData=some number.) The SysInfoData number value is the index of your network adapter interface. You most likely have a LOT of these, much more than 20. I have like 50+. The reason is that Windows and other software creates many "virtual network adapters", so most of these are not real.

If you want to see the exact list, one trick is to start Rainmeter in debug mode. Open the Rainmeter Manage dialog, select both logging options, then restart Rainmeter). Return to the logging options and click the "Show log file" button. You'll see a dump of all your network interfaces. The line "Hardware=No" means it's virtual, so find a line "Hardware=Yes". It will look like this:

Code: Select all

DBUG (16:11:55.274) : 12: Killer E2400 Gigabit Ethernet Controller
DBUG (16:11:55.274) :   Alias: Ethernet
DBUG (16:11:55.275) :   Type=Ethernet(6), Hardware=Yes, Filter=No
Notice the index ("12" in this case). That's the number you need in the SysInfoData option. This number will not be consistent in most cases, so it can change, so I would not rely on it. Your best bet is to use the full network adapter names, as shown in the log ("Killer E2400 Gigabit Ethernet Controller" in this example). Ignore anything where "Hardware=No".

Finally, there is a much simpler way to get the list of network adapters. Using PowerShell, run the following command:

Code: Select all

Get-WmiObject -Class MSFT_NetAdapter -Namespace root\StandardCimv2 | Sort-Object -Property InterfaceType, Virtual, InterfaceDescription | Format-Table -Property InterfaceDescription, Name, Virtual, InterfaceType -AutoSize
The "InterfaceDescription" column values are the names you need, same as what is in the Rainmeter log. The Virtual column will correspond to the "Hardware" value in the log (Virtual=False means Hardware=Yes).

Finally, the Rainmeter "SysInfoData=Best" option means that Rainmeter attempts to determine which of your many network interfaces is the active one, and selects it for you. If you are trying to create a skin that sees all your network adapters, you will not want to use this option and instead use the actual names; but for a typical skin where you just want it to use the active one, using this option the "Best" approach. ;-)
Gadgets Wiki GitHub More Gadgets...
User avatar
SilverAzide
Rainmeter Sage
Posts: 2610
Joined: March 23rd, 2015, 5:26 pm

Re: WAN & LAN and SysInfoType/s

Post by SilverAzide »

CodeCode wrote: August 7th, 2021, 4:14 pm So the first question is how can I somehow have both the LAN and the WAN be available within the function of the skin?
For this question, you just need to create separate sets of Net/SysInfo measures for each of the hardware adapters you have. Use the info I gave you above to get the adapter names you need.
Gadgets Wiki GitHub More Gadgets...
User avatar
Yincognito
Rainmeter Sage
Posts: 7165
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: WAN & LAN and SysInfoType/s

Post by Yincognito »

One other thing: while the scrolling through the NICs can easily be done, the box where you display the adapter's name and the font / size you use doesn't allow displaying both the name and the IP, not to mention the WAN IP, which is just a single value...

I was thinking of a scroll based adapter name (using ClipString=1 for longer names) display, and middle click to alternatively display the IP for that adapter, right click to display the WAN IP. Is this feasible?
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: WAN & LAN and SysInfoType/s

Post by CodeCode »

SilverAzide wrote: August 7th, 2021, 5:26 pm For this question, you just need to create separate sets of Net/SysInfo measures for each of the hardware adapters you have. Use the info I gave you above to get the adapter names you need.
Ok. I was hoping there was some versatility in this, whereas, some kind of 'anyone can use this tool' capability.
That was my hope in terms of design 'like my example ini' - that is to say the standard and private adapters regardless of the length of the returned string value of either adapter, would be easily acquired, but I sort of figured those things out when I used the pretty cool skin Yincognito provided in another thread (the first in my OP).

So scrolling through the multitude of virtual adapters is really pointless.

Unless there is a tidy way of getting only the 'real' adapters and relevant IP addresses, such as the wifi a system was accessing or had that ability to access. That would be cool in my view, and then inside my example skin a mouse scroll would reveal the adapter names and IP addresses associated with each adapter type.

My op being so lengthy, might just serve as a starting point for me to find or be helped to find functionality options, rather than be a strict guideline for the rest of the replies in this thread.

Ongoing replies are truly appreciated. :great:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: WAN & LAN and SysInfoType/s

Post by CodeCode »

Yincognito wrote: August 7th, 2021, 6:15 pm One other thing: while the scrolling through the NICs can easily be done, the box where you display the adapter's name and the font / size you use doesn't allow displaying both the name and the IP, not to mention the WAN IP, which is just a single value...

I was thinking of a scroll based adapter name (using ClipString=1 for longer names) display, and middle click to alternatively display the IP for that adapter, right click to display the WAN IP. Is this feasible?
Definitely a place to start. :thumbup:
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
Yincognito
Rainmeter Sage
Posts: 7165
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: WAN & LAN and SysInfoType/s

Post by Yincognito »

CodeCode wrote: August 7th, 2021, 6:19 pm Definitely a place to start. :thumbup:
Ok, but those will include virtual adapters as well, in its simplest form. If you want to exclude them, something like SilverAzide suggested with the PowerShell command would be suited. As you could notice, the latter will increase complexity a little bit, and make getting those adapters slightly slower since PowerShell needs some time to execute.

I'll see what I can do for the simplest implementation, then we'll see if that suits you, ok?
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7165
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: WAN & LAN and SysInfoType/s

Post by Yincognito »

CodeCode wrote: August 7th, 2021, 6:19 pm Definitely a place to start. :thumbup:
Ok, so, a place to start (I added some variables, moved the NICGroup measures up in the code as their order is important, added the mentioned mouse actions in [MeterTextAdapter] and commented out the following 2 meters because they overlapped the former; the MeasureNames and Text options from [MeterTextAdapter] are dynamically modified from all kinds of places, so make sure you understand what happens; also, although probably desirable, better not modify [MeasureNICID] substitute, since the 2nd one should be let that way):

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Variables]
@include=#@#MegaVariables.inc
m=>
n=>
Largest=10000000
MinValDn=#Largest#
MinValUp=#Largest#
Gothd=#Gothicd#

NICIDDefault=-1
NICID=0
MeasureNameFormat0=%[#*MeasureNameIndex*]
MeasureNameFormat1=%3
MeasureNameIndex=1
MeasureNameFormatIndex=0

;==================================Styles=========================

[TextStyle]
FontFace=VertigoFLF
FontSize=31
FontColor=#GlobalFontAltColor#
AntiAlias=1

[TextStyle1]
FontFace=Segoe UI
FontSize=14
FontColor=#GlobalFontAltColor#
AntiAlias=1
StringStyle=Bold

[AllStyle]
FontSize=14
FontWeight=100
FontColor=#GlobalFontAltColor#
AntiAlias=1
DynamicVariables=1

[RightStyle]
StringAlign=Right

;==================================Measures=========================

[MeasureNICID]
Group=NICGroup
Measure=Calc
Formula=#NICIDDefault#
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^-2$":"Total","^-1$":"Best"
OnUpdateAction=[!SetVariable NICID [MeasureNICID]]
DynamicVariables=1

[MeasureAdapter]
Group=NICGroup
Measure=Plugin
Plugin=SysInfo
SysInfoType=ADAPTER_DESCRIPTION
SysInfoData=#NICID#
RegExpSubstitute=1
Substitute="(?:^\s+|\s+$)":"","(^$|^0$)":"Unavailable Adapter","#IPSkinVPNFullName#":"Private  Internet  Adapter","#IPSkinAdapterFullName#":"Standard  Internet  Adapter"
IfCondition=MeasureNICID=-2
IfTrueAction=[!SetOptionGroup NetGroup Interface 0][!SetOption MeasureNICIPAddress SysInfoData 0][!SetOption MeterTextAdapter MeasureName "MeasureNICID"]
IfCondition2=MeasureNICID=-1
IfTrueAction2=[!SetOptionGroup NetGroup Interface [MeasureAdapter]][!SetOption MeasureNICIPAddress SysInfoData [MeasureAdapter]][!SetOption MeterTextAdapter MeasureName "MeasureNICID"]
IfCondition3=MeasureNICID>=0
IfTrueAction3=[!SetOptionGroup NetGroup Interface [MeasureAdapter]][!SetOption MeasureNICIPAddress SysInfoData [MeasureAdapter]][!SetOption MeterTextAdapter MeasureName "MeasureAdapter"]
IfConditionMode=1
IfMatch=^.{2,}$
IfMatchAction=[!EnableMeasureGroup NetGroup][!EnableMeasure MeasureNICIPAddress]
IfNotMatchAction=[!DisableMeasureGroup NetGroup][!SetOption MeasureNICIPAddress SysInfoData 999]
IfMatchMode=1
DynamicVariables=1

[MeasureNetIn]
Group=NICGroup | NetGroup
Measure=NetIn
Interface=
updatedivider=2
DynamicVariables=1

[MeasureNetOut]
Group=NICGroup | NetGroup
Measure=NetOut
Interface=
updatedivider=2
DynamicVariables=1

[MeasureNetInC]
Group=NICGroup | NetGroup
Measure=NetIn
Interface=
Cumulative=1
DynamicVariables=1

[MeasureNetOutC]
Group=NICGroup | NetGroup
Measure=NetOut
Interface=
Cumulative=1
DynamicVariables=1

[MeasureNICIPAddress]
Group=NICGroup
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfoData=
RegExpSubstitute=1
Substitute="(?:^\s+|\s+$)":"","(^$|^0$)":"Unavailable LAN IP"

;===================================Calculations====================

[ValK]
updatedivider=-1
Measure=Calc
Formula=2048

[ValIn]
Measure=Calc
DynamicVariables=1
Formula=MeasureNetIn/1.05

[MeasureIN]
Measure=Calc
Formula=ValK > [ValIn] ? 0 : ValIn
DynamicVariables=1

[ValOut]
Measure=Calc
DynamicVariables=1
AverageSize=#avg#
Formula=MeasureNetOut/1.05

[MeasureNetInCumulative]
Measure=Calc
Formula=MeasureNetInC/6

[MeasureNetOutCumulative]
Measure=Calc
Formula=MeasureNetOutC/6

[MeasureOUT]
Measure=Calc
Formula=ValK > [ValOut] ? 0 : ValOut
DynamicVariables=1

[MeasureIN2]
Measure=Calc
Formula=(MeasureIN*2)/8.2
DynamicVariables=1

[MeasureOUT2]
Measure=Calc
Formula=(MeasureOUT*2)/16.8
DynamicVariables=1

[MeasureUpMax]
Measure=Calc
Formula=( Max ( MeasureUpMax, MeasureOUT2 ))

[MeasureUpMin]
Measure=Calc
Formula=(( #MinValUp# > 0 ) ? (( #MinValUp# > MeasureOUT2 ) ? MeasureOUT2 : #MinValUp# ) : #Largest# )
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!SetVariable MinValUp "[MeasureUpMin]"]
IfFalseAction=[!SetVariable MinValUp "#Largest#"]
IfConditionMode=1
DynamicVariables=1

[MeasureDnMax]
Measure=Calc
Formula=( Max ( MeasureDnMax, MeasureIN2 ))

[MeasureDnMin]
Measure=Calc
Formula=(( #MinValDn# > 0 ) ? (( #MinValDn# > MeasureIN2 ) ? MeasureIN2 : #MinValDn# ) : #Largest# )
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!SetVariable MinValDn "[MeasureDnMin]"]
IfFalseAction=[!SetVariable MinValDn "#Largest#"]
IfConditionMode=1
DynamicVariables=1

[SwitchUp]
Measure=Calc
Formula=0 < MeasureOUT2 ? 1 : 0
IfAboveValue=0
IfAboveAction=[!SetVariable m <]

[SwitchDn]
Measure=Calc
Formula=0 < MeasureIN2 ? 1 : 0
IfAboveValue=0
IfAboveAction=[!SetVariable n "<"][!UpdateMeasure "MeasureDnMin"]

[Val5]
updatedivider=-1
Measure=Calc
Formula=0

[Val6]
updatedivider=-1
Measure=Calc
Formula=1

;=====================================Shape=========================

[GraphBack]
Meter=Shape
Shape=Rectangle 43,45,913,202 | Fill Color 0,0,0,255 | StrokeWidth 1 | Stroke Color 0,0,0,255
AntiAlias=1

;=======================================Text Meters=================

[MeterTextSpeed]
UpdateDivider=-1
Meter=String
X=694
Y=42
MeterStyle=TextStyle1
StringAlign=right
Text="Speed"

[MeterTextMax]
UpdateDivider=-1
Meter=String
X=734
Y=r
MeterStyle=TextStyle1
StringAlign=left
Text="Maximum"

[MeterTextMin]
UpdateDivider=-1
Meter=String
X=845
Y=r
MeterStyle=TextStyle1
StringAlign=left
Text="Minimum"

[MeterTextUP]
Meter=String
X=505
Y=80
StringAlign=left
Text="UPLOAD"
DynamicVariables=1
FontFace=VertigoFLF
FontSize=31
StringCase=Upper
StringAlign=Left
StringEffect=Border
InlineSetting=Case | Upper
InlineSetting2=CharacterSpacing | .3 | .3
FontEffectColor=#VolMain#
FontColor=#NetFontColor1#
AntiAlias=1
StringStyle=Bold

[UpSpeed]
Meter=String
updatedivider=1
MeasureName=MeasureOUT2
X=219r
Y=-3r
StringAlign=right
MeterStyle=TextStyle
NumOfDecimals=2
AutoScale=1
Text="%1Bps"

[TextUpMin]
Meter=String
updatedivider=1
MeasureName=MeasureUpMin
X=220r
Y=r
MeterStyle=TextStyle
StringAlign=right
NumOfDecimals=2
AutoScale=1
Text=%1B

[TextUpMax]
updatedivider=1
Meter=String
MeasureName=MeasureUpMax
X=-110r
Y=r
MeterStyle=TextStyle
StringAlign=right
NumOfDecimals=2
AutoScale=1
Text=%1B
DynamicVariables=1

[MeterTextDN]
Meter=String
X=505
Y=147
StringAlign=left
Text="DOWNLOAD"
DynamicVariables=1
FontFace=VertigoFLF
FontSize=31
StringCase=Upper
StringAlign=Left
StringEffect=Border
InlineSetting=Case | Upper
InlineSetting2=CharacterSpacing | .3 | .3
FontEffectColor=#VolMain#
FontColor=#NetFontColor2#
AntiAlias=1
StringStyle=Bold

[DnSpeed]
Meter=String
updatedivider=1
MeasureName=MeasureIN2
X=219r
Y=-1r
StringAlign=right
MeterStyle=TextStyle
NumOfDecimals=2
AutoScale=1
Text="%1Bps"

[DnData]
Meter=String
updatedivider=1
MeasureName=MeasureDnMin
X=220r
Y=r
MeterStyle=TextStyle
StringAlign=right
NumOfDecimals=2
AutoScale=1
Text=%1B

[DnSession]
updatedivider=1
Meter=String
MeasureName=MeasureDnMax
X=-110r
Y=r
MeterStyle=TextStyle
StringAlign=right
NumOfDecimals=2
AutoScale=1
Text=%1B

;======================================End Text=====================

[MBuild]
Measure=Registry
RegHKey=HKEY_LOCAL_MACHINE
RegKey=SOFTWARE\Microsoft\Windows NT\CurrentVersion
RegValue=CurrentBuild
DynamicVariables=1
UpdateDivider=-1

[MeasureProcessOne]
Measure=Plugin
Plugin=Process
ProcessName=#NetProcessName#
Substitute="-1":"OS Build: [MBuild]","^1$":" #NetSkinProcessText# "
RegExpSubstitute=1
DynamicVariables=1
Group=RHUD

[MeasureGPU1Name]
Measure=Plugin
Plugin=MSIAfterburner.dll
GPU=0
GPUDescriptor=DisplayName
UpdateDivider=-1

[MeasureUPTIME]
Measure=uptime
Format=%4!02i!:%3!02i!:%2!02i!:%1!02i!

;======================================Connectivity=================<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

[MeasureWANIP]
Measure=WebParser
Url=http://checkip.dyndns.org/%22
RegExp="(?siU)<body>(.+)Address: (.+)</body>"
StringIndex=2
;OnChangeAction=[!SetOption MeterWANIP Text "Current IP: %1"][!!UpdateMeasure "MeasureAdapter"][!UpdateMeter MeterWANIP][!UpdateMeter MeterIfVPN][!Redraw]
DynamicVariables=1

[MeterTextAdapter]
Meter=String
MeasureName=MeasureAdapter
MeasureName2=MeasureNICIPAddress
MeasureName3=MeasureWANIP
Fontsize=31
FontFace=VertigoFLF
AntiAlias=1
ClipString=1
X=503
Y=202
W=(945-503)
StringAlign=Left
FontColor=#GlobalFontAltColor#
InlineSetting=CharacterSpacing | .7 | .7
Hidden=0
Group=ADAP
Text=[#MeasureNameFormat[#MeasureNameFormatIndex]]
MouseScrollUpAction=[!SetOption MeasureNICID Formula (Clamp([MeasureNICID:]-1,-2,20))][!UpdateMeasureGroup NICGroup][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetOption MeasureNICID Formula (Clamp([MeasureNICID:]+1,-2,20))][!UpdateMeasureGroup NICGroup][!UpdateMeter *][!Redraw]
MiddleMouseUpAction=[!SetVariable MeasureNameIndex (3-#MeasureNameIndex#)][!UpdateMeter MeterTextAdapter][!Redraw]
RightMouseUpAction=[!SetVariable MeasureNameFormatIndex (1-#MeasureNameFormatIndex#)][!UpdateMeter MeterTextAdapter][!Redraw]
DynamicVariables=1

; [MeterWANIP]
; Meter=String
; MeasureName=MeasureWANIP
; X=503
; Y=202
; StringAlign=Left
; FontColor=#GlobalFontAltColor#
; Fontsize=31
; FontFace=VertigoFLF
; AntiAlias=1
; InlineSetting=CharacterSpacing | .7 | .7
; Text=
; DynamicVariables=1
; Hidden=1
; Group=VPN

; [TextOpenVPN]
; Meter=String
; updatedivider=1
; SolidColor=0,0,0,1
; X=945
; Y=r
; FontColor=#GlobalFontAltColor#
; Fontsize=31
; FontFace=VertigoFLF
; AntiAlias=1
; StringAlign=right
; Text=@VPN
; InlineSetting=CharacterSpacing | .7 | .7
; LeftMouseUpAction=#VPNFullPath#
; Hidden=0
; Group=

[FPSClickBig]
Meter=Image
X=490
Y=203
W=240
H=45
LeftMouseUpAction=[!ToggleMeterGroup ADAP][!ToggleMeterGroup VPN][!Update]
SolidColor=0,0,0,1

;=====================================Lines=========================

[MeterGraph0]
Meter=Line
MeasureName=MeasureOUT2
MeasureName2=MeasureIN2
X=0
Y=44
H=200
W=28
LineCount=2
LineWidth=3
LineColor=#NetLineColorOut#
LineColor2=#NetLineColorIn1#
Autoscale=1
AntiAlias=1
UpdateDivider=1
TransformationMatrix=16.52; 0; 0; 1; 44; 0
TransformStroke=Fixed

[MeterGraph2]
Meter=Line
MeasureName=MeasureOUT2
MeasureName2=MeasureIN2
X=0
Y=45
H=199
W=28
LineCount=2
LineWidth=1
LineColor=#NetLineColorIn2#
Autoscale=1
AntiAlias=1
UpdateDivider=1
TransformationMatrix=16.52; 0; 0; 1; 44; 0
TransformStroke=Fixed

;=========================================Boxes=====================

[MeterUpLeft]
Meter=Image
ImageName=#@#Border.png
ImageTint=#VolMain#
X=0
Y=0
W=130
H=130
AntiAlias=1
Group=Stat Border

[ScrollR]
Meter=Image
ImageName=#@#Edge.png
ImageFlip=Vertical
ImageTint=#VolMain#
X=([CentreText:X]-[ScrollL:W] -4)
Y=14
W=133
H=26
DynamicVariables=1
Group=ExtHUD | Scroll
Hidden=0

[CentreText]
Meter=String
MeasureName=MeasureUPTIME
X=490
Y=-10r
StringAlign=Center
Text=" Computer Uptime: %1 "
InlineSetting=Case | Upper
InlineSetting2=CharacterSpacing | .5 | .5
InlineSetting3=CharacterSpacing | -3.5 | 2.0
InlinePattern3=a|A
FontColor=#GlobalFontAltColor# 
FontFace=VertigoFLF
FontSize=24

[ScrollL]
Meter=Image
ImageName=#@#Edge.png
ImageFlip=Both
ImageTint=#VolMain#
X=([CentreText:X]+[CentreText:W] +11)
Y=8r
W=133
H=26
DynamicVariables=1
Group=ExtHUD | Scroll
Hidden=0

[MeterUpRight]
Meter=Image
ImageFlip=Horizontal
ImageName=#@#Border.png
ImageTint=#VolMain#
X=869
Y=0
W=130
H=130
AntiAlias=1
Group=Stat Border

[MeterLowLeft]
Meter=Image
ImageFlip=Vertical
ImageName=#@#Border.png
ImageTint=#VolMain#
X=0
Y=163
W=130
H=130
AntiAlias=1
Group=Stat Border

[VictorianB]
Meter=Image
ImageName=#@#Victorian.png
ImageTint=#VolMain#
X=285
Y=254
W=420
H=30
AntiAlias=1
Group=Stat Border

[MeterLowRight]
Meter=Image
ImageFlip=Both
ImageName=#@#Border.png
ImageTint=#VolMain#
X=869
Y=163
W=130
H=130
AntiAlias=1
Group=Stat Border

[MeterUpInLeft]
Meter=Image
ImageName=#@#Corner.png
ImageTint=#VolMain#
X=47
Y=48
W=45
H=45
AntiAlias=1
Group=Stat Border

[MeterUpInRight]
Meter=Image
ImageName=#@#Corner.png
ImageFlip=Horizontal
ImageTint=#VolMain#
X=442
Y=48
W=45
H=45
AntiAlias=1
Group=Stat Border

[MeterDnInLeft]
Meter=Image
ImageName=#@#Corner.png
ImageFlip=Vertical
ImageTint=#VolMain#
X=47
Y=202
W=45
H=45
AntiAlias=1
Group=Stat Border

[MeterDnInRight]
Meter=Image
ImageName=#@#Corner.png
ImageFlip=Both
ImageTint=#VolMain#
X=442
Y=202
W=45
H=45
AntiAlias=1
Group=Stat Border

[LowerHoriz]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=43
Y=248
H=2
W=912
LineWidth=2
LineColor=#NetBorder#

[TopLine]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=43
Y=43
H=2
W=912
LineWidth=2
LineColor=#NetBorder#

[Line1]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=490
Y=-134
H=200
W=466
LineWidth=2
LineColor=#NetBorder#

[Line2]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=490
Y=-64
H=200
W=466
LineColor=#Main#

[Line3]
UpdateDivider=-1
Meter=Line
MeasureName=Val5
X=490
Y=4
H=200
W=466
LineWidth=2
LineColor=#Main#

[Bar0]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#NetBorder#
H=205
W=2
X=43
Y=43

[Bar01]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=0,0,0,255
H=200
W=3
X=45
Y=45

[Bar1]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#Main#
H=160
W=1
X=604
Y=44

[Bar2]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#Main#
H=160
W=1
X=729
Y=44

[Bar3]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#Main#
H=160
W=1
X=839
Y=44

[Bar04]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=0,0,0,255
H=200
W=2
X=490
Y=45

[Bar4]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#NetBorder#
H=205
W=2
X=490
Y=44

[Bar6]
UpdateDivider=-1
Meter=bar
MeasureName=Val6
BarOrientation=Vertical
BarColor=#NetBorder#
H=207
W=2
X=954
Y=43

[MeterImageClick]
Meter=Image
W=105
H=80
X=500
Y=63
DynamicVariables=1
LeftMouseUpAction=[!Refresh]
SolidColor=0,0,0,1
There are some minor side effects like momentarily having the max speed when dynamically changing the adapter related options in the Net measures or the fact that the graph is moving to the left when scrolling, but the former happens to me too in my skins so can't "fix" it and the latter is probably an effect of updating measures/meters that you should be able to deal with if necessary.

P.S. Because of the particularities of your skin, the implementation couldn't be as simple as my basic sample, but then, it's not complicated either and the changes are limited to the target measures/meters. If you don't understand something, just ask. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
CodeCode
Posts: 1366
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: WAN & LAN and SysInfoType/s

Post by CodeCode »

Thnks so much for this.

I inadvertently slept all bloody day, woke up at nightfall. :oops:

It looks really cool, but I have to go through it to better understand what is going on. Like what is happening when the field is empty for adapters that are not connected, and such.

I will come back when I have that understanding - shouldn't be very very long. :Whistle
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.