diskspace

package
Version: v0.0.0-...-ed2009f Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: Apache-2.0 Imports: 9 Imported by: 6

Documentation

Overview

Package diskspace provides an i3bar module for disk space usage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

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

Info wraps disk space information.

func (Info) AvailFrac

func (i Info) AvailFrac() float64

AvailFrac returns the fraction of disk space available for use.

func (Info) AvailPct

func (i Info) AvailPct() int

AvailPct returns the percentage of disk space available for use.

func (Info) Used

func (i Info) Used() unit.Datasize

Used returns the disk space currently in use.

func (Info) UsedFrac

func (i Info) UsedFrac() float64

UsedFrac returns the fraction of disk space currently in use.

func (Info) UsedPct

func (i Info) UsedPct() int

UsedPct returns the percentage of disk space currently in use.

type Module

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

func New(path string) *Module

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

func (*Module) Output

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

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

RefreshInterval configures the polling frequency for statfs.

func (*Module) Stream

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

Stream starts the module.

Source Files

Jump to

Keyboard shortcuts

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