memory

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultIcon = ""

DefaultIcon is the Nerd Font codepoint used when the caller doesn't override Memory.Icon — fae-chip (memory chip).

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

type Memory struct {
	Interval time.Duration
	FG       color.RGBA
	BG       color.RGBA
	Icon     string
	// MeminfoPath overrides /proc/meminfo. Empty means the real procfs
	// path. Tests point this at a fixture file.
	MeminfoPath string
	// contains filtered or unexported fields
}

Memory shows used-memory percentage computed from MemTotal vs MemAvailable in /proc/meminfo (matches what most monitors report).

func New

func New(interval time.Duration, fg, bg color.RGBA) *Memory

func (*Memory) HoverText

func (m *Memory) HoverText() string

HoverText returns a multi-line breakdown: used/total, free, buffers, cached, and swap usage. Implements module.Hoverable.

func (*Memory) Name

func (m *Memory) Name() string

func (*Memory) Render

func (m *Memory) Render() []module.Segment

func (*Memory) Start

func (m *Memory) Start(ctx context.Context) <-chan struct{}

Jump to

Keyboard shortcuts

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