module

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GCD

func GCD(a, b int) int

func RegisterMarkup

func RegisterMarkup(mk *markup.Markup, clock *Clock)

Types

type Battery added in v0.3.6

type Battery struct {
	Charging *base.Sizer
	Bar      *base.Rect
	Value    *TextUnit
	// contains filtered or unexported fields
}

func NewBattery added in v0.3.6

func NewBattery(p ui.ParentDrawable, mk *markup.Markup, clock *Clock) *Battery

func (*Battery) Add added in v0.3.6

func (b *Battery) Add(ui.Drawable)

func (*Battery) ChildContext added in v0.3.6

func (b *Battery) ChildContext(int) ui.Context

func (*Battery) Children added in v0.3.6

func (b *Battery) Children() []ui.Drawable

func (*Battery) Draw added in v0.3.6

func (b *Battery) Draw(x, y int, im draw.Image)

func (*Battery) Height added in v0.3.6

func (b *Battery) Height() int

func (*Battery) Init added in v0.3.6

func (m *Battery) Init() error

func (*Battery) Name added in v0.3.6

func (m *Battery) Name() string

func (*Battery) OnHeightChange added in v0.3.6

func (b *Battery) OnHeightChange(c func(int))

func (*Battery) OnWidthChange added in v0.3.6

func (b *Battery) OnWidthChange(c func(int))

func (*Battery) SendEvent added in v0.3.6

func (b *Battery) SendEvent(ev ui.Event) bool

func (*Battery) SetContext added in v0.3.6

func (b *Battery) SetContext(ctx ui.Context)

func (*Battery) SetName added in v0.3.6

func (m *Battery) SetName(v string)

func (*Battery) Update added in v0.3.6

func (m *Battery) Update(ctx context.Context)

func (*Battery) Width added in v0.3.6

func (b *Battery) Width() int

type CPU

type CPU struct {
	PcTxt     *TextUnit
	ProcTxt   *base.Text
	ProcSizer *base.Sizer
	TextRow   *base.Row
	Bar       *base.Bar
	BarSizer  *base.Sizer
	BarsSizer *base.Sizer
	BarsRow   *base.Row
	Bars      []*base.Bar
	// contains filtered or unexported fields
}

func NewCPU

func NewCPU(p ui.ParentDrawable, mk *markup.Markup, clock *Clock, pw *process.ProcessWatcher) *CPU

func (*CPU) Add

func (b *CPU) Add(ui.Drawable)

func (*CPU) ChildContext

func (b *CPU) ChildContext(int) ui.Context

func (*CPU) Children

func (b *CPU) Children() []ui.Drawable

func (*CPU) Draw

func (b *CPU) Draw(x, y int, im draw.Image)

func (*CPU) Height

func (b *CPU) Height() int

func (*CPU) Init

func (m *CPU) Init() error

func (*CPU) OnHeightChange

func (b *CPU) OnHeightChange(c func(int))

func (*CPU) OnWidthChange

func (b *CPU) OnWidthChange(c func(int))

func (*CPU) SendEvent

func (b *CPU) SendEvent(ev ui.Event) bool

func (*CPU) SetContext

func (b *CPU) SetContext(ctx ui.Context)

func (*CPU) SetShowAvgBar

func (m *CPU) SetShowAvgBar(v bool)

func (*CPU) SetShowMaxProcess

func (m *CPU) SetShowMaxProcess(v bool)

func (*CPU) SetShowPerCoreBars

func (m *CPU) SetShowPerCoreBars(v bool)

func (*CPU) ShowAvgBar

func (m *CPU) ShowAvgBar() bool

func (*CPU) ShowMaxProcess

func (m *CPU) ShowMaxProcess() bool

func (*CPU) ShowPerCoreBars

func (m *CPU) ShowPerCoreBars() bool

func (*CPU) Update

func (m *CPU) Update(context.Context)

func (*CPU) Width

func (b *CPU) Width() int

type Clock

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

func NewClock

func NewClock(paint func()) *Clock

func (*Clock) Add

func (c *Clock) Add(module Updatable, interval time.Duration)

