Display weather status in polybar.
- Python3
[module/weather]
type = custom/script
exec = python ~/path/to/polybarWeather.py -i 745042 -a appid123goes456here789 -t Celcius
Here is the parameters.
-i CityId -a AppID -t OutputType -z ZipCode -c CountryCode
First of all, Application ID is needed; You can get your individual AppID by signing up to openweathermap and going to the API section: https://home.openweathermap.org/users/sign_up
There are two ways to get weather status: using cityID or using both ZipCode and CountryCode. ApplicationID is needed for each way. Here is example for each ways:
python ~/path/to/polybarWeather.py -i 745042 -a appid123goes456here789
In the example above, 745042 is the city id of Istanbul, below there is an information on getting your city's id. And the output will be:
rain 8°C
Celcius is the default output type, you can change it to Fahrenheit or Kelvin.
python ~/path/to/polybarWeather.py -z 34704 -c tr -a appid123goes456here789 -t Fahrenheit
Information on supported cities are given in a json format with the name 'city.list.json.gz' and can be downloaded from: http://bulk.openweathermap.org/sample/