So this should be a fairly quick question.
I have a skin that I want to show a certain meter when the skin is clickthrough. I'm trying to use the IfCondition Action and want to know if it's even possible and if so, what's the command I am supposed to be using?
NOTE: I know it can be done by parsing the rainmeter.ini file but my attempt was a failure, I wanted to know if there's a simpler way.
It is currently April 19th, 2024, 12:49 pm
Check if a skin is ClickThrough
-
- Posts: 7
- Joined: April 26th, 2022, 3:15 pm
-
- Posts: 513
- Joined: May 4th, 2020, 3:01 pm
- Location: Ankara, TURKEY
Re: Check if a skin is ClickThrough
You can look Skin Bangs or Meter Bangs https://docs.rainmeter.net/manual/bangs/GingerGuy118 wrote: ↑April 26th, 2022, 3:19 pm So this should be a fairly quick question.
I have a skin that I want to show a certain meter when the skin is clickthrough. I'm trying to use the IfCondition Action and want to know if it's even possible and if so, what's the command I am supposed to be using?
NOTE: I know it can be done by parsing the rainmeter.ini file but my attempt was a failure, I wanted to know if there's a simpler way.
If you want to show/hide a meter;
Code: Select all
[ShowHideMeter]
Meter=IMAGE
ImageName="IMAGE"
x=....
y=...
W=...
H=...
LeftMouseUpAction=[!ToogleMeter ABCD] ; or [!ShowMeter ABCD]
[ABCD]
Meter=IMAGE
ImageName="IMAGE"
x=....
y=...
W=...
H=...
Hidden=1 ; Important
Code: Select all
;Main Skin
[Rainmeter]
Update=1000
OnRefreshAction=[!DeactivateConfig "ABCD" "ABCD.ini"] ; or [!ToogleConfig "ABCD" "ABCD.ini"]
[ShowSkin]
Meter=IMAGE
ImageName="IMAGE"
x=....
y=...
W=...
H=...
LeftMouseUpAction=[!ActivateConfig "ABCD" "ABCD.ini"]
I don't know where i going from here, but i promise it won't be boring...
-
- Posts: 7
- Joined: April 26th, 2022, 3:15 pm
Re: Check if a skin is ClickThrough
I guess I didn't fully clarify myself. I don't have a problem of hiding the meter. My problem is hiding it only when the skin becomes clickthrough, I am trying to use it is as a condition but I don't know what the condition needs to be for that to work or if there's even a condition
-
- Posts: 513
- Joined: May 4th, 2020, 3:01 pm
- Location: Ankara, TURKEY
Re: Check if a skin is ClickThrough
Sorry i misunderstood.GingerGuy118 wrote: ↑April 26th, 2022, 10:07 pm I guess I didn't fully clarify myself. I don't have a problem of hiding the meter. My problem is hiding it only when the skin becomes clickthrough, I am trying to use it is as a condition but I don't know what the condition needs to be for that to work or if there's even a condition
EDIT:
You should read the skin clickthrough value from the Rainmeter.ini file. (C:\Users\username\AppData\Roaming\Rainmeter)
Then you can use it by assigning it to the variable.
I don't know where i going from here, but i promise it won't be boring...
-
- Rainmeter Sage
- Posts: 16144
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Check if a skin is ClickThrough
There is no other way than using a WebParser measure to get the needed information. I don't see a way to get the ClickThrough setting, not even of the current skin, other than parsing the Rainmeter.ini, as said. But it doesn't hurt and can easily be done.GingerGuy118 wrote: ↑April 26th, 2022, 3:19 pm I have a skin that I want to show a certain meter when the skin is clickthrough. I'm trying to use the IfCondition Action and want to know if it's even possible and if so, what's the command I am supposed to be using?
NOTE: I know it can be done by parsing the rainmeter.ini file but my attempt was a failure, I wanted to know if there's a simpler way.
Here is an example: add the following measure to your code:
Code: Select all
[MeasureRainmeter]
Measure=WebParser
UpdateRate=5
Url=file://#SETTINGSPATH#Rainmeter.ini
DecodeCharacterReference=1
CodePage=1200
RegExp=(?siU)^.*\[#CURRENTCONFIG#].*ClickThrough=(\d{1,}).*$
StringIndex=1
IfCondition=(#CURRENTSECTION#>=1)
IfTrueAction=[!ShowMeter "MyMeter"][!Redraw]
IfFalseAction=[!HideMeter "MyMeter"][!Redraw]
Note the UpdateRate=5 option, which makes the measure to be updated every 5 seconds. This means that when you set the ClikcThrough, the skin will react in up to 5 seconds. If needed you can modify this even to UpdateRate=1, however I'm not sure if it worth.
See the IfCondition and the appropriate IfTrueAction and IfFalseAction options. When the ClickThrough is set, the IfTrueAction option shows the meter, otherwise the IfFalseAction hides it. Make sure to use the correct meter name in the !ShowMeter and !HideMeter bangs.
Is this what was needed?
-
- Posts: 7
- Joined: April 26th, 2022, 3:15 pm
Re: Check if a skin is ClickThrough
That was a very helpful code and explanation. It works now. I wish to thank you and hope that you have a fantastic day!
-
- Rainmeter Sage
- Posts: 16144
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Check if a skin is ClickThrough
Glad you got it working and you're welcome. Wish a fantastic day to you too.GingerGuy118 wrote: ↑April 29th, 2022, 12:16 pm That was a very helpful code and explanation. It works now. I wish to thank you and hope that you have a fantastic day!