func (*Clock) Run

func (c *Clock) Run()

type Cmd

type Cmd struct {
	ErrorTxt *base.Text
	// contains filtered or unexported fields
}

func NewCmd

func NewCmd(p ui.ParentDrawable, mk *markup.Markup, clock *Clock) *Cmd

func (*Cmd) Add

func (b *Cmd) Add(ui.Drawable)

func (*Cmd) ChildContext

func (b *Cmd) ChildContext(int) ui.Context

func (*Cmd) Children

func (b *Cmd) Children() []ui.Drawable

func (*Cmd) Draw

func (b *Cmd) Draw(x, y int, im draw.Image)

func (*Cmd) Format

func (c *Cmd) Format() string

func (*Cmd) Height

func (c *Cmd) Height() int

func (*Cmd) Init

func (c *Cmd) Init() error

func (*Cmd) Interval

func (c *Cmd) Interval() time.Duration

func (*Cmd) OnHeightChange

func (c *Cmd) OnHeightChange(cb func(int))

func (*Cmd) OnWidthChange

func (c *Cmd) OnWidthChange(cb func(int))

func (*Cmd) SendEvent

func (b *Cmd) SendEvent(ev ui.Event) bool

func (*Cmd) SetContext

func (b *Cmd) SetContext(ctx ui.Context)

func (*Cmd) SetFormat

func (c *Cmd) SetFormat(v string)

func (*Cmd) SetInterval

func (c *Cmd) SetInterval(v time.Duration)

func (*Cmd) SetText

func (c *Cmd) SetText(v string)

func (*Cmd) Text

func (c *Cmd) Text() string

func (*Cmd) Update

func (c *Cmd) Update(ctx context.Context)

func (*Cmd) Width

func (c *Cmd) Width() int

type Connections added in v0.3.0

type Connections struct {
	Row *base.Row
	// contains filtered or unexported fields
}

func NewConnections added in v0.3.0

func NewConnections(p ui.ParentDrawable, mk *markup.Markup, clock *Clock) *Connections

func (*Connections) Add added in v0.3.0

func (b *Connections) Add(ui.Drawable)

func (*Connections) ChildContext added in v0.3.0

func (b *Connections) ChildContext(int) ui.Context

func (*Connections) Children added in v0.3.0

func (b *Connections) Children() []ui.Drawable

func (*Connections) Draw added in v0.3.0

func (b *Connections) Draw(x, y int, im draw.Image)

func (*Connections) Height added in v0.3.0

func (b *Connections) Height() int

func (*Connections) Init added in v0.3.0

func (m *Connections) Init() error

func (*Connections) NameFilter added in v0.3.3

func (m *Connections) NameFilter() []string

func (*Connections) OnHeightChange added in v0.3.0

func (b *Connections) OnHeightChange(c func(int))

func (*Connections) OnWidthChange added in v0.3.0

func (b *Connections) OnWidthChange(c func(int))

func (*Connections) SendEvent added in v0.3.0

func (b *Connections) SendEvent(ev ui.Event) bool

func (*Connections) SetContext added in v0.3.0

func (b *Connections) SetContext(ctx ui.Context)

func (*Connections) SetNameFilter added in v0.3.3

func (m *Connections) SetNameFilter(v []string)

func (*Connections) SetTypeFilter added in v0.3.3

func (m *Connections) SetTypeFilter(v []string)

func (*Connections) TypeFilter added in v0.3.3

func (m *Connections) TypeFilter() []string

func (*Connections) Update added in v0.3.0

func (m *Connections) Update(context.Context)

func (*Connections) Width added in v0.3.0

func (b *Connections) Width() int

type DateTime

type DateTime struct {
	Txt *base.Text
	// contains filtered or unexported fields
}

func NewDateTime

func NewDateTime(p ui.ParentDrawable, mk *markup.Markup, clock *Clock) *DateTime

func (*DateTime) Add

func (b *DateTime) Add(ui.Drawable)

func (*DateTime) ChildContext

func (b *DateTime) ChildContext(int) ui.Context

func (*DateTime) Children

