It is currently March 19th, 2024, 10:17 am

ConfigActive 2.2.1

Plugins and Addons popular with the Community
User avatar
balala
Rainmeter Sage
Posts: 16091
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ConfigActive 2.2.1

Post by balala »

jsmorley wrote: March 28th, 2019, 9:15 pm Right. The support for \\ is just to be sure that if you are jumping in and out of Lua, where \ is a reserved character in pattern matching, you don't run into trouble. The point was just be sure that if you DID pass the plugin a config name with \\in it, it would handle it gracefully.
Understand, thanks for the info... :thumbup:
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: ConfigActive 2.2.1

Post by sl23 »

Have I got this right... :confused:

Code: Select all

[mConfig]
Measure=Plugin
Plugin=ConfigActive
IfCondition=([&mConfig:IsActive(Rounded\RoundClock\RoundClock.ini)] = 1)
IfTrueAction=[!SetOption Skin1 FillColor #Color2#]
IfFalseAction=[!SetOption Skin1 FillColor #Color5#]
User avatar
SilverAzide
Rainmeter Sage
Posts: 2579
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: ConfigActive 2.2.1

Post by SilverAzide »

sl23 wrote: September 11th, 2021, 5:49 pm Have I got this right... :confused:

Code: Select all

[mConfig]
Measure=Plugin
Plugin=ConfigActive
IfCondition=([&mConfig:IsActive(Rounded\RoundClock\RoundClock.ini)] = 1)
IfTrueAction=[!SetOption Skin1 FillColor #Color2#]
IfFalseAction=[!SetOption Skin1 FillColor #Color5#]
You might need to remove the ".ini" from the end of the config name. I don't think the extension is part of the name of a config.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: ConfigActive 2.2.1

Post by sl23 »

Thanks for the reply. I just tried your suggestion, but it doesn't work.

So, does this plugin work in a similar way to the Process plugin? By that, I mean, if a Process/Skin is active the IfTrueAction is executed, and if the Process/Skin is inactive then the IfFalseAction is executed. Is that correct?
User avatar
balala
Rainmeter Sage
Posts: 16091
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ConfigActive 2.2.1

Post by balala »

sl23 wrote: September 11th, 2021, 5:49 pm Have I got this right... :confused:

Code: Select all

[mConfig]
Measure=Plugin
Plugin=ConfigActive
IfCondition=([&mConfig:IsActive(Rounded\RoundClock\RoundClock.ini)] = 1)
IfTrueAction=[!SetOption Skin1 FillColor #Color2#]
IfFalseAction=[!SetOption Skin1 FillColor #Color5#]
Is this a question?
Besides SilverAzide's reply, note that there are three (or even four) mistakes in the provided code:
  • You have to use a ConfigName option on the ConfigActive plugin measure, otherwise there is no config to check if it is activated or not (see below an idea about the name of a config as well).
  • The parameter used in the IfCondition option (the one in the parentheses) has to be a config, not a skin. If your skin is Rounded\RoundClock\RoundClock.ini, the appropriate config is Rounded\RoundClock and the name of the skin is RoundClock.ini. Accordingly use Rounded\RoundClock, not Rounded\RoundClock\RoundClock.ini.
  • Having used a section variable in the IfCondition option, you have to add a DynamicVariables=1 option to the measure, section variables requiring this option.
  • What you mean by [!SetOption Skin1 FillColor #ColorX#]? I mean that is there a FillColor option which can be set with the !SetOption bang? I suppose you meant FontColor, instead of FillColor.
Accordingly the measure should look something like this:

Code: Select all

[mConfig]
Measure=Plugin
Plugin=ConfigActive
ConfigName=Rounded\RoundClock
IfCondition=([&mConfig:IsActive(Rounded\RoundClock)] = 1)
IfTrueAction=[!SetOption MeterPI FontColor #Color2#]
IfFalseAction=[!SetOption MeterPI FontColor #Color5#]
DynamicVariables=1
Additionally note that this IfCondition can be used on any measure, it doesn't have to be used on the ConfigActive plugin measure. It is right there, but can be used on any measure (just have to take care to have added the DynamicVariables=1 option to all measures where it is used).
Details in the first post of this topic.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: ConfigActive 2.2.1

Post by sl23 »

Of course it's a question! :p :D

Thanks balala, really appreciate your help, I'll give it a try.

One more thing though... Can I specify more than one ConfigName like this:

Code: Select all

[mConfig]
Measure=Plugin
Plugin=ConfigActive
ConfigName=Rounded\RoundClock
ConfigName2=Rounded\RoundNet
IfCondition=([&mConfig:IsActive(Rounded\RoundClock)] = 1)
IfTrueAction=[!SetOption MeterPI FontColor #Color2#]
IfFalseAction=[!SetOption MeterPI FontColor #Color5#]
IfCondition2=([&mConfig:IsActive(Rounded\RoundNet)] = 1)
IfTrueAction2=[!SetOption MeterPI FontColor #Color2#]
IfFalseAction2=[!SetOption MeterPI FontColor #Color5#]
DynamicVariables=1
I did forget the DynamicVariables, thanks for pointing it out!

No, I meant FillColor as this is for a ShapeMeter "Button."
User avatar
SilverAzide
Rainmeter Sage
Posts: 2579
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: ConfigActive 2.2.1

Post by SilverAzide »

sl23 wrote: September 11th, 2021, 6:47 pm One more thing though... Can I specify more than one ConfigName like this:
I don't think you can use more than one ConfigName, but your IfConditions definitely can. In fact, by doing this with IfConditions, you don't even need the ConfigName parameter.
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: ConfigActive 2.2.1

Post by sl23 »

Ah ok, that's what I first thought looking at your code, but after balala replied, I thought maybe I missed something from your code that makes it work?

What am I doing wrong? :confused:

EDIT: Should I be using this [!SetOption Skin1 FillAlpha "FillColor #Color2#"] instead of this [!SetOption Skin1 FillColor #Color2#]
User avatar
balala
Rainmeter Sage
Posts: 16091
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ConfigActive 2.2.1

Post by balala »

sl23 wrote: September 11th, 2021, 6:47 pm One more thing though... Can I specify more than one ConfigName like this:
No, definitely not! A ConfigActive plugin measure checks one config. To check another, you have to add a second ConfigActive plugin measure.
sl23 wrote: September 11th, 2021, 6:47 pm No, I meant FillColor as this is for a ShapeMeter "Button."
Is there a Fill Color option on the Shape meters? In fact I think it is Fill Color (with a space), and even this is not a stand alone option, but can be used as part of a Shape meter, to color it.
But (!) the answer to your question:
sl23 wrote: September 11th, 2021, 7:11 pm EDIT: Should I be using this [!SetOption Skin1 FillAlpha "FillColor #Color2#"] instead of this [!SetOption Skin1 FillColor #Color2#]
is yes and no, because you should have to use the "correct" and "complete" form: [!SetOption Skin1 FillAlpha "Fill Color #Color2#"] (see again the space in the Fill Color parameter). But the !SetOption bang will work even if there is no space, so your form of the bang works, even if correctly and exactly it should have the space.
However note even this will work only if you defined an Extend FillAlpha parameter on the Shape meter (I suppose you did).
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: ConfigActive 2.2.1

Post by sl23 »

Thanks balala. I'll give it another bash! :D

I am however, confused as to whether I need to specify ConfigName as you and SilverAside seem to have different views on this?
Post Reply