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

package diskspace

import "barista.run/modules/diskspace"

Package diskspace provides an i3bar module for disk space usage.

Index

Package Files

diskspace.go

type Info Uses

type Info struct {
    Available unit.Datasize
    Free      unit.Datasize
    Total     unit.Datasize
}

Info wraps disk space information.

func (Info) AvailFrac Uses

func (i Info) AvailFrac() float64

AvailFrac returns the fraction of disk space available for use.

func (Info) AvailPct Uses

func (i Info) AvailPct() int

AvailPct returns the percentage of disk space available for use.

func (Info) Used Uses

func (i Info) Used() unit.Datasize

Used returns the disk space currently in use.

func (Info) UsedFrac Uses

func (i Info) UsedFrac() float64

UsedFrac returns the fraction of disk space currently in use.

func (Info) UsedPct Uses

func (i Info) UsedPct() int

UsedPct returns the percentage of disk space currently in use.

type Module Uses

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

Module represents a diskspace bar module. It supports setting the output format, click handler, update frequency, and urgency/colour functions.

func New Uses

func New(path string) *Module

New constructs an instance of the diskusage module for the given disk path.

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) RefreshInterval Uses

func (m *Module) RefreshInterval(interval time.Duration) *Module

RefreshInterval configures the polling frequency for statfs.

func (*Module) Stream Uses

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

Stream starts the module.

Package diskspace imports 9 packages (graph) and is imported by 2 packages. Updated 2018-10-31. Refresh now. Tools for package owners.