func (b *DateTime) Children() []ui.Drawable

func (*DateTime) Draw

func (b *DateTime) Draw(x, y int, im draw.Image)

func (*DateTime) Format

func (m *DateTime) Format() string

func (*DateTime) Height

func (b *DateTime) Height() int

func (*DateTime) Init

func (m *DateTime) Init() error

func (*DateTime) OnHeightChange

func (b *DateTime) OnHeightChange(c func(int))

func (*DateTime) OnWidthChange

func (b *DateTime) OnWidthChange(c func(int))

func (*DateTime) SendEvent

func (b *DateTime) SendEvent(ev ui.Event) bool

func (*DateTime) SetContext

func (b *DateTime) SetContext(ctx ui.Context)

func (*DateTime) SetFormat

func (m *DateTime) SetFormat(v string)

func (*DateTime) SetTimezone

func (m *DateTime) SetTimezone(v string)

func (*DateTime) Timezone

func (m *DateTime) Timezone() string

func (*DateTime) Update

func (m *DateTime) Update(context.Context)

func (*DateTime) Width

func (b *DateTime) Width() int

type DiskBandwidth

type DiskBandwidth struct {
	Transfer   *transfer
	Label      *base.Text
	LabelSizer *base.Sizer
	// contains filtered or unexported fields
}

func NewDiskBW

func NewDiskBW(p ui.ParentDrawable, mk *markup.Markup, clock *Clock) *DiskBandwidth

func (*DiskBandwidth) Add

func (b *DiskBandwidth) Add(ui.Drawable)

func (*DiskBandwidth) ChildContext

func (b *DiskBandwidth) ChildContext(int) ui.Context

func (*DiskBandwidth) Children

func (b *DiskBandwidth) Children() []ui.Drawable

func (*DiskBandwidth) Devs

func (m *DiskBandwidth) Devs() []string

func (*DiskBandwidth) Draw

func (b *DiskBandwidth) Draw(x, y int, im draw.Image)

func (*DiskBandwidth) Height

func (b *DiskBandwidth) Height() int

func (*DiskBandwidth) Init

func (m *DiskBandwidth) Init() error

func (*DiskBandwidth) OnHeightChange

func (b *DiskBandwidth) OnHeightChange(c func(int))

func (*DiskBandwidth) OnWidthChange

func (b *DiskBandwidth) OnWidthChange(c func(int))

func (*DiskBandwidth) SendEvent

func (b *DiskBandwidth) SendEvent(ev ui.Event) bool

func (*DiskBandwidth) SetContext

func (b *DiskBandwidth) SetContext(ctx ui.Context)

func (*DiskBandwidth) SetDevs

func (m *DiskBandwidth) SetDevs(v []string)

func (*DiskBandwidth) SetShowLabel

func (m *DiskBandwidth) SetShowLabel(v bool)

func (*DiskBandwidth) SetUnit

func (m *DiskBandwidth) SetUnit(v string)

func (*DiskBandwidth) ShowLabel

func (m *DiskBandwidth) ShowLabel() bool

func (*DiskBandwidth) Unit

func (m *DiskBandwidth) Unit() string

func (*DiskBandwidth) Update

func (m *DiskBandwidth) Update(context.Context)

func (*DiskBandwidth) Width

func (b *DiskBandwidth) Width() int

type DiskUsage

type DiskUsage struct {
	Txt *TextUnit
	// contains filtered or unexported fields
}

func NewDiskUsage

func NewDiskUsage(p ui.ParentDrawable, mk *markup.Markup, clock *Clock) *DiskUsage

func (*DiskUsage) Add

func (b *DiskUsage) Add(ui.Drawable)

func (*DiskUsage) ChildContext

func (b *DiskUsage) ChildContext(int) ui.Context

func (*DiskUsage) Children

func (b *DiskUsage) Children() []ui.Drawable

func (*DiskUsage) Draw

func (b *DiskUsage) Draw(x, y int, im draw.Image)

func (*DiskUsage) Height

func (b *DiskUsage) Height() int

func (*DiskUsage) Init

func (m *DiskUsage) Init() error

