barista.run: barista.run/modules/meminfo Index | Files

package meminfo

import "barista.run/modules/meminfo"

Package meminfo provides an i3bar module that shows memory information.

Index

Package Files

meminfo.go

func RefreshInterval Uses

func RefreshInterval(interval time.Duration)

RefreshInterval configures the polling frequency.

type Info Uses

type Info map[string]unit.Datasize

Info wraps meminfo output. See /proc/meminfo for names of keys. Some common functions are also provided.

func (Info) AvailFrac Uses

func (i Info) AvailFrac() float64

AvailFrac returns the available memory as a fraction of total.

func (Info) Available Uses

func (i Info) Available() unit.Datasize

Available returns the "available" system memory, including currently cached memory that can be freed up if needed.

func (Info) FreeFrac Uses

func (i Info) FreeFrac(k string) float64

FreeFrac returns a free/total metric for a given name, e.g. Mem, Swap, High, etc.

type Module Uses

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

Module represents a bar.Module that displays memory information.

func New Uses

func New() *Module

New creates a new meminfo module.

func (*Module) Output Uses

func (m *Module) Output(outputFunc func(Info) bar.Output) *Module

Output configures a module to display the output of a user-defined function.

func (*Module) Stream Uses

func (m *Module) Stream(s bar.Sink)

Stream subscribes to meminfo and updates the module's output accordingly.

Package meminfo imports 13 packages (graph) and is imported by 3 packages. Updated 2018-11-25. Refresh now. Tools for package owners.