It is currently April 24th, 2024, 10:02 am

Activate Configs According to Day?

Get help with creating, editing & fixing problems with skins
Ben Hill
Posts: 20
Joined: November 30th, 2009, 1:05 am

Activate Configs According to Day?

Post by Ben Hill »

I want to activate one config on M, T, W, & F; a different config version on Th; and neither on Sat or Sun.

Can I start a config and get these configs to activate and deactivate themselves according to a day code? Seems like the answer ought to be, "Yes!", but I'm not having any luck yet.

I've tried getting a day number using "%w", and then using IfEqualValue and IfEqualAction to Activate and Deactivate my configs. "About" shows that the values are being correctly generated, but the Activation and Deactivation don't happen.

Code: Select all

[MeasureDay]
Measure=Time
Format="%w"

[ThursdayMeter]
Measure=Calc
Formula=MeasureDay - 7
Substitute="-3":"1","-6":"0","-5":"0","-4":"0","-2":"0","-1":"2","-7":"2",".0":""
;(Sunday is -7, Saturday is -6, etc.)
IfEqualValue=1
IfEqualAction=!Execute [!RainmeterDeactivateConfig CountDown\CountdownRegular][!RainmeterActivateConfig CountDown\CountdownThursday CountdownThursday][!RainmeterRedraw]
;(The different configs are in separate folders)
IfEqualValue=0
IfEqualAction=!Execute [!RainmeterDeactivateConfig CountDown\CountdownThursday][!RainmeterActivateConfig CountDown\CountdownRegular CountdownRegular][!RainmeterRedraw]
IfEqualValue=2
IfEqualAction=!Execute [!RainmeterDeactivateConfig CountDown\CountdownRegular][!RainmeterDeactivateConfig CountDown\CountdownThursday]
Does someone know of a method that might work for me?
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Activate Configs According to Day?

Post by JpsCrazy »

Make it so MeasureDay has a substitute - "Monday":"1","Tuesday":"2",etc and be sure to use DynamicVariables
Ben Hill
Posts: 20
Joined: November 30th, 2009, 1:05 am

Re: Activate Configs According to Day?

Post by Ben Hill »

Thank you.

When I tried "%A" for the day and used "Substitute", I never could get a reading (looking in "About") for [ThursdayMeter] - even using DynamicVariables=1. Finally I got brackets around MeasureDay in my [ThursdayMeter] and it did get a reading. But the IfEqualValue commands didn't respond like I wanted so I guess I messed up there.

Also, I am confused whether a config can Activate another and then Deactivate itself if the bangs are in the correct order in an !Execute statement, or do I need another controlling config to activate and deactivate?
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Activate Configs According to Day?

Post by JpsCrazy »

Sometimes, IfAbove AND IfBelow statements work better than IfEqual.

If I'm understanding you correctly, it should be able to deactivate other configs and then itself, as long as it deactivates itself last.
Ben Hill
Posts: 20
Joined: November 30th, 2009, 1:05 am

Re: Activate Configs According to Day?

Post by Ben Hill »

Thank you again. I have it working correctly now. I won't say the stupid mistake that I was making :insider: , but your comments helped me to better see what I was doing.