func (*DiskUsage) MountPoint

func (m *DiskUsage) MountPoint() string

func (*DiskUsage) OnHeightChange

func (b *DiskUsage) OnHeightChange(c func(int))

func (*DiskUsage) OnWidthChange

func (b *DiskUsage) OnWidthChange(c func(int))

func (*DiskUsage) SendEvent

func (b *DiskUsage) SendEvent(ev ui.Event) bool

func (*DiskUsage) SetContext

func (b *DiskUsage) SetContext(ctx ui.Context)

func (*DiskUsage) SetMountPoint

func (m *DiskUsage) SetMountPoint(v string)

func (*DiskUsage) Update

func (m *DiskUsage) Update(context.Context)

func (*DiskUsage) Width

func (b *DiskUsage) Width() int

type Interface

type Interface struct {
	Transfer   *transfer
	Label      *base.Text
	LabelSizer *base.Sizer
	// contains filtered or unexported fields
}

func NewInterface

func NewInterface(p ui.ParentDrawable, mk *markup.Markup, clock *Clock) *Interface

func (*Interface) Add

func (b *Interface) Add(ui.Drawable)

func (*Interface) ChildContext

func (b *Interface) ChildContext(int) ui.Context

func (*Interface) Children

func (b *Interface) Children() []ui.Drawable

func (*Interface) Draw

func (b *Interface) Draw(x, y int, im draw.Image)

func (*Interface) Height

func (b *Interface) Height() int

func (*Interface) Iface

func (m *Interface) Iface() string

func (*Interface) Init

func (m *Interface) Init() error

func (*Interface) OnHeightChange

func (b *Interface) OnHeightChange(c func(int))

func (*Interface) OnWidthChange

func (b *Interface) OnWidthChange(c func(int))

func (*Interface) SendEvent

func (b *Interface) SendEvent(ev ui.Event) bool

func (*Interface) SetContext

func (b *Interface) SetContext(ctx ui.Context)

func (*Interface) SetIface

func (m *Interface) SetIface(s string)

func (*Interface) SetShowLabel

func (m *Interface) SetShowLabel(v bool)

func (*Interface) ShowLabel

func (m *Interface) ShowLabel() bool

func (*Interface) Update

func (m *Interface) Update(context.Context)

func (*Interface) Width

func (b *Interface) Width() int

type ModuleRow

type ModuleRow struct {
	*base.Row
	// contains filtered or unexported fields
}

func NewSepRow

func NewSepRow(parent ui.ParentDrawable, mk *markup.Markup) *ModuleRow

func (*ModuleRow) Add

func (c *ModuleRow) Add(d ui.Drawable)

type Music

type Music struct {
	Img         *base.Image
	Placeholder *base.Rect
	TextRow     *base.Row
	Progress    *base.Bar
	Artist      *base.Text
	Sep         *base.Sizer
	Title       *base.Text
	// contains filtered or unexported fields
}

func NewMusic

func NewMusic(p ui.ParentDrawable, mk *markup.Markup) *Music

func (*Music) Add

func (b *Music) Add(ui.Drawable)

func (*Music) ChildContext

func (b *Music) ChildContext(int) ui.Context

func (*Music) Children

func (b *Music) Children() []ui.Drawable

func (*Music) Draw

func (b *Music) Draw(x, y int, im draw.Image)

func (*Music) Height

func (b *Music) Height() int

func (*Music) Init

func (m *Music) Init() error

func (*Music) OnHeightChange

func (b *Music) OnHeightChange(c func(int))

func (*Music) OnWidthChange

func (b *Music) OnWidthChange(c func(int))

func (*Music) SendEvent

func (b *Music) SendEvent(ev ui.Event) bool

func (*Music) SetContext

func (b *Music) SetContext(ctx ui.Context)

func (*Music) SetSpotifyKeyID

func (m *Music) SetSpotifyKeyID(v string)

func (*Music) SetSpotifyKeySecret

func (m *Music) SetSpotifyKeySecret(v string)

func (*Music) SpotifyKeyID

func (m *Music) SpotifyKeyID() string

