So I recently found out about rainmeter and I really like it but I want to add a thing where all of my skins, as well as my background change based on the time of day (day or night). For the background change, I use a program called WinDynamicDesktop which works great, but I also want to change my other skins (specifically cleartext and visbubble) based on if it is day or night. I tried writing some code and the "Night" variable works when changing it manually, but I cannot get the code to change the skins automatically as it is supposed to do. I found a site that allows me to get the data for when the sun rises and sets (a photo of what the site looks like is below), but either I cannot get the code to read the data properly, or I forgot to add something in, and I was wondering if anyone could help if possible.
I will attach the photo of the site and my code below.
Thanks in advance!
The site:
The code:
Code: Select all
[Rainmeter]
Update=1000
[Metadata]
Name=Theme Switcher
Author=Pupihed
Information=Switches theme based on Sunset / Sunrise
[Variables]
Night=1
[MeasureTime]
Measure=Time
Format=%#I:%M %p
[MeasureCurrentHour]
Measure=Time
Format=%#H
[MeasureCurrentMinute]
Measure=Time
Format=%#M
[MeasureCurrentSeconds]
Measure=Calc
Formula=(MeasureCurrentHour * 3600) + (MeasureCurrentMinute * 60)
[MeasureRiseSet]
Measure=WebParser
UpdateRate=600
URL=http://api.weatherapi.com/v1/astronomy.xml?key=[API KEY GOES HERE]&q=Montreal
RegExp=(?siU)<sunrise>(.*):(.*) AM</sunrise><sunset>(.*):(.*) PM</sunset>
[MeasureRiseHour]
Measure=WebParser
URL=[MeasureRiseSet]
StringIndex=1
[MeasureRiseMinute]
Measure=WebParser
URL=[MeasureRiseSet]
StringIndex=2
[MeasureSetHour]
Measure=WebParser
URL=[MeasureRiseSet]
StringIndex=3
[MeasureSetMinute]
Measure=WebParser
URL=[MeasureRiseSet]
StringIndex=4
[MeasureSunriseSeconds]
Measure=Calc
Formula=(MeasureRiseHour * 3600) + (MeasureRiseMinute * 60)
[MeasureSunSetSeconds]
Measure=Calc
Formula=((MeasureSetHour + 12) * 3600) + (MeasureSetMinute * 60)
[MeasureTestTime]
Measure=Calc
Formula=1
IfCondition=(MeasureCurrentSeconds >= MeasureSunriseSeconds) && (MeasureCurrentSeconds < MeasureSunsetSeconds)
IfTrueAction=[!SetVariable MeasureNight "0"][!UpdateMeasure "MeasureNight"]
IfFalseAction=[!SetVariable MeasureNight "1"][!UpdateMeasure "MeasureNight"]
[MeterTime]
Meter=String
MeasureName="#Night#"
DynamicVariables=1
[MeasureNight]
Measure=Calc
Formula=#Night#
IfCondition=(MeasureNight=1)
IfTrueAction=[!ActivateConfig "Cleartext" "Cleartext Pure.ini"][!ActivateConfig "Visbubble" "Wave.ini"][!DeactivateConfig "CleartextLight" "Cleartext Pure.ini"][!DeactivateConfig "VisbubbleLight" "Wave.ini"]
IfFalseAction=[!ActivateConfig "CleartextLight" "Cleartext Pure.ini"][!ActivateConfig "VisbubbleLight" "Wave.ini"][!DeactivateConfig "Cleartext" "Cleartext Pure.ini"][!DeactivateConfig "Visbubble" "Wave.ini"]
DynamicVariables=1