Getting the weather forecast from yandex for embedding in polybar

Setup

  1. Install Rust and Cargo

  2. shell cargo install forecast-get

  3. Trying:

shell forecast-get -V

Providers

Configuration (yandex)

Location $HOME/.config/forecast/config.toml

```toml

yandex

provider = "Yandex"

Output format

display = "{{ conditionicon }}{{ temperaturecelsiusfull }}[{{ feeltemperaturecelsius }}]{{ humidity }}% >> {{ forecast0conditionicon }}{{ forecast0temperaturecelsiusfull }} " [cache] enabled = true expiration = "30m"

[yandex] apikey = "YOURAPIKEY" lat = "57.1522" lon = "65.5272" lang = "enEN" useragent = "Mozilla/5.0 (X11; Linux x8664; rv:60.0) Gecko/20100101 Firefox/81.0"

```

Polybar

You can define your new module like this:

``` ... [bar/example] font-3 = weathericons:size=10;2 modules-center = weather ...

[module/weather] type = custom/script exec-if = ping api.weather.yandex.ru -c 1 exec = /path/to/forecast-get interval = 300 label-font = 3 click-left = xdg-open https://yandex.ru/pogoda/?utmsource=home&utmcontent=maininformer&utmcampaign=informer&utmmedium=web&utmterm=main_number ```