func (*Music) SpotifyKeySecret

func (m *Music) SpotifyKeySecret() string

func (*Music) Width

func (b *Music) Width() int

type RAM

type RAM struct {
	GbTxt     *TextUnit
	ProcTxt   *base.Text
	ProcSizer *base.Sizer
	TextRow   *base.Row
	BarEl     *base.Bar
	BarSizer  *base.Sizer
	// contains filtered or unexported fields
}

func NewRAM

func NewRAM(p ui.ParentDrawable, mk *markup.Markup, clock *Clock, pw *process.ProcessWatcher) *RAM

func (*RAM) Add

func (b *RAM) Add(ui.Drawable)

func (*RAM) ChildContext

func (b *RAM) ChildContext(int) ui.Context

func (*RAM) Children

func (b *RAM) Children() []ui.Drawable

func (*RAM) Draw

func (b *RAM) Draw(x, y int, im draw.Image)

func (*RAM) Format

func (m *RAM) Format() string

func (*RAM) Height

func (b *RAM) Height() int

func (*RAM) Init

func (m *RAM) Init() error

func (*RAM) OnHeightChange

func (b *RAM) OnHeightChange(c func(int))

func (*RAM) OnWidthChange

func (b *RAM) OnWidthChange(c func(int))

func (*RAM) SendEvent

func (b *RAM) SendEvent(ev ui.Event) bool

func (*RAM) SetContext

func (b *RAM) SetContext(ctx ui.Context)

func (*RAM) SetFormat

func (m *RAM) SetFormat(v string)

func (*RAM) SetShowBar

func (m *RAM) SetShowBar(b bool)

func (*RAM) SetShowMaxProcess

func (m *RAM) SetShowMaxProcess(v bool)

func (*RAM) ShowBar

func (m *RAM) ShowBar() bool

func (*RAM) ShowMaxProcess

func (m *RAM) ShowMaxProcess() bool

func (*RAM) Update

func (m *RAM) Update(context.Context)

func (*RAM) Width

func (b *RAM) Width() int

type TextUnit

type TextUnit struct {
	Value *base.Text
	Unit  *base.Text
	// contains filtered or unexported fields
}

func NewTextUnit

func NewTextUnit(p ui.ParentDrawable, mk *markup.Markup) *TextUnit

func (*TextUnit) Add

func (b *TextUnit) Add(ui.Drawable)

func (*TextUnit) ChildContext

func (b *TextUnit) ChildContext(int) ui.Context

func (*TextUnit) Children

func (b *TextUnit) Children() []ui.Drawable

func (*TextUnit) Draw

func (b *TextUnit) Draw(x, y int, im draw.Image)

func (*TextUnit) Height

func (b *TextUnit) Height() int

func (*TextUnit) Init

func (t *TextUnit) Init() error

func (*TextUnit) OnHeightChange

func (b *TextUnit) OnHeightChange(c func(int))

func (*TextUnit) OnWidthChange

func (b *TextUnit) OnWidthChange(c func(int))

func (*TextUnit) SendEvent

func (b *TextUnit) SendEvent(ev ui.Event) bool

func (*TextUnit) Set

func (t *TextUnit) Set(v, u string)

func (*TextUnit) SetContext

func (b *TextUnit) SetContext(ctx ui.Context)

func (*TextUnit) Width

func (b *TextUnit) Width() int

type Updatable

type Updatable interface {
	Update(context.Context)
}

type Volume

type Volume struct {
	Icon *base.Text
	Bar  *base.Bar
	// contains filtered or unexported fields
}

func NewVolume

func NewVolume(p ui.ParentDrawable, mk *markup.Markup) *Volume

func (*Volume) Add

func (b *Volume) Add(ui.Drawable)

func (*Volume) ChildContext

func (b *Volume) ChildContext(int) ui.Context

func (*Volume) Children

func (b *Volume) Children() []ui.Drawable

func (*Volume) Draw

func (b *Volume) Draw(x, y int, im draw.Image)

func (*Volume) Height

func (b *Volume) Height() int

func (*Volume) Init

func (m *Volume) Init() error

