That did work! I had to fix the { to a (
and then add a DynamicVariables=1
in the [MeasureNetwork] section.
I had been looking at IfMatch earlier but not good enough at this to determine how to put it to work. Thanks for the help. I have a working script and will get it uploaded and on line so others can use it.
Cheers,
Darvin Atkeson
eclectic-tech wrote: ↑November 17th, 2020, 3:02 am Use IfMatch and the string value of the network description measure rather than substituting the text with numbers .The IfMatch uses RegExp to set the options directly: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 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 FontSize=30 FontColor=167,167,167,255 StringStyle=Bold AntiAlias=1 Text= VPN X=40
when [MeasureNetwork] equals "Private Internet Access Network Adapter" the match actions are taken
when [MeasureNetwork] equals any other text, the not match actions.