It is currently September 20th, 2019, 8:28 am

Rainmeter wallpaper problems

Help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 19461
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Rainmeter wallpaper problems

jsmorley » August 2nd, 2019, 3:40 pm

sockeater wrote:
August 2nd, 2019, 3:35 pm
Thank you jsmorley, eclectic-tech, and balala for helping me through my rainmeter problems!
I got the layout changer to finally start working and I think I'm going to make it so it opens a random layout(I want to incorporate random inspirational quotes and such with layouts).

From the code provided by eclectic-tech, is there a way to make it so that highbound matches with the number of layouts I currently have saved or is that not possible?

Code: Select all

[mRandom]
Measure=Calc
Formula=Random
LowBound=1
HighBound=3
DynamicVariables=1

[mTime]
Measure=Time
Format=%H%M%S
IfCondition=mTime=60000
IfTrueAction=[!LoadLayout "MyMorningLayout[%mRandom]"]

I would think you would want something like:

Code: Select all

[mRandom]
Measure=Calc
Formula=Random
LowBound=1
HighBound=3
UpdateRandom=1
UpdateDivider=-1


[mTime]
Measure=Time
Format=%H%M%S
IfCondition=mTime=60000
IfTrueAction=[!UpdateMeasure mRandom][!LoadLayout "MyMorningLayout[mRandom]"]
DynamicVariables=1
Note that since it is loading a new layout, and thus reloading this skin, you can't have any kind of UniqueRandom option, and it will randomly pick one of the three each time, with no certainty that it won't pick the same one twice in a row.
User avatar
balala
Rainmeter Sage
Posts: 8626
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rainmeter wallpaper problems

balala » August 2nd, 2019, 4:01 pm

sockeater wrote:
August 2nd, 2019, 3:35 pm
From the code provided by eclectic-tech, is there a way to make it so that highbound matches with the number of layouts I currently have saved or is that not possible?
Automatically? Probably no. Or at least not too simply. Maybe a Lua code might help. However adding manually a variable like HighBound=3 (at least in case of the posted code) and using that variable into the HighBound option of the [mRandom] measure might help:

Code: Select all

[Variables]
HighBound=3

[mRandom]
...
HighBound=#HighBound#
...

[mTime]
...
This way is much easier to modify the limit, whenever are you saving a new layout.
Leave me a little time to study if a Lua code can help to automatically get the number of saved layouts. Will come back with an answer a little bit later.
User avatar
balala
Rainmeter Sage
Posts: 8626
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rainmeter wallpaper problems

balala » August 2nd, 2019, 5:36 pm

sockeater wrote:
August 2nd, 2019, 3:35 pm
From the code provided by eclectic-tech, is there a way to make it so that highbound matches with the number of layouts I currently have saved or is that not possible?
Ok, my approach. There might be better solution, but for now at least, this is what have I figured out.
So, we can let the OS to get the number of folders within the Layouts folder. This number matches the number of existing layouts.
IMPORTANT: if there are any layouts which don't have to be included, this solution fails. Use it ONLY if all existing layouts can be used.
Add the following RunCommand plugin measure to your code:

Code: Select all

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=dir "#SETTINGSPATH#Layouts"
State=Hide
RegExpSubstitute=1
Substitute="(?siU).*\n.*(\d{1,4}) Dir\(s\).*":"\1","(\d+).*":"\1","\n":"","^$":"1"
FinishAction=[!EnableMeasure "MeasureRandom"]
When executed, this measure returns the number of existing folders within the Layouts folder (as said, this matches the total number of existing layouts). The !EnableMeasure bang of the FinishAction option enables the [MeasureRandom] measure, which I had to disable (see below).
Now modify the [MeasureRandom] measure as it follows:

Code: Select all

[MeasureRandom]
Measure=Calc
Formula=Random
LowBound=1
HighBound=[MeasureRun]
UpdateRandom=1
DynamicVariables=1
Disabled=1
See that I used the [MeasureRun] measure into the HighBound option. But if you do so, when the skin is refreshed / loaded, you'll get an error message in the log, that's why I had to disable the measure (adding the Disabled=1 option).
The final step is to run the newly added Plugin measure when the skin is refreshed / loaded, in order to get the number of existing layouts and use this number into the [MeasureRandom] measure. You can do this by adding an OnRefreshAction=[!CommandMeasure "MeasureRun" "Run"] option to the [Rainmeter] section of the code.

