Index | Files

package counter

import ""

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.


Package Files


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.