It is currently March 29th, 2024, 2:38 pm

Help! Cycle through rainmeter layouts periodically

Get help with installing and using Rainmeter.
QuantaNeon
Posts: 5
Joined: August 16th, 2020, 9:25 am

Help! Cycle through rainmeter layouts periodically

Post by QuantaNeon »

Hi! I have a set of layouts designed by me, and i want those layouts to change automatically, for example, every hour, how can i do that??
i tried googling but didnt find anythig...i am attaching the screenshots of my layouts just in case they help u figuring the solution out....i am a weeb btw...
the layouts are not yet perfected...so please feel free to give me suggestions//////have a nice day after helping me!
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help! Cycle through rainmeter layouts periodically

Post by balala »

QuantaNeon wrote: August 16th, 2020, 9:55 am I have a set of layouts designed by me, and i want those layouts to change automatically, for example, every hour, how can i do that??
Beside dvo's reply, my question is how have you named those layouts?
QuantaNeon wrote: August 16th, 2020, 9:55 am the layouts are not yet perfected...so please feel free to give me suggestions
I doubt we can about the layouts. What are you including into each of them is completely up to you. We can't decide instead of you.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Help! Cycle through rainmeter layouts periodically

Post by mak_kawa »

Hi QuantaNeon

I didn't this solution actually on layout change. So, if it doesn't work (and/or is buggy :-) ), sorry.
Anyway, if you have 6 layouts and their saved names are MyLayout1 - MyLayout6, and if you want to change layout every 1 hour after refresh... Following code may help you, hope so.

Code: Select all

[Rainmeter]
Update=1000

[Variables]
Layout=0
MaxLayout=6
LayoutChangeInterval=3600
SecondsAfterRefresh=0