func (*Volume) OnHeightChange

func (b *Volume) OnHeightChange(c func(int))

func (*Volume) OnWidthChange

func (b *Volume) OnWidthChange(c func(int))

func (*Volume) SendEvent

func (b *Volume) SendEvent(ev ui.Event) bool

func (*Volume) SetContext

func (b *Volume) SetContext(ctx ui.Context)

func (*Volume) Width

func (b *Volume) Width() int

type Weather

type Weather struct {
	TempTxt *TextUnit
	Icon    *base.Text
	// contains filtered or unexported fields
}

func NewWeather

func NewWeather(p ui.ParentDrawable, mk *markup.Markup, clock *Clock) *Weather

func (*Weather) Add

func (b *Weather) Add(ui.Drawable)

func (*Weather) ApiKey

func (m *Weather) ApiKey() string

func (*Weather) ChildContext

func (b *Weather) ChildContext(int) ui.Context

func (*Weather) Children

func (b *Weather) Children() []ui.Drawable

func (*Weather) Draw

func (b *Weather) Draw(x, y int, im draw.Image)

func (*Weather) Height

func (b *Weather) Height() int

func (*Weather) Init

func (m *Weather) Init() error

func (*Weather) Location

func (m *Weather) Location() string

func (*Weather) OnHeightChange

func (b *Weather) OnHeightChange(c func(int))

func (*Weather) OnWidthChange

func (b *Weather) OnWidthChange(c func(int))

func (*Weather) SendEvent

func (b *Weather) SendEvent(ev ui.Event) bool

func (*Weather) SetApiKey

func (m *Weather) SetApiKey(v string)

func (*Weather) SetContext

func (b *Weather) SetContext(ctx ui.Context)

func (*Weather) SetLocation

func (m *Weather) SetLocation(v string)

func (*Weather) SetUnit

func (m *Weather) SetUnit(v string)

func (*Weather) Unit

func (m *Weather) Unit() string

func (*Weather) Update

func (m *Weather) Update(context.Context)

func (*Weather) Width

func (b *Weather) Width() int

type Workspaces added in v0.2.0

type Workspaces struct {
	Row *base.Row
	// contains filtered or unexported fields
}

func NewWorkspaces added in v0.2.0

func NewWorkspaces(p ui.ParentDrawable, mk *markup.Markup) *Workspaces

func (*Workspaces) Add added in v0.2.0

func (b *Workspaces) Add(ui.Drawable)

func (*Workspaces) ChildContext added in v0.2.0

func (b *Workspaces) ChildContext(int) ui.Context

func (*Workspaces) Children added in v0.2.0

func (b *Workspaces) Children() []ui.Drawable

func (*Workspaces) Draw added in v0.2.0

func (b *Workspaces) Draw(x, y int, im draw.Image)

func (*Workspaces) Height added in v0.2.0

func (b *Workspaces) Height() int

func (*Workspaces) Init added in v0.2.0

func (m *Workspaces) Init() error

func (*Workspaces) MaxWidth added in v0.2.0

func (m *Workspaces) MaxWidth() int

func (*Workspaces) OnHeightChange added in v0.2.0

func (b *Workspaces) OnHeightChange(c func(int))

func (*Workspaces) OnWidthChange added in v0.2.0

func (b *Workspaces) OnWidthChange(c func(int))

func (*Workspaces) OnlyCurrent added in v0.3.0

func (m *Workspaces) OnlyCurrent() bool

func (*Workspaces) SendEvent added in v0.2.0

func (b *Workspaces) SendEvent(ev ui.Event) bool

func (*Workspaces) SetContext added in v0.2.0

func (b *Workspaces) SetContext(ctx ui.Context)

func (*Workspaces) SetMaxWidth added in v0.2.0

func (m *Workspaces) SetMaxWidth(v int)

func (*Workspaces) SetOnlyCurrent added in v0.3.0

func (m *Workspaces) SetOnlyCurrent(v bool)

func (*Workspaces) Width added in v0.2.0

func (b *Workspaces) Width() int

Jump to

Keyboard shortcuts

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