Documentation
¶
Overview ¶
Package ygs contains the YaGoStatus structures.
Index ¶
- func RegisterWidget(name string, newFunc newWidgetFunc, defaultParams interface{})
- type I3BarBlock
- func (b *I3BarBlock) Apply(tpl I3BarBlock)
- func (b I3BarBlock) Env(suffix string) []string
- func (b *I3BarBlock) FromJSON(data []byte, strict bool) error
- func (b I3BarBlock) MarshalJSON() ([]byte, error)
- func (b *I3BarBlock) ToVaryMap() map[string]Vary
- func (b *I3BarBlock) UnmarshalJSON(data []byte) error
- type I3BarClickEvent
- type I3BarHeader
- type Vary
- type Widget
- type WidgetConfig
- type WidgetEventConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterWidget ¶
func RegisterWidget(name string, newFunc newWidgetFunc, defaultParams interface{})
RegisterWidget registers widget.
Types ¶
type I3BarBlock ¶
type I3BarBlock struct { FullText string `json:"full_text,omitempty"` ShortText string `json:"short_text,omitempty"` Color string `json:"color,omitempty"` BorderColor string `json:"border,omitempty"` BorderTop *uint16 `json:"border_top,omitempty"` BorderBottom *uint16 `json:"border_bottom,omitempty"` BorderLeft *uint16 `json:"border_left,omitempty"` BorderRight *uint16 `json:"border_right,omitempty"` BackgroundColor string `json:"background,omitempty"` Markup string `json:"markup,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,omitempty"` SeparatorBlockWidth uint16 `json:"separator_block_width,omitempty"` Custom map[string]Vary `json:"-"` }
I3BarBlock represents a block of i3bar message.
func (*I3BarBlock) Apply ¶ added in v1.0.0
func (b *I3BarBlock) Apply(tpl I3BarBlock)
func (I3BarBlock) Env ¶ added in v1.0.0
func (b I3BarBlock) Env(suffix string) []string
func (*I3BarBlock) FromJSON ¶ added in v1.0.0
func (b *I3BarBlock) FromJSON(data []byte, strict bool) error
func (I3BarBlock) MarshalJSON ¶
func (b I3BarBlock) MarshalJSON() ([]byte, error)
MarshalJSON marshals json with custom keys (with _ prefix).
func (*I3BarBlock) ToVaryMap ¶ added in v1.0.0
func (b *I3BarBlock) ToVaryMap() map[string]Vary
func (*I3BarBlock) UnmarshalJSON ¶
func (b *I3BarBlock) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals json with custom keys (with _ prefix).
type I3BarClickEvent ¶
type I3BarClickEvent struct { Name string `json:"name,omitempty"` Instance string `json:"instance,omitempty"` Button uint8 `json:"button"` X uint16 `json:"x"` Y uint16 `json:"y"` RelativeX uint16 `json:"relative_x"` RelativeY uint16 `json:"relative_y"` Width uint16 `json:"width"` Height uint16 `json:"height"` Modifiers []string `json:"modifiers"` }
I3BarClickEvent represents a user click event message.
type I3BarHeader ¶
type I3BarHeader struct { Version uint8 `json:"version"` StopSignal int `json:"stop_signal,omitempty"` ContSignal int `json:"cont_signal,omitempty"` ClickEvents bool `json:"click_events,omitempty"` }
I3BarHeader represents the header of an i3bar message.
type Vary ¶ added in v1.0.0
type Vary []byte
func (Vary) MarshalJSON ¶ added in v1.0.0
func (*Vary) UnmarshalJSON ¶ added in v1.0.0
type Widget ¶
type Widget interface { Run(chan<- []I3BarBlock) error Event(I3BarClickEvent, []I3BarBlock) error Stop() error Continue() error Shutdown() error }
Widget represents a widget struct.
type WidgetConfig ¶ added in v1.0.0
type WidgetConfig struct { Name string `yaml:"widget"` Workspaces []string `yaml:"workspaces"` Templates []I3BarBlock `yaml:"-"` Events []WidgetEventConfig `yaml:"events"` WorkDir string `yaml:"-"` Index int `yaml:"-"` File string `yaml:"-"` Variables map[string]string `yaml:"variables"` Params map[string]interface{} `yaml:",inline"` IncludeStack []string `yaml:"-"` }
WidgetConfig represents a widget configuration.
func ErrorWidget ¶ added in v1.0.0
func ErrorWidget(text string) WidgetConfig
ErrorWidget creates new widget with error message.
func (WidgetConfig) Validate ¶ added in v1.0.0
func (c WidgetConfig) Validate() error
Validate checks widget configuration.
type WidgetEventConfig ¶ added in v1.0.0
type WidgetEventConfig struct { Command string `yaml:"command"` Button uint8 `yaml:"button"` Modifiers []string `yaml:"modifiers,omitempty"` Name string `yaml:"name,omitempty"` Instance string `yaml:"instance,omitempty"` OutputFormat string `yaml:"output_format,omitempty"` Override bool `yaml:"override"` WorkDir string `yaml:"workdir"` }
WidgetEventConfig represents a widget events.
func (*WidgetEventConfig) Validate ¶ added in v1.0.0
func (e *WidgetEventConfig) Validate() error
Validate checks event parameters.
Click to show internal directories.
Click to hide internal directories.