Please let me know if you got this solution working.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3543
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Rainmeter wallpaper problems

eclectic-tech » August 3rd, 2019, 3:40 am

sockeater wrote:
August 2nd, 2019, 3:35 pm
Thank you jsmorley, eclectic-tech, and balala for helping me through my rainmeter problems!
I got the layout changer to finally start working and I think I'm going to make it so it opens a random layout(I want to incorporate random inspirational quotes and such with layouts).

From the code provided by eclectic-tech, is there a way to make it so that highbound matches with the number of layouts I currently have saved or is that not possible?
Balala offered a workable solution, but I feel a better method would be to use the FileView plugin which not only can count the number of layouts you have, but can also let you limit which layouts to list by using WildcardSearch.

Here is a skin that will list up to 6 layouts and set a random layout from the list at 6 am, 12 pm, and 6 pm.
There are several notes in the skin to assist in modifying it for your needs.

Remember you need to include this skin in each saved layout in order for it to be active for the next change.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Variables]
Time1=060000
Time2=120000
Time3=180000
NumberOfFoundLayouts=0

; Reads the Layout folder and returns folder names (Layout Names)
; WildcardSearch can limit the folder to specific Layout Name(s)
; To use more than 6 you must change "Count" to match your number, and add child measures for the additional number of folders
; See the note before [mRandom] concerning WildcardSearch settings
[MeasureFileViewParent]
Measure=Plugin
Plugin=FileView
Path="#SETTINGSPATH#Layouts"
Type=FolderCount
ShowDotDot=0
WildcardSearch=*
Count=6
FinishAction=[!EnableMeasure mRandom][!UpdateMeasure mRandom]
UpdateDivider=300

[MeasureFileViewChild1]
Measure=Plugin
Plugin=FileView
Path=[MeasureFileViewParent]
Index=1
Type=FileName
IfMatch=^$
IfNotMatchAction=[!SetVariable NumberOfFoundLayouts 1]

[MeasureFileViewChild2]
Measure=Plugin
Plugin=FileView
Path=[MeasureFileViewParent]
Index=2
Type=FileName
IfMatch=^$
IfNotMatchAction=[!SetVariable NumberOfFoundLayouts 2]

[MeasureFileViewChild3]
Measure=Plugin
Plugin=FileView
Path=[MeasureFileViewParent]
Index=3
Type=FileName
IfMatch=^$
IfNotMatchAction=[!SetVariable NumberOfFoundLayouts 3]

[MeasureFileViewChild4]
Measure=Plugin
Plugin=FileView
Path=[MeasureFileViewParent]
Index=4
Type=FileName
IfMatch=^$
IfNotMatchAction=[!SetVariable NumberOfFoundLayouts 4]

[MeasureFileViewChild5]
Measure=Plugin
Plugin=FileView
Path=[MeasureFileViewParent]
Index=5
Type=FileName
IfMatch=^$
IfNotMatchAction=[!SetVariable NumberOfFoundLayouts 5]

[MeasureFileViewChild6]
Measure=Plugin
Plugin=FileView
Path=[MeasureFileViewParent]
Index=6
Type=FileName
IfMatch=^$
IfNotMatchAction=[!SetVariable NumberOfFoundLayouts 6]

; Set LowBound to 2 if WildcardSearch is * and "@Backup" folder is found
; Set LowBound to 1 if using any WildcardSearch other than *
[mRandom]
Measure=Calc
Formula=Random
LowBound=2
HighBound=#NumberOfFoundLayouts#
DynamicVariables=1
Disabled=1
OnUpdateAction=[!SetVariable NewLayout """[!LoadLayout "[&MeasureFileViewChild[&mRandom]]"]"""]
; Note the 'entire' bang to !LoadLayout MUST be defined in the above variable in order to evalute and replace the measure values and have an executable bang

