You can find attached skins with examples at the end of this post.
Post your workarounds in the comments as well.
1. #CURRENTSECTION# as a variable
Code: Select all
[Variables] Text1=First Text2=Second [TextStyle] Text=[#[#CURRENTSECTION]] DynamicVariables=1 [Text1] Meter=String MeterStyle=TextStyle [Text2] Meter=String MeterStyle=TextStyle
2. #CURRENTSECTION# as a part of variable
Code: Select all
[Variables] Text1Name=Firefox Text2Name=Notepad Text1Link=C:\Program Files\Mozilla Firefox\firefox.exe Text2Link=C:\Windows\System32\notepad.exe [TextStyle] Text=[#[#CURRENTSECTION]Name] LeftMouseUpAction=["[#[#CURRENTSECTION]Link]"] DynamicVariables=1 [Text1] Meter=String MeterStyle=TextStyle [Text2] Meter=String MeterStyle=TextStyle
3. #CURRENTSECTION# and variable as a variable
(Also, #CURRENTSECTION# and variable as a part of a variable)
Note: In the code:
LeftMouseUpAction= uses #CURRENTSECTION# and variable as a variable
Text= uses #CURRENTSECTION# and variable as a part of a variable
Code: Select all
[Variables] Option=Default DefaultApp1=C:\Program Files\Mozilla Firefox\firefox.exe DefaultApp2=C:\Windows\System32\notepad.exe DefaultApp1Name=Firefox DefaultApp2Name=Rainmeter [StyleApp] LeftMouseUpAction=["[#[#Option][#CURRENTSECTION]]"] Text=[#[#Option][#CURRENTSECTION]Name] DynamicVariables=1 [App1] Meter=String MeterStyle=StyleApp [App2] Meter=String MeterStyle=StyleApp
4. Mixed multi-level variables with #CURRENTSECTION#
Code: Select all
[Variables] Region=Berlin BerlinPrice1=4.50 BerlinPrice2=2.99 Berlin=Discount DiscountPrice1=4.25 DiscountPrice2=2.49 [StylePrice] Text=[#CURRENTSECTION]: [#[#Region][#CURRENTSECTION]] #CRLF#Discount: [#[#[#Region]][#CURRENTSECTION]] DynamicVariables=1 [Region] Meter=String Text=Region: [#[#CURRENTSECTION]] #CRLF#Mode: [#[#Region]] [Price1] Meter=String MeterStyle=StylePrice [Price2] Meter=String MeterStyle=StylePrice
5. Escaped variable as a variable
If you ever need to used escaped variable as a variable, note that [#[#*Variable*]] will not work since the inner brackets are not being dropped when escaping asterisks are placed.
In order to make it work this form should be used:
[##*Variable*#]
6. Key name of a variable is a variable itself
Note 1: Without second nested variable the variable can be written simply [##*Location*#Price1] as well.Code: Select all
[Variables] Location=Berlin #Location#Price1=4.50 #Location#Price2=2.99 [StylePrice] Text=[#CURRENTSECTION]: [##*Location*#[#CURRENTSECTION]] DynamicVariables=1 [Price1] Meter=String MeterStyle=StyleText [Price2] Meter=String MeterStyle=StylePrice
Note 2: If you need to declare such a #key#=value as a variable you can use this bang (e.g. in [Rainmeter] OnRefreshAction):Code: Select all
[!SetVariable "[#Location]Price1" "[##*Location*#Price1]"][!Update *]
7. #CURRENTSECTION# is an index of the current section
Note: you need to declare the desired part of a desired section name in the Variables section.Code: Select all
[Variables] ; Indexed Sections Text= Icon= ; Options #Text#1=Firefox #Text#2=Photoshop #Text#3=iTunes #Icon#1=#@#Firefox.png #Icon#2=#@#Photoshop.png #Icon#3=#@#iTunes.png [StyleIcon] X=r Y=60R W=32 H=32 ImageName=[##*Icon*#[#CURRENTSECTION]] DynamicVariables=1 [StyleText] X=([#*Icon*#[#CURRENTSECTION]:XW]+20) Y=(([#*Icon*#[#CURRENTSECTION]:Y]+([#*Icon*#[#CURRENTSECTION]:H]/2))-([#*Text*#[#CURRENTSECTION]:H]/2)) Text=Label: [##*Text*#[#CURRENTSECTION]] #CRLF#Current section index: [#CURRENTSECTION] #CRLF#Y value of the current section: [#*Text*#[#CURRENTSECTION]:Y] #CRLF#E.g: Y value of text meter with current section index: [#*Icon*#[#CURRENTSECTION]:Y] DynamicVariables=1 [#Icon#1] Meter=Image MeterStyle=StyleIcon X=25 Y=50 [#Icon#2] Meter=Image MeterStyle=StyleIcon [#Icon#3] Meter=Image MeterStyle=StyleIcon [#Text#1] Meter=String MeterStyle=StyleText [#Text#2] Meter=String MeterStyle=StyleText [#Text#3] Meter=String MeterStyle=StyleText
Other cases from the forum