barista.run: barista.run/modules/counter Index | Files

package counter

import "barista.run/modules/counter"

Package counter demonstrates an extremely simple i3bar module that shows a counter which can be chnaged by clicking on it. It showcases the asynchronous nature of i3bar modules when written in go.

Index

Package Files

counter.go

type Module Uses

type Module struct {
    // contains filtered or unexported fields
}

Module represents a "counter" module that displays a count in the given format, and adjusts the count on click/scroll. This module exemplifies the event-based architecture of barista.

func New Uses

func New(format string) *Module

New constructs a new counter module.

func (*Module) Format Uses

func (m *Module) Format(format string) *Module

Format sets the output format. The given format string will receive the counter value as the only argument.

func (*Module) Stream Uses

func (m *Module) Stream(s bar.Sink)

Stream starts the module.

Package counter imports 4 packages (graph). Updated 2018-10-29. Refresh now. Tools for package owners.