Weather plugin for the polybar panel
This Polybar plugin uses OpenWeather API to get and display information about the current weather, including the type of event (clear, moderate rain, fog etc.), temperature (Celsius, Fahrenheit or Kelvin) and an alert for strong winds. The icons change accordingly with the local sunrise and sunset times.
The colors are easily customizable via constants defined at the beginning of the script.
You will need to provide your personal (and free) api key that you can obtain at https://openweathermap.org/api
chmod +x /path/to/your/script
[module/weather]
type = custom/script
exec = /PATH/TO/YOUR/SCRIPT.sh
tail = false
interval = 960
Take a look at the beginning of the script for all the settings.
You must use a NerdFont https://www.nerdfonts.com
Change CITYNAME and COUNTRYCODE with your desired location.
Set WEATHER_FONT_CODE to the polybar font you want to use to display the weather type and wind icon, and set the TEMP_FONT_CODE to the font for the thermometer icon (it was too big with the first font)
You can change the text language by setting the LANG variable. You can find the available languages and their codes at https://openweathermap.org/current#list
Run weather-plugin.sh -d
in the terminal in order to see the raw api response