It is currently April 30th, 2024, 7:32 pm

Private Internet Access (VPN) broke recently

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16190
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Private Internet Access (VPN) broke recently

Post by balala »

jsmorley wrote: July 16th, 2020, 2:21 pm Note that DynamicVariables=1 is required on a SysInfo measure where you want a dynamic change to the ADAPTER_DESCRIPTION or other "network" values to be recognized. This is peculiar to these values, and was originally designed this way since like many other values you measure with SysInfo, it was not expected that the name of your active network adapter could change while the skin is running. WiFi and VPN and all that has changed this assumption somewhat over the years, but the original behavior remains.
But this would be required on kenbo01's initial measure as well, wouldn't it? Although he doesn't have set it, his measure, according to his post:
kenbo01 wrote: July 16th, 2020, 11:38 am I can confirm that the code does actually work and produce the desired outcome on my computer. That is, if I disconnect VPN it changes to red text and icon, and if I reconnect it changes to the green text and icon. So I can only assume that under the hood it can cope with a "1" when expecting a 1.
is working well. How or why, although it wouldn't have to? Or am I missing something in meanwhile?
User avatar
brax64
Posts: 172
Joined: July 8th, 2018, 8:05 pm

Re: Private Internet Access (VPN) broke recently

Post by brax64 »

Hi all,
this is my, I think, simpler approach (this works only for a home/work pc, not for a mobile....).
Your IP address is always the same because is given by your provider, so set that address as variable #DefaultIP#, than use this simple code:

Code: Select all

[WAN]
Measure=WebParser
URL=https://api.ipify.org/
RegExp=(.*)
StringIndex=1
UpdateRate=60
IfMatchMode=1
IfMatch=#DefaultIP#
IfMatchAction=[#SO# VPNIcon ImageName "#path#vpnoff.png"][#SO# IPText Text "VPN is off . . ."][#UMTG# IP][#RD#]
IfNotMatchAction=[#SO# VPNIcon ImageName "#path#vpnon.png"][#SO# IPText Text [WAN]][#UMTG# IP][#RD#]

[VPNIcon]
Meter=Image
ImageName=#path#vpnoff.png
Group=IP
ToolTipText=VPN
SolidColor=0,0,0,1
X=75
Y=535
W=30

[IPText]
Meter=String
MeasureName=WAN
Group=IP
MeterStyle=TextStyle
X=45r
Y=8r
This way you don't need to worry about the adapter or which VPN software you're using

Best Regards

brax
User avatar
Yincognito
Rainmeter Sage
Posts: 7185
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Private Internet Access (VPN) broke recently

Post by Yincognito »

brax64 wrote: July 16th, 2020, 8:15 pmYour IP address is always the same because is given by your provider [...]
This is not that simple, since what you said is true only for static IPs. If one has a dynamic IP (also "given by the provider", and there are a lot of dynamic IPs out there), then I believe your method won't work.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
brax64
Posts: 172
Joined: July 8th, 2018, 8:05 pm

Re: Private Internet Access (VPN) broke recently

Post by brax64 »

Yincognito wrote: July 16th, 2020, 8:28 pm This is not that simple, since what you said is true only for static IPs. If one has a dynamic IP (also "given by the provider", and there are a lot of dynamic IPs out there), then I believe your method won't work.
Hi Yincognito,
yes, you're absolutely correct, did forget to mention it...
User avatar
Yincognito
Rainmeter Sage
Posts: 7185
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Private Internet Access (VPN) broke recently

Post by Yincognito »

brax64 wrote: July 16th, 2020, 8:48 pm Hi Yincognito,
yes, you're absolutely correct, did forget to mention it...
Yeah, no worries. You tried to help, and that's great, no matter what. :thumbup:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Private Internet Access (VPN) broke recently

Post by jsmorley »

Uhm... Isn't the ENTIRE point of a VPN to change your visible IP address?
User avatar
Yincognito
Rainmeter Sage
Posts: 7185
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Private Internet Access (VPN) broke recently

Post by Yincognito »

jsmorley wrote: July 16th, 2020, 10:27 pm Uhm... Isn't the ENTIRE point of a VPN to change your visible IP address?
Exactly. Which is why some of these "what's my IP" services even have a note mentioning that their results are affected by the presence of a VPN, among other things.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Darv
Posts: 13
Joined: September 27th, 2015, 1:48 am

Re: Private Internet Access (VPN) broke recently

Post by Darv »

Thanks Kenbo01

First my sincere apologies for the lag. Right after I wrote this I ended up in the hospital and am just getting back to it.

Thanks so much for taking the time. I tried the code (below) and it works! But for some reason doesn't seem to refresh. It will identify the correct state of the PIA VPN upon launch but doesn't recognize if I connect or disconnect the VPN. It continues to show the state it discovered when it was launched. It only seems to be able to identify the state upon launch. Any ideas how I might fix that. The code looks correct to me but I am quite the novice.

Again, thanks for the help.
Regards,
Darv


kenbo01 wrote: July 15th, 2020, 11:35 pm Something like this?

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
BackgroundMode=3
SolidColor=0,0,0,90

[Metadata]
; Contains basic information of the skin.
Name=VPN Status

[MeasureNetwork]
Measure=Plugin
Plugin=SysInfo
SysInfoData=Best
SysInfoType=ADAPTER_DESCRIPTION
Substitute="Private Internet Access Network Adapter":"1","WireGuard Tunnel":"1"

[OnlineStatus]
Measure=Calc
Formula=[MeasureNetwork]
IfCondition=OnlineStatus = 1
IfTrueAction=[!SetOption MeterNetwork FontColor 0,255,0,155][!SetOption PiaIcon ImageName pia_on.png][!UpdateMeter PiaIcon][!Redraw]
IfCondition2=OnlineStatus <> 1
IfTrueAction2=[!SetOption MeterNetwork FontColor 255,0,0,255][!SetOption PiaIcon ImageName pia_off.png][!UpdateMeter PiaIcon][!Redraw]
DynamicVariables=1

[PiaIcon]
Meter=Image
ImageName=pia_gray.png
W=30
H=30
X=8
Y=7

[MeterNetwork]
Meter=String
MeasureName=OnlineStatus
FontSize=30
FontColor=167,167,167,255
StringStyle=Bold
AntiAlias=1
Text=VPN
X=30
User avatar
SilverAzide
Rainmeter Sage
Posts: 2617
Joined: March 23rd, 2015, 5:26 pm

Re: Private Internet Access (VPN) broke recently

Post by SilverAzide »

Darv wrote: November 13th, 2020, 8:30 am Thanks so much for taking the time. I tried the code (below) and it works! But for some reason doesn't seem to refresh. It will identify the correct state of the PIA VPN upon launch but doesn't recognize if I connect or disconnect the VPN. It continues to show the state it discovered when it was launched. It only seems to be able to identify the state upon launch. Any ideas how I might fix that. The code looks correct to me but I am quite the novice.
It doesn't refresh because the [MeasureNetwork] measure is missing the DynamicVariables=1 option on the measure. This is required for SysInfo measures that use the "Best" option.
Gadgets Wiki GitHub More Gadgets...
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Private Internet Access (VPN) broke recently

Post by jsmorley »

SilverAzide wrote: November 13th, 2020, 1:59 pm It doesn't refresh because the [MeasureNetwork] measure is missing the DynamicVariables=1 option on the measure. This is required for SysInfo measures that use the "Best" option.
Correct...

https://docs.rainmeter.net/manual/plugins/sysinfo/#SysInfoData