Home

Awesome

Build Status

osop - other side of the pipe - outputs formatted metrics to your Stdout.

screenshots

Plain output to terminal:

screenshot1

Paired with gobar:

screenshot2

installation

First, you have to get Go. Note that version >= 1.5 is required.

Then, just

$ go get github.com/distatus/osop

should get you GOing.

usage

The only command line switch is -c which specifies a configuration file location. Location can either be absolute or relative to $XDG_CONFIG_DIR/osop. Defaults to $XDG_CONFIG_DIR/osop/config.toml.

Configuration file uses toml language and consists of two sections.

The mandatory Osop section.

[Osop]
delims = ["<", ">"]
template = ""

Where the required template is a text/template string and optional delims specify action delimiters (defaults to < and >)

In addition to standard actions, a stringify action is defined to take one argument and always return (possibly empty) string no matter what. This proved to be useful in some cases.

Zero or more Receiver sections.

[Name]
receiver = "date"
pollInterval = "1s"
otherSetting1 = "setsth"
otherSetting2 = "setsthelse"

Receiver represents a single data unit, such as date, system information, weather, etc. Each is configured with [Name] which will be used inside Osop template string and receiver, which tells what receiver to run. Receivers are case insensitive.

Different receivers might use different strategies to get the data. Some are evented (passively waiting for data to arrive), others are actively polling for data on time interval. Time interval is configured with pollInterval, which is required for polling receivers and ignored by evented ones.

Other settings might be exposed as needed by specific receivers.

For available receivers, their settings and output format(s), see receivers section.

For a more real world examples, see my dotfiles.

receivers

date

Current date and/or time.

Configuration:

Output: String.

battery

Current battery state.

Configuration:

Output: Struct:

sys

System metrics.

Configuration:

Output: Struct:

Note that only parts relevant to values set in metrics will actually be filled.

owm

Weather information based on OpenWeatherMap service.

Configuration:

Output: Struct:

transmission

Transmission daemon information.

Configuration:

Output: Struct:

mpd

Mpd information.

Configuration:

Output: Struct:

bspwm

Bspwm status pieces.

Output: Struct:

wingo

Wingo status pieces.

Output: Struct: