It is currently April 20th, 2024, 5:07 am

[Solved] Time-based wallpaper changing

Get help with creating, editing & fixing problems with skins
maybeheir
Posts: 4
Joined: January 9th, 2017, 12:17 pm

[Solved] Time-based wallpaper changing

Post by maybeheir »

Good time of day to everyone here. Must warn you - I'm first-timer in Rainmeter and I have very little clue of what to do and how to customise it. (Also, I'm Russian.)

The issue:
I want to make RM skin that would make wallpaper change automatically, setting one at 6 AM and another - at 6 PM. I've tried to use two different codings taken from this forum, but none of them worked. What I have at my hands right now:

Code: Select all

[Rainmeter]
Update=1000

[Variables]
hour=%H

[MeasureHour]
Measure=Time
Format=%H
IfCondition=((MeasureHour >= 6) && (MeasureHour < 18))
IfTrueAction=[!ActivateConfig "MayTale\Day and Night Switcher\Cut - Day\cut" "cut.ini"][!SetWallpaper "day.png"][!DeactivateConfig "Day and Night Switcher\Cut - Night\cut"]
IfFalseAction=[!ActivateConfig "MayTale\Day and Night Switcher\Cut - Night\cut" "cut2.ini"][!SetWallpaper "night.png"][!DeactivateConfig "Day and Night Switcher\Cut - Day\cut"]
Used this WP switcher as a base, just wanted to make it time-based instead of manual switching.
Above all troubles, my PC clocks are set to 24hr time, if it does any matter in this case.

Any help would be highly appreciated.
Last edited by maybeheir on January 9th, 2017, 6:02 pm, edited 2 times in total.
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Time-based wallpaper changing - needed help

Post by balala »

Your code should work, you just have to be careful to have the day.png and respectively the night.png images into your config, near the ini file of the skin.
If it's not working, I suppose those images are not there, maybe you have them in another folder. If so, move the images OR replace the name of the files (into the !SetWallpaper bangs), with their path.
Also make sure that the MayTale\Day and Night Switcher\Cut - Day\cut\cut.ini file, otherwise it can't be loaded.
maybeheir
Posts: 4
Joined: January 9th, 2017, 12:17 pm

Re: Time-based wallpaper changing - needed help

Post by maybeheir »

the pictures are in the proper folder. Everything is in proper folder, but RM still think the switcher .ini itself has no values or damaged and refuse to load it. I have no idea what is wrong :c
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Time-based wallpaper changing - needed help

Post by balala »

Ok, please pack the whole config and upload it. I'd like to check.
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Time-based wallpaper changing - need help

Post by balala »

And one more, before you load the package: each Rainmeter skin MUST have at least one meter. If the posted code is the whole code of switcher.ini, it has no meters at all, so, you should add one, even "invisible" meter, like the following one:

Code: Select all

[SomeMeter]
Meter=String
Text=""
Hidden=1
maybeheir
Posts: 4
Joined: January 9th, 2017, 12:17 pm

Re: Time-based wallpaper changing - need help

Post by maybeheir »

I'm a doofball. Thank you, I didn't know there has to be these meters T-T

edit: okay, now it's loading. but it's not changing wallpaper :/ Here's the package, maybe you can look it up?
Last edited by maybeheir on January 9th, 2017, 4:04 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Time-based wallpaper changing - need help

Post by jsmorley »

maybeheir wrote:I'm a doofball. Thank you, I didn't know there has to be these meters T-T
Simply:

Code: Select all

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

Re: Time-based wallpaper changing - need help

Post by balala »

maybeheir wrote:okay, now it's loading. but it's not changing wallpaper :/ Here's the package, maybe you can look it up?
Problems with your code:
  • The !ActivateConfig bang usually needs two parameters (it's true that the second one can be optional): the name of the Config and the name of the ini file. Separately, as two different parameters. So, replace these bangs of the IfTrueAction and IfFalseAction options of the [MeasureHour] measure with: [!ActivateConfig "MayTale\Day and Night Switcher\Cut - Day\cut[color=#FF0000]" "[/color]cut.ini"] and [!ActivateConfig "MayTale\Day and Night Switcher\Cut - Night\cut[color=#FF0000]" "[/color]cut2.ini"].
  • On the other hand, the !DeactivateConfig don't need the name of the ini file. Replace the two !DeactivateConfig in the same two options with: [!DeactivateConfig "MayTale\Day and Night Switcher\Cut - Night\cut"] and respectively [!DeactivateConfig "MayTale\Day and Night Switcher\Cut - Day\cut"].
  • The reason why your wallpaper isn't changed: when you want to set the wallpaper, you have to use either the absolute path of the image you'd like to set, either its path and name starting from the place where the ini file is. Replace the two !SetWallpaper bangs with: [!SetWallpaper "day.png"] and [!SetWallpaper "night.png"]. An even better solution would be to move these images into the @Resources folder and change the paths accordingly: [!SetWallpaper "#@#day.png"] and [!SetWallpaper "#@#night.png"] (but be careful if you want to use these forms, to move first the day.png and night.png images into the @Resources folder).
  • Although this isn't literally an issue, but it's better to keep in mind that the Format=%H option of the [MeasureHour] measure, returns the number of hours with two digits. Eg 8 o'clock in the morning will be shown as 08, not 8. This isn't causing problems to Rainmeter, however would be better to replace this option with Format=%[color=#FF0000]#[/color]H. This way you can remove the leading zero (getting 8 instead of 08).
  • The hour variable seems useless, you can remove it.
maybeheir
Posts: 4
Joined: January 9th, 2017, 12:17 pm

Re: Time-based wallpaper changing - need help

Post by maybeheir »

!!Thank you!!!!! it's working now)
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Solved] Time-based wallpaper changing

Post by balala »

You're welcome.