Documentation
¶
Overview ¶
Package funcs provides the ability to construct i3bar modules from simple Funcs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OnceModule ¶
type OnceModule struct {
Func
}
OnceModule represents a bar.Module that runs a function once. If the function sets an error output, it will be restarted on the next click.
func Once ¶
func Once(f Func) *OnceModule
Once constructs a bar module that runs the given function once. Useful if the function loops internally.
type OnclickModule ¶
type OnclickModule struct {
Func
}
OnclickModule represents a bar.Module that runs a function and marks the module as finished, causing the next click to start the module again.
func OnClick ¶
func OnClick(f Func) *OnclickModule
OnClick constructs a bar module that runs the given function when clicked. The function is given a Channel to allow multiple outputs (e.g. Loading... Done), and when the function returns, the next click will call it again.
type RepeatingModule ¶
type RepeatingModule struct {
// contains filtered or unexported fields
}
RepeatingModule represents a bar.Module that runs a function at a fixed interval (while accounting for bar paused/resumed state).
func Every ¶
func Every(d time.Duration, f Func) *RepeatingModule
Every constructs a bar module that repeatedly runs the given function. Useful if the function needs to poll a resource for output.
func (*RepeatingModule) Refresh ¶
func (r *RepeatingModule) Refresh()
Refresh forces a refresh of the data being displayed.
func (*RepeatingModule) Stream ¶
func (r *RepeatingModule) Stream(s bar.Sink)
Stream starts the module.