This script aims to be simple and to be used for any project. The script simply displays an icon, the current weather and the unit.
- Python (3.x)
- weatherapi
Clone the repository and configure json settings in weather_settings.json as follows:
-
key
: string (Get your API key on weatherapi.com, e.g:"c92jef" )parameters
: string (weatherapi parameters (see "Request Parameters" section here for more informations), e.g: "Namen,Belgium")unit
: string ("Celsius" or "Farhenheit")
-
sunset
: number (sunset time in 24 hours format, e.g: 22)sunrise
: number (sunrise time in 24 hours format, e.g: 7)icon-position
: string ("left" or "right")
{
"url": "http://api.weatherapi.com/v1/current.json",
"key": "c92jef",
"parameters": "Namen,Belgium",
"unit": "Celsius"
}
[module/weather]
type = custom/script
interval = 1800
exec = python -O /path/to/weather/script/weather.py
"custom/weather": {
"interval": 600,
"exec": "python -O /path/to/weather/script/weather.py"
}