The Barista Logo

barista

An i3status alternative in golang

Download sample-bar Download i3status example View on GitHub

Weather

godoc
import "barista.run/modules/weather"

Show the current weather conditions: weather.New(someProvider).

Weather supports displaying the current conditions using a variety of pluggable providers, with the ability to add custom providers fairly easily. Provider is just

type Provider interface {
	GetWeather() (Weather, error)
}

A few providers are included out of the box:

Configuration

Example

25C, 5mph NNW

Show the current temperature and wind information:

weather.New(openweathermap.Zipcode("94045", "US").Build()).
	Output(func(w weather.Weather) bar.Output {
		return outputs.Textf("%.0fC, %.0fmph %s",
			w.Temperature.Celsius(),
			w.Wind.Speed.MilesPerHour(),
			w.Wind.Direction.Cardinal())
	})

Data: type Weather struct

Fields

Supporting Types

Documentation for unit.Temperature, unit.Pressure, and unit.Speed