Documentation
¶
Index ¶
- func Batt(uc chan<- []I3Block)
- func CPU(uc chan<- []I3Block)
- func CPUGraph(uc chan<- []I3Block)
- func ColorString(s string, n float64) string
- func Date(uc chan<- []I3Block)
- func DateTime(uc chan<- []I3Block)
- func GetColor(n float64) string
- func LoadAvg(uc chan<- []I3Block)
- func MemFree(uc chan<- []I3Block)
- func Run(f []func(chan<- []I3Block), noSeparator bool, separatorBlockWidth int)
- func SwapUsed(uc chan<- []I3Block)
- func TimeLocal(uc chan<- []I3Block)
- func TimeUTC(uc chan<- []I3Block)
- func Uptime(uc chan<- []I3Block)
- type I3Block
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CPU ¶
func CPU(uc chan<- []I3Block)
CPU returns cpu time usage every second for each core. Color shifts from green to red as the usage approaches 100
func ColorString ¶
ColorString returns a pango formatted string colored between green and red with the provided value
func LoadAvg ¶
func LoadAvg(uc chan<- []I3Block)
LoadAvg prints the load average for 1, 5 and 15 minutes every second. Color for each load shifts from green to red as it approaches the number of cores on the system.
func MemFree ¶
func MemFree(uc chan<- []I3Block)
MemFree prints the free memory in human readable units. Is green as long as there is 1GiB free, shifts red as the free memory approaches zero.
func Run ¶
Run runs all the specified functions, and prints the output to be consumed by i3bar. It runs each function in a goroutine and updates the bar when any of them return data on the return channel.
Types ¶
type I3Block ¶
type I3Block struct { FullText string `json:"full_text"` ShortText string `json:"short_text,omitempty"` Color string `json:"color,omitempty"` Background string `json:"background,omitempty"` // background color Border string `json:"border,omitempty"` // border color MinWidth int `json:"min_width,omitempty"` Align string `json:"align,omitempty"` // center, right or left alignment of text in block Name string `json:"name,omitempty"` // not used by i3, used for click_events Instance string `json:"instance,omitempty"` Urgent bool `json:"urgent"` NoSeparator bool `json:"-"` // Specify as true to omit the spearator after this field SeparatorBlockWidth int `json:"separator_block_width,omitempty"` // pixels to be left blank after the block Markup string `json:"markup,omitempty"` // set to pango for pango markup }
I3Block represents a block to be printed on the bar. See the i3bar protocol documentation for details on each property