widgets

package
v0.0.0-...-d16cf1c Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2020 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NET_INTERFACE_ALL = "all"
	NET_INTERFACE_VPN = "tun0"
)
View Source
const (
	UP_ARROW   = "▲"
	DOWN_ARROW = "▼"
)
View Source
const (
	ProcSortCpu ProcSortMethod = "c"
	ProcSortMem                = "m"
	ProcSortPid                = "p"
)
View Source
const (
	Celsius    TempScale = 0
	Fahrenheit           = 1
	Disabled             = 2
)
View Source
const KEYBINDS = `` /* 754-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type BatteryWidget

type BatteryWidget struct {
	*ui.LineGraph
	// contains filtered or unexported fields
}

func NewBatteryWidget

func NewBatteryWidget(horizontalScale int) *BatteryWidget

func (*BatteryWidget) Scale

func (b *BatteryWidget) Scale(i int)

type CpuWidget

type CpuWidget struct {
	*ui.LineGraph
	CpuCount        int
	ShowAverageLoad bool
	ShowPerCpuLoad  bool
	// contains filtered or unexported fields
}

func NewCpuWidget

func NewCpuWidget(updateInterval time.Duration, horizontalScale int, showAverageLoad bool, showPerCpuLoad bool) *CpuWidget

func (*CpuWidget) Scale

func (b *CpuWidget) Scale(i int)

type DiskWidget

type DiskWidget struct {
	*ui.Table

	Partitions map[string]*Partition
	// contains filtered or unexported fields
}

func NewDiskWidget

func NewDiskWidget() *DiskWidget

type HelpMenu

type HelpMenu struct {
	ui.Block
}

func NewHelpMenu

func NewHelpMenu() *HelpMenu

func (*HelpMenu) Draw

func (self *HelpMenu) Draw(buf *ui.Buffer)

func (*HelpMenu) Resize

func (self *HelpMenu) Resize(termWidth, termHeight int)

type MemWidget

type MemWidget struct {
	*ui.LineGraph
	// contains filtered or unexported fields
}

func NewMemWidget

func NewMemWidget(updateInterval time.Duration, horizontalScale int) *MemWidget

func (*MemWidget) Scale

func (b *MemWidget) Scale(i int)

type MemoryInfo

type MemoryInfo struct {
	Total       uint64
	Used        uint64
	UsedPercent float64
}

type NetWidget

type NetWidget struct {
	*ui.SparklineGroup

	NetInterface []string
	// contains filtered or unexported fields
}

func NewNetWidget

func NewNetWidget(netInterface string) *NetWidget

TODO: state:merge #169 % option for network use (jrswab/networkPercentage)

type Partition

type Partition struct {
	Device               string
	MountPoint           string
	BytesRead            uint64
	BytesWritten         uint64
	BytesReadRecently    string
	BytesWrittenRecently string
	UsedPercent          uint32
	Free                 string
}

type Proc

type Proc struct {
	Pid         int
	CommandName string
	FullCommand string
	Cpu         float64
	Mem         float64
}

type ProcSortMethod

type ProcSortMethod string

type ProcWidget

type ProcWidget struct {
	*ui.Table
	// contains filtered or unexported fields
}

func NewProcWidget

func NewProcWidget() *ProcWidget

func (*ProcWidget) ChangeProcSortMethod

func (self *ProcWidget) ChangeProcSortMethod(method ProcSortMethod)

func (*ProcWidget) Draw

func (self *ProcWidget) Draw(buf *tui.Buffer)

func (*ProcWidget) HandleEvent

func (self *ProcWidget) HandleEvent(e tui.Event) bool

func (*ProcWidget) KillProc

func (self *ProcWidget) KillProc(sigName string)

KillProc kills a process or group of processes depending on if we're displaying the processes grouped or not.

func (*ProcWidget) SetEditingFilter

func (self *ProcWidget) SetEditingFilter(editing bool)

func (*ProcWidget) SetRect

func (self *ProcWidget) SetRect(x1, y1, x2, y2 int)

func (*ProcWidget) ToggleShowingGroupedProcs

func (self *ProcWidget) ToggleShowingGroupedProcs()

type Scalable

type Scalable interface {
	termui.Drawable
	Scale(i int)
}

type SortProcsByCpu

type SortProcsByCpu []Proc

func (SortProcsByCpu) Len

func (self SortProcsByCpu) Len() int

Len implements Sort interface

func (SortProcsByCpu) Less

func (self SortProcsByCpu) Less(i, j int) bool

Less implements Sort interface

func (SortProcsByCpu) Swap

func (self SortProcsByCpu) Swap(i, j int)

Swap implements Sort interface

type SortProcsByMem

type SortProcsByMem []Proc

func (SortProcsByMem) Len

func (self SortProcsByMem) Len() int

Len implements Sort interface

func (SortProcsByMem) Less

func (self SortProcsByMem) Less(i, j int) bool

Less implements Sort interface

func (SortProcsByMem) Swap

func (self SortProcsByMem) Swap(i, j int)

Swap implements Sort interface

type SortProcsByPid

type SortProcsByPid []Proc

func (SortProcsByPid) Len

func (self SortProcsByPid) Len() int

Len implements Sort interface

func (SortProcsByPid) Less

func (self SortProcsByPid) Less(i, j int) bool

Less implements Sort interface

func (SortProcsByPid) Swap

func (self SortProcsByPid) Swap(i, j int)

Swap implements Sort interface

type StatusBar

type StatusBar struct {
	ui.Block
}

func NewStatusBar

func NewStatusBar() *StatusBar

func (*StatusBar) Draw

func (self *StatusBar) Draw(buf *ui.Buffer)

type TempScale

type TempScale int

type TempWidget

type TempWidget struct {
	*ui.Block // inherits from Block instead of a premade Widget

	Data          map[string]int
	TempThreshold int
	TempLowColor  ui.Color
	TempHighColor ui.Color
	TempScale     TempScale
	// contains filtered or unexported fields
}

func NewTempWidget

func NewTempWidget(tempScale TempScale) *TempWidget

TODO: state:deferred 156 Added temperatures for NVidia GPUs (azak-azkaran/master). Crashes on non-nvidia machines.

func (*TempWidget) Draw

func (self *TempWidget) Draw(buf *ui.Buffer)

Custom Draw method instead of inheriting from a generic Widget.

Jump to

Keyboard shortcuts

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