I've been trying to do this as well, mainly after seeing this post.
My partial working solution -
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
BackgroundMode=2
SolidColor=0,0,0,255
[MeasureNetwork]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfoData=0
StringIndex=1
Substitute="default ISP address":"-1","VPN address":"1","VPN address":"1"
[OnlineStatus]
Measure=Calc
Formula=[MeasureNetwork]
IfAboveValue = 0
IfAboveAction=[!SetOption MeterNetwork FontColor 0,255,0,255][!Redraw]
IfBelowValue = 0
IfBelowAction=[!SetOption MeterNetwork FontColor 255,0,0,255][!Redraw]
DynamicVariables=1
[MeterNetwork]
Meter=String
MeasureName=OnlineStatus
FontSize=30
FontColor=0,0,255,255
StringStyle=Bold
AntiAlias=1
Text=VPN
Default ISP address is whatever address you have with the VPN NOT running. Gets a value of -1
VPN address - local IP address the VPN gives you (i.e a good address that says the VPN is up). These all get a value of 1
The "IfAboveAction" and "IfBelowAction" just change the font colour as it flips from -1 (off) to 1 (on) to -1 (off)
It will flip between red and green automatically as I log in and out of my VPN. My VPN software tells me the local IP address it is using, so I can build up the list of "this is a good address, so go green" in [MeasureNetwork]. You might have to play with the value of SysInfoData to find it on your setup.
What I want it to do is go blue when the VPN uses a IP address it hasn't seen before. Not figured that bit out yet. At the moment, a VPN address it hasn't seen before leaves it at red.