[style_vpn]
AntiAlias=1
FontSize=#font_size_smaller#
H=27
SolidColor=#col_transparent#
W=45
X=56r
Y=#y_pos#
[style_vpn_fail]
FontColor=#col_red#
ToolTipIcon="Warning"
ToolTipText="Failed to curl (as reported by Lua script)."
ToolTipType=0
MeterStyle=style_vpn
[style_vpn_off]
FontColor=#col_grey#
ToolTipIcon="Warning"
ToolTipText="VPN is DISABLED."
ToolTipType=0
MeterStyle=style_vpn
The reason the replacement fails is that I am using MeterStyle in something that is not a meter. But you get the idea. Can I implement that idea? If so, how? Thanks.
jn_meter wrote: ↑October 6th, 2022, 11:44 pm
The reason the replacement fails is that I am using MeterStyle in something that is not a meter. But you get the idea. Can I implement that idea? If so, how? Thanks.
No, unfortunately not. See the second bullet item in the MeterStyle docs. But you might be in luck anyway... did you know you can apply multiple styles to a meter? The manual chapter shows how to do this in the example. Styles can in effect be unioned together, if you are familiar with the concept of unions.
[StyleBoldText]
FontWeight=700
[StyleRedText]
FontColor=255,0,0
[MeterText]
Meter=String
MeterStyle=StyleBoldText | StyleRedText
Text="This text is bold and red."
So all you need to do is adjust your styles slightly and then apply two or more styles to a single meter, which would have the net effect of being pretty much exactly what you are looking for.
[style_vpn_base]
; To be used in this sort of way, in the relevant meters (or in relevant bangs or lua scripts):
; MeterStyle=style_vpn_base | style_vpn_<particularStyle>
AntiAlias=1
FontSize=#font_size_smaller#
H=27
SolidColor=#col_transparent#
W=45
X=56r
Y=#y_pos#