A bash script to get the weather from OpenWeatherMap and output to the terminal, Openbox, or HTML

Project maintained by uriel1998 Hosted on GitHub Pages — Theme by mattgraham and

A bash script to get the weather and forecast from OpenWeatherMap and output to the terminal, Openbox, or HTML

Output example


  1. About
  2. License
  3. Prerequisites
  4. How to use
  5. TODO

1. About

Weather report written in Bash. gets the current weather from OpenWeatherMap and displays the results to the terminal, HTML, or for an OpenBox pipe menu. It will calculate (if appropriate) the “feel like” weather by calculating the wind chill or heat index. A great deal of basis for this script comes from BashWeather, bash-weather, and many more that I forgot to save the URLs of. gets the forecast from OpenWeatherMap and likewise displays the results. OpenWeatherMap forecasts are at three hour intervals (0800, 1100, 1400, etc). It displays all forecasts for the next twenty four hours, then displays the closest time forecast for the day after that. For example, if it’s 1136 (as I’m writing this) it shows all forecasts through the 1100 forecast the next day, then the 1100 forecast for each subsequent day. Options and .rc file are the same as for

If you wish to show both together, simply execute: &&

2. License

This project is licensed under the MIT license. For the full license, see LICENSE.

3. Prerequisites

Optional: For colors in terminal, save bashcolors in this repository to .bashcolors in your $HOME directory.

4. How to use

Run or with the appropriate commandline switches (below). If the current conditions do not qualify for the heat index or wind chill, it is not displayed.


Copy (and edit, as appropriate) the weather_sh.rc file to $HOME\.config\weather_sh.rc.

Command-line options and can be started with the following command line options:

Note: If the OpenWeatherMap API key is specified from the command-line, it will override the API key set in the file.

Note: It is STRONGLY recommended to use the City ID from OpenWeatherMap instead of a city name. Instructions on finding your city’s City ID here .

Calling from Conky

I have a single line config for my secondary screen with the weather config in it:

Now: ${execi 300 -y} Forecast: ${execi 300 -y}

The conky output is currently limited via code to just the next five outputs.

5. Todo

Steven Saus injects people with radioactivity for his day job, but only to serve the forces of good.