widgets

package
v0.0.0-...-d05175a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorStream

func ErrorStream(cmd string, stream io.Reader)

func Render

func Render(widget Widget) string

Types

type BaseWidget

type BaseWidget struct {
	Updates  chan Widget
	Template string
}

func (*BaseWidget) GetTemplate

func (base *BaseWidget) GetTemplate() string

func (*BaseWidget) SetUpdateChannel

func (base *BaseWidget) SetUpdateChannel(updates chan Widget)

func (*BaseWidget) Updated

func (base *BaseWidget) Updated(widget Widget)

type Clock

type Clock struct {
	BaseWidget

	DateFormat string
	Millis     time.Duration

	// The time when the ticker fired
	Time time.Time
}

func (*Clock) FormattedDateTime

func (widget *Clock) FormattedDateTime() string

func (*Clock) Start

func (widget *Clock) Start()

type Desktop

type Desktop struct {
	BaseWidget

	DesktopNames []string
	Count        int64
	Current      int64
}

func (*Desktop) Start

func (widget *Desktop) Start()

func (*Desktop) Title

func (widget *Desktop) Title() string

type Poller

type Poller struct {
	BaseWidget

	Filename string

	Exec    string
	Command string   // Deprecated
	Args    []string // Deprecated

	Millis time.Duration
	// contains filtered or unexported fields
}

func (*Poller) Start

func (widget *Poller) Start()

func (*Poller) Value

func (widget *Poller) Value() string

type Skeleton

type Skeleton struct {
	BaseWidget
}

func (*Skeleton) Start

func (widget *Skeleton) Start()

Don't instantiate or call this! Will busy wait...

func (*Skeleton) Value

func (widget *Skeleton) Value() string

type Streamer

type Streamer struct {
	BaseWidget

	Filename string

	Exec    string
	Command string   // Deprecated
	Args    []string // Deprecated
	// contains filtered or unexported fields
}

func (*Streamer) Start

func (widget *Streamer) Start()

func (*Streamer) Value

func (widget *Streamer) Value() string

type Text

type Text struct {
	BaseWidget
}

func (*Text) Start

func (widget *Text) Start()

type Widget

type Widget interface {
	Start()

	// BaseWidget implements these
	GetTemplate() string
	SetUpdateChannel(chan Widget)
	Updated(Widget)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址