System Information
godocimport "barista.run/modules/sysinfo"
Configuration
Output(func(Info) bar.Output)
: Sets the output format.
Because the sysinfo module performs a single sysinfo call to update all instances, the refresh interval can only be set for the package as a whole.
sysinfo.RefreshInterval(time.Duration)
: Sets the interval to wait between updating sysinfo. Defaults to 3 seconds.
Example
up 132h10m78s
Show the system uptime:
sysinfo.New().Output(func(i sysinfo.Info) bar.Output) {
return outputs.Textf("up %v", i.Uptime)
})
Data: type Info struct
Fields
Uptime time.Duration
: System uptime.Loads [3]float64
: Load average for the past 1, 5, and 15 minutes.Procs uint16
: Number of current processes.TotalRAM unit.Datasize
FreeRAM unit.Datasize
SharedRAM unit.Datasize
BufferRAM unit.Datasize
TotalSwap unit.Datasize
FreeSwap unit.Datasize
TotalHighRAM unit.Datasize
FreeHighRAM unit.Datasize