> ## Documentation Index
> Fetch the complete documentation index at: https://docs.otter-shell.org/llms.txt
> Use this file to discover all available pages before exploring further.

# otter-weather

> Fetch current conditions and a 7-day forecast from Open-Meteo. Feed the bar widget, open a popup, or print to stdout.

otter-weather fetches current conditions and a 7-day forecast from Open-Meteo. It feeds the bar weather widget or opens a popup. Set your latitude and longitude, run it as a watch daemon, and weather shows up on your desktop.

## Usage

Run `otter-weather` without arguments to fetch and print a forecast for the configured location. Pass coordinates to override the config.

```bash theme={null}
otter-weather                             # fetch and print (default: London)
otter-weather 40.7128 -74.0060            # specify coordinates (New York)
otter-weather --dry-run 51.5072 -0.1276   # print Open-Meteo URL without fetching
otter-weather --write-cache               # refresh bar widget cache
otter-weather --watch 900 --write-cache   # refresh every 900 seconds
otter-weather --cache                     # print cached forecast without HTTP
otter-weather --layer                     # open 7-day popup from cache
```

## Bar Widget Integration

The otter-bar weather widget reads from a bounded local cache file. Use `--write-cache` to refresh that cache after a fetch. Add `--watch SECONDS` to keep it updated in the background. A typical autostart line:

```bash theme={null}
otter-weather --watch 900 --write-cache &
```

The `--layer` flag opens the cached forecast in a small layer-shell popup that closes when clicked. Bind it to the bar widget button.

<Note>
  Responses are capped at 128 KiB, so the cache file stays small and fetch time stays predictable.
</Note>

## Configuration

otter-weather reads `~/.config/otter-shell/otter-weather.conf`.

```conf theme={null}
latitude = 51.5072
longitude = -0.1276
# Optional; empty uses $XDG_CACHE_HOME/otter-shell/weather-cache
cache_path = ""
write_cache = false
watch_seconds = 0
```

* `latitude` / `longitude`: your location (default is London)
* `cache_path`: cache file location. Empty uses the default XDG cache location
* `write_cache`: write cache after fetch
* `watch_seconds`: refresh interval in watch mode. Config reloads between refreshes, so you can change location without restarting the daemon

<Tip>
  Find your coordinates at [Open-Meteo's geocoding API](https://open-meteo.com/en/docs/geocoding-api) or use a site like [latlong.net](https://www.latlong.net).
</Tip>
