I'll keep it as simple as possible.
I have two skins that are in the same folder [00-POSI/Screen2/]. I'll call them "Gallery.ini" and "Time.ini".
I need "Time" displayed between 2-4:30pm, and gallery displayed the rest of the time. I've been away too long, and am struggling to figure out what/how to put into each skin to make one switch to the other automatically. I'd also like a "control panel" with a button to switch to either one.
Bonus "points" if all the code can be put into one skin...
What do we got out there?
It is currently March 28th, 2024, 4:31 pm
"scheduled" switch between skins
- FuzzyLizard530
- Posts: 75
- Joined: August 5th, 2014, 2:09 am
- balala
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: "scheduled" switch between skins
You need a Time measure, with a proper Format option. In order to keep the code as simple as possible, the Format has to return the time as a decimal number. An IfCondition is used to check if the time is in the limits or not and the IfTrueAction / IfFalseAction loads the appropriate skin.FuzzyLizard530 wrote: ↑October 18th, 2020, 7:01 pm I have two skins that are in the same folder [00-POSI/Screen2/]. I'll call them "Gallery.ini" and "Time.ini".
I need "Time" displayed between 2-4:30pm, and gallery displayed the rest of the time. I've been away too long, and am struggling to figure out what/how to put into each skin to make one switch to the other automatically.
Two variables are also needed, to store the limits of the period:
Code: Select all
[Variables]
Start=14.00
End=16.30
[MeasureTime]
Measure=TIME
Format=%#H.%M
IfCondition=((#CURRENTSECTION#>=#Start#)&&(#CURRENTSECTION#<=#End#))
IfTrueAction=[!ActivateConfig "00-POSI\Screen2" "Time.ini"]
IfFalseAction=[!ActivateConfig "00-POSI\Screen2" "Gallery.ini"]
This is possible for sure, however first check the above code and let's see if it does properly working. Adding the button is not a too hard thing and we'll add it later, everything is alright. Is it?FuzzyLizard530 wrote: ↑October 18th, 2020, 7:01 pm I'd also like a "control panel" with a button to switch to either one.
- FuzzyLizard530
- Posts: 75
- Joined: August 5th, 2014, 2:09 am
Re: "scheduled" switch between skins
So far, it SEEMS like it works... I can get my Basic control panel to load at least...
- balala
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: "scheduled" switch between skins
Basic control panel being any of the Time.ini or Gallery.ini skins?FuzzyLizard530 wrote: ↑October 18th, 2020, 7:38 pm So far, it SEEMS like it works... I can get my Basic control panel to load at least...
Test the skin for a while and if you find it ok, will add the button to the control panel (although I have to admit I don't exactly see what are you talking about / want, but this probably will be much clearer later).
- FuzzyLizard530
- Posts: 75
- Joined: August 5th, 2014, 2:09 am
Re: "scheduled" switch between skins
I have a third skin "refresh.ini" that I set up to manage the other two... Sorry for the confusion. LOL! Code below...
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[Metadata]
Name=ExampleMeterButton
Author=The Rainmeter Team
Information=Example of the Button meter
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=1.0
[Variables]
BarWidth=96
BarHeight=32
Start=13.55
End=16.30
[DateDayTime]
Measure=TIME
Format=%#H.%M
IfCondition=((#CURRENTSECTION#>=#Start#)&&(#CURRENTSECTION#<=#End#))
IfTrueAction=[!ActivateConfig "00-POSI\Screen2" "Time.ini"]
IfFalseAction=[!ActivateConfig "00-POSI\Screen2" "Gallery.ini"]
[MeterImageLogo]
Meter=Bar
BarColor=128,128,128
W=#BarWidth#
H=#BarHeight#
LeftMouseUpAction=[!ActivateConfig "00-POSI\Screen2" "Logo.ini"]
[MeterImageGall]
Meter=Bar
BarColor=128,128,128
Y=34
W=#BarWidth#
H=#BarHeight#
LeftMouseUpAction=[!ActivateConfig "00-POSI\Screen2" "Gallery.ini"]
- balala
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: "scheduled" switch between skins
Such in a case I'd use another approach: recommend to add a variable and load the appropriate skin based on the value of that variable. Let's name this variable Skin:FuzzyLizard530 wrote: ↑October 18th, 2020, 8:13 pm I have a third skin "refresh.ini" that I set up to manage the other two... Sorry for the confusion. LOL! Code below...
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[Metadata]
Name=ExampleMeterButton
Author=The Rainmeter Team
Information=Example of the Button meter
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=1.0
[Variables]
BarWidth=96
BarHeight=32
Start=13.55
End=16.30
Skin=0
[DateDayTime]
Measure=TIME
Format=%#H.%M
IfCondition=((#CURRENTSECTION#>=#Start#)&&(#CURRENTSECTION#<=#End#))
IfTrueAction=[!SetVariable Skin "1"][!UpdateMeasure "MeasureSkin"]
IfFalseAction=[!SetVariable Skin "0"][!UpdateMeasure "MeasureSkin"]
[MeasureSkin]
Measure=Calc
Formula=#Skin#
Ifcondition=(#CURRENTSECTION#>=1)
IfTrueAction=[!ActivateConfig "00-POSI\Screen2" "Logo.ini"]
IfFalseAction=[!ActivateConfig "00-POSI\Screen2" "Gallery.ini"]
DynamicVariables=1
[MeterImageLogo]
Meter=Bar
BarColor=128,128,128
W=#BarWidth#
H=#BarHeight#
LeftMouseUpAction=[!SetVariable Skin "1"][!UpdateMeasure "MeasureSkin"]
[MeterImageGall]
Meter=Bar
BarColor=128,128,128
Y=34
W=#BarWidth#
H=#BarHeight#
LeftMouseUpAction=[!SetVariable Skin "0"][!UpdateMeasure "MeasureSkin"]
- FuzzyLizard530
- Posts: 75
- Joined: August 5th, 2014, 2:09 am
Re: "scheduled" switch between skins
so far this skin is working marvellously! I'd like to expand the schedule a bit so that I could add a couple more slots to do more with this, and possibly run some batch files and other command-line goodness. thoughts?
- balala
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: "scheduled" switch between skins
The basic idea is to have a Time measure, which retuns the time as a decimal number (using a decimal dot between the hour and minutes, instead of colon). This way the number can be easily used into IfCondition options, to get the appropriate operation when the time achieves the proper value.FuzzyLizard530 wrote: ↑February 7th, 2021, 5:08 pm I'd like to expand the schedule a bit so that I could add a couple more slots to do more with this, and possibly run some batch files and other command-line goodness. thoughts?
See the code I posted last time:
Code: Select all
[DateDayTime]
Measure=TIME
Format=%#H.%M
IfCondition=((#CURRENTSECTION#>=#Start#)&&(#CURRENTSECTION#<=#End#))
IfTrueAction=[!SetVariable Skin "1"][!UpdateMeasure "MeasureSkin"]
IfFalseAction=[!SetVariable Skin "0"][!UpdateMeasure "MeasureSkin"]
[MeasureSkin]
Measure=Calc
Formula=#Skin#
Ifcondition=(#CURRENTSECTION#>=1)
IfTrueAction=[!ActivateConfig "00-POSI\Screen2" "Logo.ini"]
IfFalseAction=[!ActivateConfig "00-POSI\Screen2" "Gallery.ini"]
DynamicVariables=1
Extending this is pretty simple: remove the IfFalseAction option of the [DateDayTime] measure and add furhter IfConditions / IfTrueActions, to cover the whole range from 0.00 to 23.59. For instance:
Code: Select all
[DateDayTime]
Measure=TIME
Format=%#H.%M
IfCondition=(#CURRENTSECTION#<=6)
IfTrueAction=[!SetVariable Skin "1"][!UpdateMeasure "MeasureSkin"]
IfCondition2=((#CURRENTSECTION#>6)&&(#CURRENTSECTION#<=18))
IfTrueAction2=[!SetVariable Skin "2"][!UpdateMeasure "MeasureSkin"]
IfCondition3=(#CURRENTSECTION#>18)
IfTrueAction3=[!SetVariable Skin "3"][!UpdateMeasure "MeasureSkin"]
[MeasureSkin]
Measure=Calc
Formula=#Skin#
IfCondition=(#CURRENTSECTION#=1)
IfTrueAction=[!ActivateConfig "00-POSI\Screen2" "Logo.ini"]
IfCondition2=(#CURRENTSECTION#=2)
IfTrueAction2=[!ActivateConfig "00-POSI\Screen2" "Gallery.ini"]
IfCondition3=(#CURRENTSECTION#=3)
IfTrueAction3=[!ActivateConfig "00-POSI\Screen2" "ThirdSkin.ini"]
The [MeasureSkin] measure is not absolutely needed. If it seems simpler for you, you can add the appropriate bangs which have to be executed, directly to the IfTrueAction options of the [DateDayTime] measure.
Please let me know if you have any question.