It is currently May 2nd, 2024, 12:37 am

Active skins?

Get help with creating, editing & fixing problems with skins
User avatar
alexandeu
Posts: 52
Joined: March 15th, 2013, 1:22 am
Location: Canada

Active skins?

Post by alexandeu »

I've made a suite,
in the suite is a skin that Activates/Deactivates the other skins in the suite.

I was wondering if there was any way to leverage the information from the
"C:\Users\YourName\AppData\Roaming\Rainmeter"

The
Active=
Section.

The suite would be perfect if I could do this.
Any help is appreciated!
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Active skins?

Post by Mordasius »

One approach would be to read Rainmeter.ini with WebParser and extract information with RegExp http://docs.rainmeter.net/tips/webparser-local-files

I expect you'll need to use Lookahead Assertions http://docs.rainmeter.net/tips/webparser-lookahead-assertions-in-regexp
User avatar
alexandeu
Posts: 52
Joined: March 15th, 2013, 1:22 am
Location: Canada

Re: Active skins?

Post by alexandeu »

Thanks!
Although...I have no experience parsing from text files...
And I don't think this is how I'm supposed to do it, haha.

[PlayOnParse]
Measure=Plugin
Plugin=WebParser
Url=file://C:\Users\Ojain\AppData\Roaming\Rainmeter\Rainmeter.ini
RegExp="(?siU)<Stealthy\Play>.*<active>(.*)</active>.*</Stealthy\Play>"

[PlayOnCalc]
Measure=Calc
Formula=PlayOnParse>0?1:0
IfEqualValue=1
IfEqualAction=[!ShowMeter LPlayBoxOn]
IfBelowValue=1
IfBelowAction=[!HideMeter LPlayBoxOn]
Also, in Rainmeter.ini,
It only shows the folder, and not individual skins...
Which I could see becoming a problem since I made a
"Left-Side Skin" and a "Right-Side Skin" in the same folder.

I'm just wondering if there are any plugins or addons that could be what I'm looking for.
User avatar
Mordasius
Posts: 1173
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Active skins?

Post by Mordasius »

alexandeu wrote:..in Rainmeter.ini, It only shows the folder, and not individual skins...Which I could see becoming a problem since I made a "Left-Side Skin" and a "Right-Side Skin" in the same folder.
I suggest you grab a copy of =[url=RainRegExphttp://rainmeter.net/forum/viewtopic.php?f=18&t=769&hilit=RainRegExp]RainRegExp[/url] to help come up with a working RegExp .

I probably should have mentioned that there are more possibilities that Active=0 or Active=1. Active=2 means that the 2nd alphabetically ranked skin in the folder is active. This means that you need to change [PlayOnCalc] to:

Code: Select all

[PlayOnCalc]
Measure=Calc
Formula=PlayOnParse>0?1:0
IfAbovelValue=0
IfAboveAction=[!ShowMeter LPlayBoxOn]
IfBelowValue=1
IfBelowAction=[!HideMeter LPlayBoxOn]
alexandeu wrote:..I'm just wondering if there are any plugins or addons that could be what I'm looking for.
Maybe there are and maybe someone else will tell us what you could use.
User avatar
alexandeu
Posts: 52
Joined: March 15th, 2013, 1:22 am
Location: Canada

Re: Active skins?

Post by alexandeu »

Wow, thanks! That's really helpful!

I got RainRegExp to work out what I need,
[PlayOnParse]
Measure=Plugin
Plugin=WebParser
Url=file://%UserProfile%\AppData\Roaming\Rainmeter\Rainmeter.ini
RegExp=(?siU)\[Stealthy\\Play\](.*)WindowX
Which in RainRegExp, it gives me "Active=2"

But when I implement the RegExp into my skin,
checking with a string meter, the whole thing:
[Stealthy\Play]
Active=2
WindowX
is what I get.

I tried using "Substitute=", but I think the line-break is messing it up.
#CRLF# doesn't seem to work...
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Active skins?

Post by fonpaolo »

You can use ClipString=2 and play with Width: W=20, or more/less.
User avatar
alexandeu
Posts: 52
Joined: March 15th, 2013, 1:22 am
Location: Canada

Re: Active skins?

Post by alexandeu »

fonpaolo wrote:You can use ClipString=2 and play with Width: W=20, or more/less.
I actually got it, adding "StringIndex="
which got rid of "[Stealthy\Play]" and "WindowX".
and Substitute to get rid of "Active="

Thank you though
User avatar
alexandeu
Posts: 52
Joined: March 15th, 2013, 1:22 am
Location: Canada

Re: Active skins?

Post by alexandeu »

What I AM having problems now is my HighLight boxes...
[PlayOnParse]
Measure=Plugin
Plugin=WebParser
Url=file://%UserProfile%\AppData\Roaming\Rainmeter\Rainmeter.ini
RegExp=(?siU)\[Stealthy\\Play](.*)WindowX.*
Substitute="Active=":""
StringIndex=1

[PlayOnCalc]
Measure=Calc
Formula=PlayOnParse
IfAboveValue=1
IfAboveAction=[!ShowMeter LPlayBoxOn][!HideMeter RPlayBoxOn][!Redraw]
IfEqualValue=1
IfEqualAction=[!ShowMeter RPlayBoxOn][!HideMeter LPlayBoxOn][!Redraw]
IfBelowValue=1
IfBelowAction=[!HideMeter LPlayBoxOn][!HideMeter RPlayBoxOn][!Redraw]

;OnBoxes
[LPlayBoxOn]
Meter=Image
SolidColor=40,40,40
X=(#ScreenAreaWidth#-38)
Y=12
W=18
H=36
Hidden=1
Group=On

[RPlayBoxOn]
Meter=Image
SolidColor=40,40,40
X=(#ScreenAreaWidth#-20)
Y=12
W=18
H=36
Hidden=1
Group=On
Something tells me the CalcMeasure isn't doing what it's supposed to
User avatar
alexandeu
Posts: 52
Joined: March 15th, 2013, 1:22 am
Location: Canada

Re: Active skins?

Post by alexandeu »

[Parse]
Measure=Plugin
Plugin=WebParser
Url=file://%UserProfile%\AppData\Roaming\Rainmeter\Rainmeter.ini
RegExp=(?siU)\[Stealthy\\Sound](.*)WindowX.*\[Stealthy\\Appli](.*)WindowX.*\[Stealthy\\Gmail](.*)WindowX.*\[Stealthy\\Play](.*)WindowX.*\[Stealthy\\Stat](.*)WindowX.*\[Stealthy\\Task](.*)WindowX.*\[Stealthy\\Note](.*)WindowX.*\[Stealthy\\Climate](.*)WindowX.*\[Stealthy\\Agenda](.*)WindowX.*
UpdateRate=20

[ParseSound]
Measure=Plugin
Plugin=WebParser
Url=[Parse]
Substitute="Active=":""
StringIndex=1
FinishAction=[!UpdateMeasure SoundOn]

[SoundOn]
Measure=Calc
Formula=ParseSound
IfAboveValue=1
IfAboveAction=[!ShowMeter RSoundBoxOn][!HideMeter LSoundBoxOn][!Redraw]
IfEqualValue=1
IfEqualAction=[!ShowMeter LSoundBoxOn][!HideMeter RSoundBoxOn][!Redraw]
IfBelowValue=1
IfBelowAction=[!HideMeter RSoundBoxOn][!HideMeter LSoundBoxOn][!Redraw]
Still no luck.

I checked the log and [SoundOn] isn't getting the string value from [ParseSound],
even though any String Meter with [ParseSound] as MeasureName will give me string value...
I don't know what's wrong.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Active skins?

Post by jsmorley »

You are using the numeric value of the [ParseSound] child WebParser measure in the Formula of the Calc measure. That will be the same as the string value in the case of WebParser, but since the numeric value will not react to Substitute and have had the "Active=" removed from it, any Calc measure will see it as a numeric value of zero.

You need to use:

Formula=[ParseSound]
DynamicVariables=1

on the Calc measure to dynamically use the string value of [ParseSound] as a section variable, that way it will reflect the substitution.

BTW, FinishAction only has any effect when used on the parent WebParser measure. I'm not sure that makes much difference here though, since the !UpdateMeasure is really pointless in this case anyway. The Calc measure is going to update in the normal course of events in any case.