proto

package
v0.0.0-...-3836d29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package proto provides types and functions implementing the swaybar protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Init initializes the swaybar protocol.

func MergeBlocks

func MergeBlocks(b1 *Block, b2 Block) error

MergeBlocks merges two Blocks. If a field is nil (or empty string in the case of FullText) on b1, it will be set to the value from b2. b1 is modified in place.

func Send

func Send(blocks []Block) error

Send tells the swaybar to render a new set of Blocks.

Types

type Block

type Block struct {
	FullText            string       `json:"full_text"`
	ShortText           *string      `json:"short_text,omitempty"`
	Color               *string      `json:"color,omitempty"`
	Background          *string      `json:"background,omitempty"`
	Border              *string      `json:"border,omitempty"`
	BorderTop           *int         `json:"border_top,omitempty"`
	BorderBottom        *int         `json:"border_bottom,omitempty"`
	BorderLeft          *int         `json:"border_left,omitempty"`
	BorderRight         *int         `json:"border_right,omitempty"`
	MinWidth            *interface{} `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 *int         `json:"separator_block_width,omitempty"`
	Markup              *string      `json:"markup,omitempty"`
}

Block represents the protocol fields of a block in the swaybar.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL