Documentation ¶
Overview ¶
Package shell provides modules to display the output of shell commands. It supports both long-running commands, where the output is the last line, e.g. dmesg or tail -f /var/log/some.log, and repeatedly running commands, e.g. whoami, date +%s.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module represents a shell module that updates on a timer or on demand.
func (*Module) Every ¶
Every sets the refresh interval for the module. The command will be executed repeatedly at the given interval, and the output updated. A zero interval stops automatic repeats (but Refresh will still work).
func (*Module) Output ¶
Output sets the output format. The format func will be passed the entire trimmed output from the command once it's done executing. To process output by lines, see Tail().
type TailModule ¶
type TailModule struct {
// contains filtered or unexported fields
}
TailModule represents a bar.Module that displays the last line of output from a shell command in the bar.
func Tail ¶
func Tail(cmd string, args ...string) *TailModule
Tail constructs a module that displays the last line of output from a long running command.
func (*TailModule) Output ¶
func (m *TailModule) Output(format func(string) bar.Output) *TailModule
Output sets the output format for each line of output.