It is currently September 29th, 2024, 5:17 am

Weather wallpaper changer

General topics related to Rainmeter.
User avatar
WhiteBaron
Posts: 18
Joined: June 9th, 2010, 12:32 pm

Weather wallpaper changer

Post by WhiteBaron »

Hi, I've been asked to come up with a skin that shows some weather information and also sets the current wallpaper based on the weather conditions. I've run into two problems;

1. I can't think of how to have the wallpaper set automatically when the weather conditions change or the skin updates.

2. For now I have been trying to set it just by using mouse actions, but I am getting an error (see picture).

First I need to solve the second problem; actually setting the wallpaper. For now I am just trying to have the current weather condition icon set itself as the wallpaper when clicked, but again I am getting an error. I'm not sure if the way I have coded it is possible, so here are the relevant sections:

Code: Select all

[Rainmeter]
Weatherwall created by WhiteBaron
Update=1000
DynamicWindowSize=1
DynamicVariables=1

........

[MeasureIcon]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWeather]
StringIndex=20

............

[MeterIcon]
Meter=Image
MeasureName=MeasureIcon
X=10
Y=10
Path=#CurrentPath#Icons
AntiAlias=1
LeftMouseUpAction=!Execute ["#CurrentPath#Set.exe" "#CurrentPath#\Icons\[MeasureIcon].png"]
For now I am using the executable from here and the icons from here.
You do not have the required permissions to view the files attached to this post.
crish29
Posts: 36
Joined: February 1st, 2011, 6:35 pm

Re: Weather wallpaper changer

Post by crish29 »

change format pictures png file
User avatar
WhiteBaron
Posts: 18
Joined: June 9th, 2010, 12:32 pm

Re: Weather wallpaper changer

Post by WhiteBaron »

I thought I had tried that but on second attempt I realised I didn't change the .png to .jpg in the path name, so that's the second problem solved, cheers. Lastly I need to have it set automatically, what actions do I have to use here?
crish29
Posts: 36
Joined: February 1st, 2011, 6:35 pm

Re: Weather wallpaper changer

Post by crish29 »

[MeasureWeatherTemp]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWeatherRSS]
StringIndex=11
IfBelowValue=39
IfBelowAction=!Execute [!RainmeterHideMeter Fire][!RainmeterShowMeter Ice][!RainmeterRedraw]
IfAboveValue=39
IfAboveAction=!Execute [!RainmeterShowMeter Fire][!RainmeterHideMeter Ice][!RainmeterRedraw]

[Fire]
Meter=IMAGE
ImageName=#CURRENTPATH#\bgs\Fire.jpg
X=5
Y=5
w=#height#
h=#height#

[Ice]
Meter=IMAGE
ImageName=#CURRENTPATH#\bgs\Ice.jpg
X=5
Y=5
w=#height#
h=#height#
User avatar
WhiteBaron
Posts: 18
Joined: June 9th, 2010, 12:32 pm

Re: Weather wallpaper changer

Post by WhiteBaron »

Thanks crish29, but that's not exactly what I'm after. I don't want to have an image meter covering the desktop, I'm using an executable that changes the wallpaper itself. What I need is an action that will execute each time the icon changes or the skin is updated.
crish29
Posts: 36
Joined: February 1st, 2011, 6:35 pm

Re: Weather wallpaper changer

Post by crish29 »

create a folder with your icons png file or jpg. on this example is jpg and folder name "MyIcons" 1 2 3 4 5 .....

[MeasureWeatherIconMod]
Measure=CALC
Formula=8800000 + (MeasureWeatherIcon*1000) + 99
Substitute="88":"MyIcons\","099":".jpg"

[Icon]
MeasureName=MeasureWeatherIconMod
Meter=IMAGE
X=5
Y=5
w=#height#
h=#height#
User avatar
WhiteBaron
Posts: 18
Joined: June 9th, 2010, 12:32 pm

Re: Weather wallpaper changer

Post by WhiteBaron »

Thanks again but I don't think we're on the same page here. I'm looking for a way execute an action each time the skin updates, so for example:

LeftMouseUpAction=!Execute ["#CurrentPath#Set.exe" "#CurrentPath#Wallpapers\[MeasureIcon].jpg"]

This executes when I click, I want to execute it on each update.
User avatar
WhiteBaron
Posts: 18
Joined: June 9th, 2010, 12:32 pm

Re: Weather wallpaper changer

Post by WhiteBaron »

Here's something else I've also tried that doesn't seem to work:

Code: Select all

[MeasureIcon]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWeather]
StringIndex=20

[MeasureWall]
Measure=Calc
Formula=1
IfEqualValue=1
IfEqualAction=!Execute ["#CurrentPath#Set.exe" "#CurrentPath#Wallpapers\[MeasureIcon].jpg"]
User avatar
jsmorley
Developer
Posts: 22783
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather wallpaper changer

Post by jsmorley »

You can use FinishAction= on the WebParser measure that gets the temperature. That way the action will be executed every time the WebParser measure is run. You certainly don't want to run it on every Update of the skin, as that is going to really work your computer hard for no reason.
User avatar
WhiteBaron
Posts: 18
Joined: June 9th, 2010, 12:32 pm

Re: Weather wallpaper changer

Post by WhiteBaron »

Is this what you mean:

Code: Select all

[MeasureTemp]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureWeather]
StringIndex=17
FinishAction=!Execute ["#CurrentPath#Set.exe" "#CurrentPath#Wallpapers\[MeasureIcon].jpg"]
I'm not getting any results unfortunately.