widgets

package
v0.0.0-...-f7b6593 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 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 KEYBINDS = `` /* 459-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

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

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

type MemoryInfo

type MemoryInfo struct {
	Total       uint64
	Used        uint64
	UsedPercent float64
}

type NetInterface

type NetInterface string

type NetWidget

type NetWidget struct {
	*ui.SparklineGroup

	NetInterface string
	// contains filtered or unexported fields
}

func NewNetWidget

func NewNetWidget(netInterface string) *NetWidget

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) KillProc

func (self *ProcWidget) KillProc()

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

func (*ProcWidget) ToggleShowingGroupedProcs

func (self *ProcWidget) ToggleShowingGroupedProcs()

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
const (
	Celcius    TempScale = 0
	Fahrenheit           = 1
)

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

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