Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sonowz committed Oct 7, 2022
1 parent f5870d7 commit 04c9800
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 5 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 SoonHo Seo

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Wallpaper Engine Live Weather

This project adds a new feature to the [Wallpaper Engine](https://www.wallpaperengine.io/): change wallpapers when it's sunny/rainy/snowy! This is done by a simple program which runs every hour to check current weather and sets corresponding **playlist**. Only supports Windows.

# How to Use

## Installation

To install, simply run `install.bat` file. (warning: DO NOT run as administrator!) This will install files in `C:\ProgramData\WallpaperEngineLiveWeather` and create a [Windows task](https://en.wikipedia.org/wiki/Windows_Task_Scheduler) scheduled to run the program every hour. To manually run the program, just execute `WallpaperEngineLiveWeather.exe`.

## Configuration

We will configure the program in 4 steps. First, open `C:\ProgramData\WallpaperEngineLiveWeather\config.json` file. This is the file where all configurations are written.

#### 1. API Key

**The most difficult step**: for the program to run properly, you have to generate a weather API key from [OpenWeatherMap](https://openweathermap.org).

Create an account in OpenWeatherMap, then go to [API keys](https://home.openweathermap.org/api_keys) section. Generate an API key, and write down the API key to `api_key` field in the configuration.

![API key image](assets/images/api_key.png)

#### 2. City

Write down your country and city to the configuration. The name should appear if you search your city [here](https://openweathermap.org/find). For example, if you are living in Seoul, you should set configuration as:
```json
{
"city": "Seoul",
"country": "KR"
}
```

![city image](assets/images/city.png)

#### 3. (*optional*) Wallpaper Engine Directory

If Wallpaper Engine is installed in other than the default location, set `wallpaper_engine_bin` field to path of your Wallpaper Engine executable.

#### 4. (*optional*) Playlist Mapping

The program will set playlist by refering to `playlist_prefix` and `weather_bindings` field in the configuration. For example, in the configuration below:
```json
{
"playlist_prefix": "weather_",
"weather_bindings": {
"Clear": "sunny",
"Atmosphere": "sunny",
"Clouds": "sunny",
"Drizzle": "sunny",
"Rain": "rainy",
"Thunderstorm": "rainy",
"Snow": "rainy",
"Mist": "rainy"
}
}
```
The program would set the playlist `weather_sunny` if the weather is `Clear`, `Atmosphere`, `Clouds`, or `Drizzle`. It would set the playlist `weather_rainy` if the weather is `Rain`, `Thunderstorm`, `Snow`, or `Mist`.

## Playlist

Playlists must be set in order to work properly. In Wallpaper Engine, **save** your playlist with the names (such as `weather_sunny`) you have configured earlier.

![playlist image](assets/images/playlist.png)

# Limitations

Due to the limited control in the [command line interface](https://help.wallpaperengine.io/en/functionality/cli.html#remove-wallpaper) of Wallpaper Engine, when the program checks the weather, the playlist will always advance to the next wallpaper. In other words, every hour, the playlist will be forcefully changed to the next wallpaper, indepedent of Playlist Settings in Wallpaper Engine.

For advanced users, if you want to change the check interval, edit the trigger of `WallpaperEngineLiveWeather` task in the Windows Task Scheduler.
Binary file added assets/images/api_key.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/city.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/playlist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions release/config.json → release/config_sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"_comment1": "### Put your OpenWeatherMap API key here.",
"api_key": "YOUR API KEY HERE",

"_comment2": "### Put your wallpaper engine binary location here.",
"wallpaper_engine_bin": "D:\\Steam\\steamapps\\common\\wallpaper_engine\\wallpaper64.exe",

"_comment3": "### Search your city in 'https://openweathermap.org/find' and fill in 'city' and 'country' fields with the result.",
"_comment2": "### Search your city in 'https://openweathermap.org/find' and fill in 'city' and 'country' fields with the result.",
"city": "seoul",
"country": "KR",

"_comment3": "### Put your wallpaper engine binary location here.",
"wallpaper_engine_bin": "C:\\Program Files (x86)\\Steam\\steamapps\\common\\wallpaper_engine\\wallpaper64.exe",

"_comment4": "### Mapping from weather to playlist. For example, when weather is 'clear', the wallpaper engine should play playlist named 'weather_sunny'.",
"playlist_prefix": "weather_",
Expand Down
2 changes: 1 addition & 1 deletion release/install.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mkdir "%PROGRAMDATA%\WallpaperEngineLiveWeather"
copy /y "WallpaperEngineLiveWeather.exe" "%PROGRAMDATA%\WallpaperEngineLiveWeather\WallpaperEngineLiveWeather.exe"
echo n | copy /-y "config.json" "%PROGRAMDATA%\WallpaperEngineLiveWeather\config.json"
echo n | copy /-y "config_sample.json" "%PROGRAMDATA%\WallpaperEngineLiveWeather\config.json"
schtasks /create /sc DAILY /tn "WallpaperEngineLiveWeather" /tr "%PROGRAMDATA%\WallpaperEngineLiveWeather\WallpaperEngineLiveWeather.exe" /du 24:00 /ri 60 /it /f

0 comments on commit 04c9800

Please sign in to comment.