Documentation
¶
Overview ¶
Package i3barjson provides a Go library for i3bar JSON protocol support.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
Init initializes the i3bar io. w is the io.Writer to write to (usually os.Stdout). r is the io.Reader to from (usually os.Stdin) (TODO: implement). h is the Header object to send as the first line to i3bar. pretty controls whether or not json output will be pretty printed.
func Update ¶
func Update(s StatusLine) error
Update sends a new StatusLine to i3bar. NOTE: this function is not thread safe. Only call it from a single thread.
Types ¶
type Block ¶
type Block struct {
FullText string `json:"full_text"`
ShortText string `json:"short_text,omitempty"`
Color string `json:"color,omitempty"`
MinWidth string `json:"min_width,omitempty"`
Align string `json:"align,omitempty"`
Name string `json:"name,omitempty"`
Instance string `json:"instance,omitempty"`
Urgent bool `json:"urgent,omitempty"`
Separator bool `json:"separator"`
SeparatorBlockWidth int `json:"separator_block_width,omitempty"`
Markup string `json:"markup,omitempty"`
}
Block represents a single block of an i3bar message.
type Click ¶
type Click struct {
Name string `json:"name"`
Instance string `json:"instance"`
X int `json:"x"`
Y int `json:"y"`
Button int `json:"button"`
}
Click represents an i3bar click event.
type Header ¶
type Header struct {
Version int `json:"version"`
StopSignal int `json:"stop_signal,omitempty"`
ContSignal int `json:"cont_signal,omitempty"`
ClickEvents bool `json:"click_events,omitempty"`
}
Header represents the header of an i3bar message.
type StatusLine ¶
type StatusLine []*Block
StatusLine represents a full i3bar status line.
func (StatusLine) String ¶
func (d StatusLine) String() string
String pretty prints StatusLine objects.