It is currently April 20th, 2024, 2:43 pm

Network, How to get local IP address

Get help with installing and using Rainmeter.
keithsplace
Posts: 7
Joined: December 5th, 2020, 3:30 pm

Network, How to get local IP address

Post by keithsplace »

Is there a way to get the local IP address as well on another line under the internet address line?
User avatar
balala
Rainmeter Sage
Posts: 16150
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Network, How to get local IP address

Post by balala »

keithsplace wrote: December 19th, 2020, 5:23 pm Is there a way to get the local IP address as well on another line under the internet address line?
Something like this maybe?

Code: Select all

[MeasureIPAddress]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfoData=Best
keithsplace
Posts: 7
Joined: December 5th, 2020, 3:30 pm

Re: Network, How to get local IP address

Post by keithsplace »

Not really sure how to use that but, here is my network illistro:
As in I don't know where to put that, or how to build the other necessary stuff for that.

Code: Select all

; Lines starting ; (semicolons) are commented out.
; That is, they do not affect the code and are here for demonstration purposes only.
; ----------------------------------

[Rainmeter]
; This section contains general settings that can be used to change how Rainmeter behaves.
Update=1000
Background=#@#Background.png
; #@# is equal to Rainmeter\Skins\illustro\@Resources
BackgroundMode=3
BackgroundMargins=0,34,0,14

[Metadata]
; Contains basic information of the skin.
Name=Network
Author=poiru
Information=Shows your IP address and network activity.
License=Creative Commons BY-NC-SA 3.0
Version=1.0.0

[Variables]
; Variables declared here can be used later on between two # characters (e.g. #MyVariable#).
fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
maxDownload=201326590
MaxUpload=209715200
; Set maxDownload and maxUpload to your maximum download and upload speed in bits.
; To convert kilobits, megabits, kilobytes, and megabytes into bits, go to www.google.com
; and search for something like "10 megabytes in bits".

; ----------------------------------
; MEASURES return some kind of value
; ----------------------------------

[measureIP]
; This measure returns your IPv4 address. WebParser measures are relatively complicated. If you're a beginner with
; Rainmeter, take a look at some of the other illustro skins before modifying this one.
; For more information, go here: https://docs.rainmeter.net/tips/ipaddress
Measure=Plugin
Plugin=WebParser
URL=https://checkip.amazonaws.com/
UpdateRate=14400
RegExp=(?siU)^(.*)$
StringIndex=1
Substitute="":"N/A"
; Substitute works as follows: "A":"B" where A is a string to substitute and B is a string
; to substitute with. In this case, it substutes "" (i.e. empty) to N/A

[measureNetIn]
Measure=NetIn
NetInSpeed=#maxDownload#
; NetInSpeed must be set so your maximun download speed for the download bar to scale correctly

[measureNetOut]
Measure=NetOut
NetOutSpeed=#maxUpload#

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

[styleTitle]
StringAlign=Center
StringCase=Upper
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[styleLeftText]
StringAlign=Left
; Meters using styleLeftText will be left-aligned.
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleRightText]
StringAlign=Right
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,255,255,15

[styleSeperator]
SolidColor=255,255,255,15

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[meterTitle]
Meter=String
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=100
Y=12
W=190
H=18
Text=Network
; Even though the text is set to Network, Rainmeter will display
; it as NETWORK, because styleTitle contains StringCase=Upper.

[meterIPLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=40
W=190
H=14
Text=WAN IP Address

[meterIPValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureIP
X=200
Y=0r
; r stands for relative. In this case, the Y postition of meterValueCPU is 0 pixels
; below the Y value of the previous meter (i.e it's the same as in meterLabelCPU).
W=190
H=14
Text=%1
; %1 stands for the value of MeasureName (measureIP in this case).

[meterSeperator]
Meter=Image
MeterStyle=styleSeperator
X=10
Y=52
W=190
H=1

[meterUploadLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=60
W=190
H=14
Text=Upload

[meterUploadValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureNetOut
X=200
Y=0r
W=190
H=14
Text=%1B/s
NumOfDecimals=1
AutoScale=1
; Because measureIP returns the current upload speed in bytes, we must use AutoScale=1 to
; automatically scale the value into a more readable figure.

[meterUploadBar]
Meter=Bar
MeterStyle=styleBar
MeasureName=measureNetOut
X=10
Y=72
W=190
H=1

[meterDownloadLabel]
Meter=String
MeterStyle=styleLeftText
X=10
Y=80
W=190
H=14
Text=Download

[meterDownloadValue]
Meter=String
MeterStyle=styleRightText
MeasureName=measureNetIn
X=200
Y=0r
W=190
H=14
Text=%1B/s
NumOfDecimals=1
AutoScale=1

[meterDownloadBar]
Meter=Bar
MeterStyle=styleBar
MeasureName=measureNetIn
X=10
Y=92
W=190
H=1
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Network, How to get local IP address

Post by CyberTheWorm »

Code: Select all

[Rainmeter]
Update=1000

[Metadata]
Name=Network
Author=CyberTheWorm
Information=Displays LAN, WAN IP and data transfer rate
Version=1.0.0
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

[Variables]

[MeasureNetIn]
Measure=NetIn

[MeasureNetOut]
Measure=NetOut

[MeasureLANConectivity]
Measure=Plugin
Plugin=SysInfo
SysInfoType=LAN_CONNECTIVITY
Substitute="-1":"Down","1":"Up"

[MeasureLANIP]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfodata=Best

[MeasureWANConectivity]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
Substitute="-1":"Down","1":"Up"

[MeasureWANIP]
Measure=Plugin
Plugin=WebParser
URL=http://ipv4.icanhazip.com/
RegExp=(.*)
UpdateDivider=3600

[MeterShapeRectangle]
Meter=Shape
X=0
Y=0
Shape=Rectangle 3,3,200,100 | Fill Color 32,32,32,255 | StrokeWidth 6 | StrokeColor 0,0,0,220

[MeterConnectivity]
Meter=String
X=103
Y=20
MeasureName=MeasureLANConectivity
MeasureName2=MeasureLANIP
MeasureName3=MeasureWANConectivity
MeasureName4=MeasureWANIP
Text=LAN:%2 - %1#CRLF#WAN:%4 - %3
FontColor=255,255,255,255
StringAlign=Center
AntiAlias=1


[MeterTraffic]
Meter=String
X=103
Y=10R
MeasureName=MeasureNetIn
MeasureName2=MeasureNetOut
Text=DL: %1Bps#CRLF#UL: %2Bps
FontColor=255,255,255,255
StringAlign=Center
AntiAlias=1
AutoScale=1
This is skin that uses the information balala posted with a few extra things maybe it will help
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
HardNeck
Posts: 6
Joined: February 1st, 2024, 5:49 pm

Re: Network, How to get local IP address

Post by HardNeck »

Greetings!
How do I leave the code like this?
With the Local Address, IPv4 and IPv6?
With or without Upload and Download speeds?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5402
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Network, How to get local IP address

Post by eclectic-tech »

HardNeck wrote: February 1st, 2024, 6:03 pm Greetings!
How do I leave the code like this?
With the Local Address, IPv4 and IPv6?
With or without Upload and Download speeds?
Hmm.... I am not sure what you are asking... :???:

If you want to hide the Upload/Download traffic display (?) then you can add a line Hidden=1 to the [MeterTraffic] section of the code above. Save the file and refresh the skin.

If you want to be able to toggle the display of the Upload/Download traffic using a mouse action or key press, then more details on how you want it to work are needed.
User avatar
HardNeck
Posts: 6
Joined: February 1st, 2024, 5:49 pm

Re: Network, How to get local IP address

Post by HardNeck »

Code: Select all

[Rainmeter]
Update=1000

[Metadata]
Name=Network
Author=CyberTheWorm
Information=Displays LAN, WAN IP and data transfer rate
Version=1.0.0
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

[Variables]

[MeasureNetIn]
Measure=NetIn

[MeasureNetOut]
Measure=NetOut

[MeasureLANConectivity]
Measure=Plugin
Plugin=SysInfo
SysInfoType=LAN_CONNECTIVITY
Substitute="-1":"Down","1":"Up"

[MeasureLANIP]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfodata=Best

[MeasureWANConectivity]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
Substitute="-1":"Down","1":"Up"

[MeasureWANIP]
Measure=Plugin
Plugin=WebParser
URL=http://ipv4.icanhazip.com/
RegExp=(.*)
UpdateDivider=3600

[MeterShapeRectangle]
Meter=Shape
X=0
Y=0
Shape=Rectangle 3,3,200,100 | Fill Color 32,32,32,255 | StrokeWidth 6 | StrokeColor 0,0,0,220

[MeterConnectivity]
Meter=String
X=103
Y=20
MeasureName=MeasureLANConectivity
MeasureName2=MeasureLANIP
MeasureName3=MeasureWANConectivity
MeasureName4=MeasureWANIP
Text=LAN:%2 - %1#CRLF#WAN:%4 - %3
FontColor=255,255,255,255
StringAlign=Center
AntiAlias=1


[MeterTraffic]
Meter=String
X=103
Y=10R
MeasureName=MeasureNetIn
MeasureName2=MeasureNetOut
Text=DL: %1Bps#CRLF#UL: %2Bps
FontColor=255,255,255,255
StringAlign=Center
AntiAlias=1
AutoScale=1
This same code displaying the IPv4 and IPv6 address, this is what I want.
User avatar
Yincognito
Rainmeter Sage
Posts: 7131
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Network, How to get local IP address

Post by Yincognito »

HardNeck wrote: February 2nd, 2024, 1:02 pm This same code displaying the IPv4 and IPv6 address, this is what I want.
Find a website that offers the IPv6 address in a webpage whose data can be read by WebParser (i.e. not hidden behind Javascript), duplicate MeasureWANIP under a different name and use that webpage address as the URL option in the duplicated measure, adjust the measure's RegExp if needed, then reference that measure in MeterConnectivity to include the scraped IPv6 address in the displayed result.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
HardNeck
Posts: 6
Joined: February 1st, 2024, 5:49 pm

Re: Network, How to get local IP address

Post by HardNeck »

Yincognito wrote: February 2nd, 2024, 4:04 pm Find a website that offers the IPv6 address in a webpage whose data can be read by WebParser (i.e. not hidden behind Javascript), duplicate MeasureWANIP under a different name and use that webpage address as the URL option in the duplicated measure, adjust the measure's RegExp if needed, then reference that measure in MeterConnectivity to include the scraped IPv6 address in the displayed result.
I tried to write the code this way it displays IPv6 instead of IPv4 and it did not display IPv4, what is wrong in this code please.
:confused: :???: I don't know anything about code...
I don't know anything about code...

Code: Select all

[Rainmeter]
Update=1000

[Metadata]
Name=Network
Author=CyberTheWorm
Information=Displays LAN, WAN IP and data transfer rate
Version=1.0.0
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0


[Variables]

[MeasureNetIn]
Measure=NetIn

[MeasureNetOut]
Measure=NetOut

[MeasureLANConectivity]
Measure=Plugin
Plugin=SysInfo
SysInfoType=LAN_CONNECTIVITY
Substitute="-1":"Down","1":"Up"

[MeasureLANIP]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfodata=Best

[MeasureWANConectivity]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
Substitute="-1":"Down","1":"Up"

[MeasureWANIP]
Measure=Plugin
Plugin=WebParser
URL=http://ipv4.icanhazip.com/
RegExp=(.*)
UpdateDivider=3600

[MeasureWAN6Conectivity]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
Substitute="-1":"Down","1":"Up"

[MeasureWAN6IP]
Measure=Plugin
Plugin=WebParser
URL=http://ipv6.icanhazip.com/
RegExp=(.*)
UpdateDivider=3600

[MeterConnectivity]
Meter=String
X=103
Y=20
MeasureName=MeasureLANConectivity
MeasureName2=MeasureLANIP
MeasureName3=MeasureWANConectivity
MeasureName4=MeasureWAN6IP
MeasureName5=MeasureWANConectivity
MeasureName6=MeasureWAN6IP
Text=LAN:%2 - %1#CRLF#WAN:%4 - %3
FontColor=255,255,255,255
StringAlign=Center
AntiAlias=1
User avatar
HardNeck
Posts: 6
Joined: February 1st, 2024, 5:49 pm

Re: Network, How to get local IP address

Post by HardNeck »

HardNeck wrote: February 2nd, 2024, 5:04 pm I tried to write the code this way it displays IPv6 instead of IPv4 and it did not display IPv4, what is wrong in this code please.
:confused: :???: I don't know anything about code...
I don't know anything about code...

Code: Select all

[Rainmeter]
Update=1000

[Metadata]
Name=Network
Author=CyberTheWorm
Information=Displays LAN, WAN IP and data transfer rate
Version=1.0.0
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0


[Variables]

[MeasureNetIn]
Measure=NetIn

[MeasureNetOut]
Measure=NetOut

[MeasureLANConectivity]
Measure=Plugin
Plugin=SysInfo
SysInfoType=LAN_CONNECTIVITY
Substitute="-1":"Down","1":"Up"

[MeasureLANIP]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfodata=Best

[MeasureWANConectivity]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
Substitute="-1":"Down","1":"Up"

[MeasureWANIP]
Measure=Plugin
Plugin=WebParser
URL=http://ipv4.icanhazip.com/
RegExp=(.*)
UpdateDivider=3600

[MeasureWAN6Conectivity]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
Substitute="-1":"Down","1":"Up"

[MeasureWAN6IP]
Measure=Plugin
Plugin=WebParser
URL=http://ipv6.icanhazip.com/
RegExp=(.*)
UpdateDivider=3600

[MeterConnectivity]
Meter=String
X=103
Y=20
MeasureName=MeasureLANConectivity
MeasureName2=MeasureLANIP
MeasureName3=MeasureWANConectivity
MeasureName4=MeasureWAN6IP
MeasureName5=MeasureWANConectivity
MeasureName6=MeasureWAN6IP
Text=LAN:%2 - %1#CRLF#WAN:%4 - %3
FontColor=255,255,255,255
StringAlign=Center
AntiAlias=1

Code: Select all

[Rainmeter]
Update=1000

[Metadata]
Name=Network
Author=CyberTheWorm
Information=Displays LAN, WAN IP and data transfer rate
Version=1.0.0
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0


[Variables]

[MeasureNetIn]
Measure=NetIn

[MeasureNetOut]
Measure=NetOut

[MeasureLANConectivity]
Measure=Plugin
Plugin=SysInfo
SysInfoType=LAN_CONNECTIVITY
Substitute="-1":"Down","1":"Up"

[MeasureLANIP]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfodata=Best

[MeasureWANConectivity]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
Substitute="-1":"Down","1":"Up"

[MeasureWANIP]
Measure=Plugin
Plugin=WebParser
URL=http://ipv4.icanhazip.com/
RegExp=(.*)
UpdateDivider=3600

[MeasureWAN6IPConectivity]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
Substitute="-1":"Down","1":"Up"

[MeasureWAN6IP]
Measure=Plugin
Plugin=WebParser
URL=http://ipv6.icanhazip.com/
RegExp=(.*)
UpdateDivider=3600

[MeterConnectivity]
Meter=String
X=220
Y=40
MeasureName=MeasureLANConectivity
MeasureName2=MeasureLANIP
MeasureName3=MeasureWANConectivity
MeasureName4=MeasureWANIP
MeasureName5=MeasureWANConectivity
MeasureName6=MeasureWAN6IP
Text=LAN:%2 - %1#CRLF#WAN:%4 - %3#CRLF#WAN6:%6 - 3
FontColor=255,255,255,255
StringAlign=Center
AntiAlias=1
This one produced some results but it is not yet 100%.