It is currently April 30th, 2024, 3:01 pm

Private Internet Access (VPN) broke recently

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

Re: Private Internet Access (VPN) broke recently

Post by CodeCode »

As an aside, I noticed a change after updating PIA as well. Recently.

I found that PIA does not like the SysInfoData-= to be a zero. That is if PIA was the first named adapter on the list, it would be a zero.

So a simple substitute in the MeasureVPN to have "0":"(a number that is not an active adapter) say "9". Pia then forgives you and goes back to working.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
luckystarc
Posts: 2
Joined: February 26th, 2022, 9:38 am

Re: Private Internet Access (VPN) broke recently

Post by luckystarc »

Please help me, I like this VPN View, but anytime red now, don t green color in VPN now:

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

[Update]
Measure=Time
Format=%S
IfEqualValue="00"
IfEqualAction=[!Refresh]

[MeasureNetwork]
Measure=Plugin
Plugin=SysInfo
SysInfoData=Best
SysInfoType=ADAPTER_DESCRIPTION
IfMatch={?i)^Private Internet Access Network Adapter$
IfMatchAction=[!SetOption MeterNetwork FontColor 0,255,0,155][!SetOption PiaIcon ImageName pia_on.png][!UpdateMeter *][!Redraw]
IfNotMatchAction=[!SetOption MeterNetwork FontColor 255,0,0,255][!SetOption PiaIcon ImageName pia_off.png][!UpdateMeter *][!Redraw]
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
VPN is activ now, with Cyberghost WireGuard

Thanks for your support
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 »

luckystarc wrote: February 26th, 2022, 9:50 am Please help me, I like this VPN View, but anytime red now, don t green color in VPN now:

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

[Update]
Measure=Time
Format=%S
IfEqualValue="00"
IfEqualAction=[!Refresh]

[MeasureNetwork]
Measure=Plugin
Plugin=SysInfo
SysInfoData=Best
SysInfoType=ADAPTER_DESCRIPTION
IfMatch={?i)^Private Internet Access Network Adapter$
IfMatchAction=[!SetOption MeterNetwork FontColor 0,255,0,155][!SetOption PiaIcon ImageName pia_on.png][!UpdateMeter *][!Redraw]
IfNotMatchAction=[!SetOption MeterNetwork FontColor 255,0,0,255][!SetOption PiaIcon ImageName pia_off.png][!UpdateMeter *][!Redraw]
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
VPN is activ now, with Cyberghost WireGuard

Thanks for your support
You don't really need the [OnlineStatus] measure, since [MeasureNetwork] won't be replaced by 1 as you want. You simply have to remove the latter's Substitute, remove the former measure and correct the typo in the regex flag syntax (i.e. (?i) instead of {?i)) for it to work, since the IfMatch will take care of stuff properly (but only IF the regex pattern there is properly escaped, be aware of that - e.g. if you have a dot there and it's not escaped it won't work!):

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

[Update]
Measure=Time
Format=%S
IfEqualValue="00"
IfEqualAction=[!Refresh]

[MeasureNetwork]
Measure=Plugin
Plugin=SysInfo
SysInfoData=Best
SysInfoType=ADAPTER_DESCRIPTION
IfMatch=(?i)^Private Internet Access Network Adapter$
IfMatchAction=[!SetOption MeterNetwork FontColor 0,255,0,155][!SetOption PiaIcon ImageName pia_on.png][!UpdateMeter *][!Redraw]
IfNotMatchAction=[!SetOption MeterNetwork FontColor 255,0,0,255][!SetOption PiaIcon ImageName pia_off.png][!UpdateMeter *][!Redraw]

[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
I also have no idea what's with the [Update] measure there and what it's suppose to do, it's kind of a nonsense for me, but that's another matter...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
luckystarc
Posts: 2
Joined: February 26th, 2022, 9:38 am

Re: Private Internet Access (VPN) broke recently

Post by luckystarc »

Thanks for your support, so fast - THANKS,
I tried, but no success, I use successful now:

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
; This can be found in then Device Manager > Network adapters > WireGuard Tunnel > Properties > Details > Driver description.
; PIA introduced a bug in that on value is correct for launch and another for a restart.  So both values need to be present.  
IfMatch=WireGuard Tunnel|Wintun Userspace Tunnel
IfMatchAction=[!SetOption MeterNetwork FontColor 0,255,0,155][!SetOption PiaIcon ImageName pia_on.png][!UpdateMeter *][!Redraw]
IfNotMatchAction=[!SetOption MeterNetwork FontColor 255,0,0,255][!SetOption PiaIcon ImageName pia_off.png][!UpdateMeter *][!Redraw]
DynamicVariables=1 

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

[MeterNetwork]
Meter=String
FontSize=30
FontColor=167,167,167,255
StringStyle=Bold
AntiAlias=1
Text= VPN
X=40
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 »

luckystarc wrote: February 26th, 2022, 3:24 pmThanks for your support, so fast - THANKS,
I tried, but no success, I use successful now
Excellent - glad it worked out. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth