Skip to content

ThatNerdChris/WeatherBar

Repository files navigation

WeatherBar

WeatherBar hero

WeatherBar is a lightweight macOS menu bar app for current weather, UV exposure guidance, and a compact five-hour forecast. It is designed to stay out of the way until you need it: the menu bar title shows the current condition and temperature, while the dropdown gives the practical details.

The app works without a paid API key by using Open-Meteo. If you have a Google Weather API key, WeatherBar can use it for richer current conditions and hourly forecast data.

WeatherBar menu preview

Features

  • Menu bar temperature and condition summary.
  • Current conditions, feels-like temperature, humidity, wind, and UV index.
  • UV-aware sun exposure timer with safety notifications.
  • Five-hour forecast preview.
  • Free Open-Meteo fallback with no API key required.
  • Optional Google Weather API support.
  • Manual city search through OpenStreetMap Nominatim.
  • Local-only config and location cache stored in your home directory.

Privacy

WeatherBar does not require any secrets to run. Optional Google Weather API keys are stored locally in ~/.weatherbar_config.json, and selected or detected location data is stored locally in ~/.weatherbar_location.json.

If no city has been selected, WeatherBar attempts approximate IP geolocation through https://ipapi.co/json/ so it can start with a useful location. You can override that at any time from the location menu item by entering a city name.

This repository intentionally ignores local config, cached locations, virtual environments, build output, logs, databases, private keys, and token-like files. Do not commit your own ~/.weatherbar_config.json or ~/.weatherbar_location.json.

The images in this README use mock sample data and do not show a real user location.

Requirements

  • macOS 12 or newer.
  • Python 3.11 or newer.
  • A network connection for weather and location lookup.

Run From Source

git clone https://github.com/ThatNerdChris/WeatherBar.git
cd WeatherBar
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python weather_app.py

When the app starts, click the location row in the dropdown to set a city. Leaving the field blank clears the local cache and lets the app try approximate IP geolocation again.

Build The macOS App

git clone https://github.com/ThatNerdChris/WeatherBar.git
cd WeatherBar
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
chmod +x build.sh
./build.sh
open /Applications/WeatherBar.app

The build script creates a self-contained WeatherBar.app with py2app, signs it ad hoc, installs it into /Applications, and removes temporary build folders.

Optional Google Weather API

WeatherBar works with Open-Meteo out of the box. To use Google Weather as the primary data source:

  1. Create a Google Cloud API key with access to the Weather API.
  2. Open WeatherBar.
  3. Choose Set Google API Key... from the dropdown.
  4. Paste the key and save.

If Google Weather fails or no key is set, WeatherBar falls back to Open-Meteo automatically.

Data Sources

  • Current weather and forecast fallback: Open-Meteo.
  • Optional primary weather source: Google Weather API.
  • Manual city search: OpenStreetMap Nominatim.
  • Approximate first-run location: ipapi.co.

License

MIT. See LICENSE.

About

A macOS menu bar weather app with UV-aware sun safety, hourly forecasts, and free Open-Meteo fallback.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors