The Barista Logo

barista

An i3status alternative in golang

Download sample-bar Download i3status example View on GitHub

Outputs

godoc
import "barista.run/outputs"

The outputs package provides some utility methods for simpler construction of common outputs.

Timed Outputs

outputs.Repeat allows construction of repeating outputs using the bar.TimedOutput extension. A repeating output is constructed using a func(time.Time) bar.Output, with a set repeating strategy:

outputs.AtDeltaFrom allows construction of a bar.TimedOutput that counts down to, or up from, a reference point in time. It is constructed from a func(time.Duration) bar.Output, with the argument being positive for reference points in the past, and negative for points in the future.

Implementation notes:

Group

Group(...bar.Output) creates a flattened group of segments from the individual segments of each output, and allows appending further outputs to build up long outputs one portion at a time.

Most of the *Segment methods are also available on an output group, and they apply even to segments added after the methods are called (e.g. Color(red) followed by Append(foo) will make foo red as well).

These methods only set the property for segments that haven’t already specified it, so something like Background(blue) can be overridden for an individual segment using Background(green).

For a complete list of methods, see the SegmentGroup godoc.