Weather widget for my Polybar setup. It uses the OpenWeatherMap API free tier.
Requires a OpenWeatherMap API Key, insert your key in weather.py: line 6: APIkey = "KEY HERE"
Small in bar:
Full in terminal:
weather.py <full/small/help> <location>
help: prints arguments needed
small: only prints current temperature and weather
full: prints full weather report for now and 12 hour forecast
location: the location as one string, if more than one word, separate them with commas
To use it in Polybar you need to make a custom module in your config, check the Polybar wiki on how to do that.
[module/weather]
type = custom/script
exec = python <path to script> small <location>
; refresh every 30 minutes
interval = 1800.0
format =<label>
label =%output%
click-right = <Open new instance of your terminal without closing> python <path to script> full <location>