[mTime]
Measure=Time
Format=%H%M%S
IfCondition=mTime=#Time1#
IfTrueAction=[!Delay 5000][#NewLayout][!Log "Layout [&MeasureFileViewChild[&mRandom]] Loaded"]
IfCondition2=mTime=#Time2#
IfTrueAction2=[!Delay 5000][#NewLayout][!Log "Layout [&MeasureFileViewChild[&mRandom]] Loaded"]
IfCondition3=mTime=#Time3#
IfTrueAction3=[!Delay 5000][#NewLayout][!Log "Layout [&MeasureFileViewChild[&mRandom]] Loaded"]
IfConditionMode=1
DynamicVariables=1

[Meter]
Meter=String
User avatar
balala
Rainmeter Sage
Posts: 8626
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rainmeter wallpaper problems

balala » August 3rd, 2019, 6:31 am

eclectic-tech wrote:
August 3rd, 2019, 3:40 am
Balala offered a workable solution, but I feel a better method would be to use the FileView plugin which not only can count the number of layouts you have, but can also let you limit which layouts to list by using WildcardSearch.
As usually this time as well there are more solutions. As more, as better...
:great:
sockeater
Posts: 17
Joined: July 30th, 2019, 2:43 pm

Re: Rainmeter wallpaper problems

sockeater » August 4th, 2019, 12:49 am

Thank you all for the continued assistance! I'll post again if I can come up with some questions :D
sockeater
Posts: 17
Joined: July 30th, 2019, 2:43 pm

Re: Rainmeter wallpaper problems

sockeater » August 4th, 2019, 5:08 pm

I noticed that when I am watching a youtube video and the layout changes, all the skin is placed on top of youtube video, obstructing what I am watching at the time, does ZPos fix this issue?
User avatar
balala
Rainmeter Sage
Posts: 8626
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rainmeter wallpaper problems

balala » August 4th, 2019, 5:47 pm

sockeater wrote:
August 4th, 2019, 5:08 pm
I noticed that when I am watching a youtube video and the layout changes, all the skin is placed on top of youtube video, obstructing what I am watching at the time, does ZPos fix this issue?
I don't have such issues, so maybe there is one question: is set the position of those skins? You might try setting their position to Normal, by adding an OnRefreshAction=[!ZPos "0"] option to the [Rainmeter] section of the skins. Depending the number of skins we're talking about, this might be uncomfortable. But if you have all those skins included into a group of skins, you might add to any of the skins belonging the layout, the following option, same way into the [Rainmeter] section: OnRefreshAction=[!ZPosGroup "0" "YourGroup"].
As I can't replicate the issue, I'm not sure how will this work, but probably it worth a try. If you can't get it to work, please pack the whole config containing the skins involved into those layouts (supposing they belong to one single config), include the layouts and upload the package here, to can check what's going on.
sockeater
Posts: 17
Joined: July 30th, 2019, 2:43 pm

Re: Rainmeter wallpaper problems

sockeater » August 16th, 2019, 4:02 pm

Hey guys, so I wanted to create a skin that puts out a random layout every 5 minutes and i'm getting problems. The purpose of the skin is to have a random quote and have some random skins within the layout. The problem is that it keeps cycling through the layouts extremely quickly! I have ~50 layouts set up so far and it is supposed to switch every 5 minutes but it goes thru multiple layouts within a second. Here is the code that I used, hoping I wouldn't have to do anything more complicated.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
Group=#RootConfig#

[mRandom]
Measure=Calc
Formula=Random
LowBound=1
HighBound=50
UpdateRandom=1
UpdateDivider=-1


[mTime]
Measure=Time
Format=%H%M%S
IfCondition=(mTime>=000000) && (mTime<000005)
IfTrueAction=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition2=(mTime>=000500) && (mTime<000505)
IfTrueAction2=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition3=(mTime>=001000) && (mTime<001005)
IfTrueAction3=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition4=(mTime>=001500) && (mTime<001505)
IfTrueAction4=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition5=(mTime>=002000) && (mTime<002005)
IfTrueAction5=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition6=(mTime>=002500) && (mTime<002505)
IfTrueAction6=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition7=(mTime>=003000) && (mTime<003005)
IfTrueAction7=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition8=(mTime>=003500) && (mTime<003505)
IfTrueAction8=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition9=(mTime>=004000) && (mTime<004005)
IfTrueAction9=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition10=(mTime>=004500) && (mTime<004505)
IfTrueAction10=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition11=(mTime>=005000) && (mTime<005005)
IfTrueAction11=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition12=(mTime>=005500) && (mTime<005505)
IfTrueAction12=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition13=(mTime>=010000) && (mTime<010005)
IfTrueAction13=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition14=(mTime>=010500) && (mTime<010505)
IfTrueAction14=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition15=(mTime>=011000) && (mTime<011005)
IfTrueAction15=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition16=(mTime>=011500) && (mTime<011505)
IfTrueAction16=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition17=(mTime>=012000) && (mTime<012005)
IfTrueAction17=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition18=(mTime>=012500) && (mTime<012505)
IfTrueAction18=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition19=(mTime>=013000) && (mTime<013005)
IfTrueAction19=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition20=(mTime>=013500) && (mTime<013505)
IfTrueAction20=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition21=(mTime>=014000) && (mTime<014005)
IfTrueAction21=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition22=(mTime>=014500) && (mTime<014505)
IfTrueAction22=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition23=(mTime>=015000) && (mTime<015005)
IfTrueAction23=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition24=(mTime>=015500) && (mTime<015505)
IfTrueAction24=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition25=(mTime>=020000) && (mTime<020005)
IfTrueAction25=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition26=(mTime>=020500) && (mTime<020505)
IfTrueAction26=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition27=(mTime>=021000) && (mTime<021005)
IfTrueAction27=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition28=(mTime>=021500) && (mTime<021505)
IfTrueAction28=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition29=(mTime>=022000) && (mTime<022005)
IfTrueAction29=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition30=(mTime>=022500) && (mTime<022505)
IfTrueAction30=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition31=(mTime>=023000) && (mTime<023005)
IfTrueAction31=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition32=(mTime>=023500) && (mTime<023505)
IfTrueAction32=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition33=(mTime>=024000) && (mTime<024005)
IfTrueAction33=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition34=(mTime>=024500) && (mTime<024505)
IfTrueAction34=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition35=(mTime>=025000) && (mTime<205005)
IfTrueAction35=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition36=(mTime>=025500) && (mTime<025505)
IfTrueAction36=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition37=(mTime>=030000) && (mTime<030005)
IfTrueAction37=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition38=(mTime>=030500) && (mTime<030505)
IfTrueAction38=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition39=(mTime>=031000) && (mTime<031005)
IfTrueAction39=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition40=(mTime>=031500) && (mTime<031505)
IfTrueAction40=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition41=(mTime>=032000) && (mTime<032005)
IfTrueAction41=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition42=(mTime>=032500) && (mTime<032505)
IfTrueAction42=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition43=(mTime>=033000) && (mTime<033005)
IfTrueAction43=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition44=(mTime>=033500) && (mTime<033505)
IfTrueAction44=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition45=(mTime>=034000) && (mTime<034005)
IfTrueAction45=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition46=(mTime>=034500) && (mTime<034505)
IfTrueAction46=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition47=(mTime>=035000) && (mTime<035005)
IfTrueAction47=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition48=(mTime>=035500) && (mTime<035505)
IfTrueAction48=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition49=(mTime>=040000) && (mTime<040005)
IfTrueAction49=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
IfCondition50=(mTime>=040500) && (mTime<040505)
IfTrueAction50=[!UpdateMeasure mRandom][!LoadLayout "b[mRandom]"]
sockeater
Posts: 17
Joined: July 30th, 2019, 2:43 pm

Re: Rainmeter wallpaper problems

sockeater » August 17th, 2019, 1:01 am

I apologize for the double post but I restarted my computer and the rainmeter skin is behaving differently. It seems to change the layout multiple times like I mentioned but it seems to be within the 5 second period from the if condition. How do I make it so that the action only triggers once within the 5 seconds?

Edit: Could I possibly replace IfTrueAction with IfEqualAction? would that allow my action to be triggered once?