barproto

package
v0.0.0-...-30cb9ea Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package barproto implements the i3bar protocol.

https://i3wm.org/docs/i3bar-protocol.html

Index

Constants

View Source
const Version = 1 // i3 v4.3+, last tested on v4.23

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Name                string // optional, passed as-is for events
	Instance            string // optional, passed as-is for events
	FullText            string // text
	ShortText           string // optional
	Color               uint32 // 0xRRGGBBAA (AA should be 0xFF for solid colors) (0x00000000 is treated as i3bar's default)
	Background          uint32 // ^
	Border              uint32 // ^
	BorderTop           int    // pixels (0 is treated as i3bar's default of 1, set to -1 to disable the border)
	BorderRight         int    // ^
	BorderBottom        int    // ^
	BorderLeft          int    // ^
	MinWidth            int    // pixels (0 is none)
	MinWidthString      string // overrides MinWidth with the width of the specified text if not empty
	Align               string // left|center|right, used if smaller than MinWidth
	Urgent              bool   // used by i3bar
	Separator           bool   // whether to draw a separator line after the block
	SeparatorBlockWidth int    // pixels, should be odd since line is in the middle (if Separator is true, 0 is treated as the i3bar's value, otherwise -1 is)
	Pango               bool   // whether to use pango markup
}

Block represents an i3bar block.

func (Block) AppendJSON

func (b Block) AppendJSON(s []byte) []byte

func (Block) MarshalJSON

func (b Block) MarshalJSON() ([]byte, error)

type Event

type Event struct {
	Name      string
	Instance  string
	Button    int // xproto.ButtonIndex*
	Modifiers int // xproto.ModMask*
	X         int
	Y         int
	RelativeX int
	RelativeY int
	OutputX   int
	OutputY   int
	Width     int
	Height    int
}

Event represents an i3bar event.

func (*Event) FromJSON

func (e *Event) FromJSON(b []byte)

FromJSON parses b without any error checking.

type Init

type Init struct {
	StopSignal  syscall.Signal
	ContSignal  syscall.Signal
	ClickEvents bool
}

Init represents an i3bar initialization message.

func (Init) AppendJSON

func (x Init) AppendJSON(s []byte) []byte

func (Init) MarshalJSON

func (x Init) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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