disk

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: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultIcon = ""

DefaultIcon is the Nerd Font codepoint used when the caller doesn't override Disk.Icon — fa-save.

Variables

This section is empty.

Functions

This section is empty.

Types

type Disk

type Disk struct {
	Path     string
	Interval time.Duration
	FG       color.RGBA
	BG       color.RGBA
	Icon     string
	// MountsPath / SwapsPath override /proc/mounts and /proc/swaps. Empty
	// means the real procfs paths. Tests point these at fixture files.
	MountsPath string
	SwapsPath  string
	// contains filtered or unexported fields
}

Disk reports free space on the configured filesystem path (default "/") in GB. Uses statfs to avoid shelling out.

func New

func New(path string, interval time.Duration, fg, bg color.RGBA) *Disk

func (*Disk) HoverText

func (d *Disk) HoverText() string

HoverText returns a per-mount usage breakdown (used/total + percent), one row per real filesystem, sorted by size descending so the biggest drives are at the top. Implements module.Hoverable.

func (*Disk) Name

func (d *Disk) Name() string

func (*Disk) Render

func (d *Disk) Render() []module.Segment

func (*Disk) Start

func (d *Disk) Start(ctx context.Context) <-chan struct{}

Jump to

Keyboard shortcuts

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