[MeasureSecondsAfterLoad]
Measure=Calc
Formula=1
OnUpdateAction=[!SetVariable SecondsAfterRefresh (#SecondsAfterRefresh#+1)]
IfCondition=(#Layout#=0)
IfTrueAction=[!SetVariable Layout (#Layout#+1)]
IfCondition2=((#SecondsAfterRefresh#%#LayoutChangeInterval#)=0) && (#Layout#<>0)
IfTrueAction2=[!SetVariable Layout (#Layout#+1)][!UpdateMeasure LayoutChange]
DynamicVariables=1

[LayoutChange]
Measure=Calc
Formula=1
IfConditionMode=1
IfCondition=(#Layout#>#MaxLayout#)
IfTrueAction=[!SetVariable Layout 1][!LoadLayout MyLayout1]
IfFalseAction=[!LoadLayout MyLayout#Layout#]
DynamicVariables=1
UpdateDivider=-1

[meterDummy]
Meter=String
QuantaNeon
Posts: 5
Joined: August 16th, 2020, 9:25 am

Re: Help! Cycle through rainmeter layouts periodically

Post by QuantaNeon »

mak_kawa wrote: August 16th, 2020, 8:30 pm Hi QuantaNeon

I didn't this solution actually on layout change. So, if it doesn't work (and/or is buggy :-) ), sorry.
Anyway, if you have 6 layouts and their saved names are MyLayout1 - MyLayout6, and if you want to change layout every 1 hour after refresh... Following code may help you, hope so.

Code: Select all

[Rainmeter]
Update=1000

[Variables]
Layout=0
MaxLayout=6
LayoutChangeInterval=3600
SecondsAfterRefresh=0

[MeasureSecondsAfterLoad]
Measure=Calc
Formula=1
OnUpdateAction=[!SetVariable SecondsAfterRefresh (#SecondsAfterRefresh#+1)]
IfCondition=(#Layout#=0)
IfTrueAction=[!SetVariable Layout (#Layout#+1)]
IfCondition2=((#SecondsAfterRefresh#%#LayoutChangeInterval#)=0) && (#Layout#<>0)
IfTrueAction2=[!SetVariable Layout (#Layout#+1)][!UpdateMeasure LayoutChange]
DynamicVariables=1

[LayoutChange]
Measure=Calc
Formula=1
IfConditionMode=1
IfCondition=(#Layout#>#MaxLayout#)
IfTrueAction=[!SetVariable Layout 1][!LoadLayout MyLayout1]
IfFalseAction=[!LoadLayout MyLayout#Layout#]
DynamicVariables=1
UpdateDivider=-1

[meterDummy]
Meter=String


BUT where do i put this code??
QuantaNeon
Posts: 5
Joined: August 16th, 2020, 9:25 am

Re: Help! Cycle through rainmeter layouts periodically

Post by QuantaNeon »

dvo wrote: August 16th, 2020, 11:57 am this should help : C:\Program Files\Rainmeter\Rainmeter.exe" !LoadLayout "My Saved Layout"
now you have to make a routine that load it timed...
action timer...
replace the font bit with the link above with your layouts and it should work...

Code: Select all

[MeasureTimer]
Measure=Plugin
Plugin=ActionTimer
ActionList1=SetFontSmall | Wait 1000 | SetFontBig
SetFontSmall=[!SetOption SomeMeter FontSize "10"][!UpdateMeter SomeMeter][!Redraw]
SetFontBig=[!SetOption SomeMeter FontSize "15"][!UpdateMeter SomeMeter][!Redraw]
But how to implemet it...Where do i put this code exactly
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Help! Cycle through rainmeter layouts periodically

Post by mak_kawa »

Hi QuantaNeon

You can save that code with any skin name and load when you start Rainmeter. This skin has no visible meter, so you can't see the skin but working in background possibly, I hope. :-)
Or... you also can merge this code except the [Rainmeter] section to your any skin.

But... honestly I am not sure whether it works with no problem or not in your Rainmeter, because I didn't do actual test using !LoadLayout bang as I already said. My test was using !Log bang which doesn't effect my Rainmeter... sorry.
QuantaNeon
Posts: 5
Joined: August 16th, 2020, 9:25 am

Re: Help! Cycle through rainmeter layouts periodically

Post by QuantaNeon »

mak_kawa wrote: August 17th, 2020, 3:03 am Hi QuantaNeon

You can save that code with any skin name and load when you start Rainmeter. This skin has no visible meter, so you can't see the skin but working in background possibly, I hope. :-)
Or... you also can merge this code except the [Rainmeter] section to your any skin.

But... honestly I am not sure whether it works with no problem or not in your Rainmeter, because I didn't do actual test using !LoadLayout bang as I already said. My test was using !Log bang which doesn't effect my Rainmeter... sorry.
I have made n .ini file and pasted your code, but when i load the ini file through the rainmeter skin tab, it doesnt load....thanks for your help though
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Help! Cycle through rainmeter layouts periodically

Post by mak_kawa »

Hi QuantaNeon

Sadly, now I know my "solution" doesn't work properly. The reason is a bit complicated and hard to explain shortly for me. So, please don't use my solution so far. Really sorry.

It is resulted from my shortage of Rainmeter skill, shame. :-) Maybe some other member of this forum provides exact solution, I hope.
QuantaNeon
Posts: 5
Joined: August 16th, 2020, 9:25 am

Re: Help! Cycle through rainmeter layouts periodically

Post by QuantaNeon »

mak_kawa wrote: August 17th, 2020, 4:04 am Hi QuantaNeon

Sadly, now I know my "solution" doesn't work properly. The reason is a bit complicated and hard to explain shortly for me. So, please don't use my solution so far. Really sorry.

It is resulted from my shortage of Rainmeter skill, shame. :-) Maybe some other member of this forum provides exact solution, I hope.
DOnt bother....I really thank you for taking time and helping me out, so now i will continue my hunt...thanks again
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Help! Cycle through rainmeter layouts periodically

Post by mak_kawa »

The main reason why my "solution" is not usable at all is... !LoadLayout bang, as a matter of course, refreshes all active skin including the skin which loads the layout. So, there needs the way that saves "which is recent layout?" as a variable key to the skin file itself or external file as *.inc file.

Further, I have encountered weird situation around !LoadLayout other than above issue, so I am now messed up and almost gave up...:-)