i3

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package i3 provides data structures for interacting with the i3bar/swaybar protocol.

Index

Constants

View Source
const (
	// LeftClick represents a left mouse click.
	LeftClick = iota + 1
	// MiddleClick represents a left mouse click.
	MiddleClick
	// RightClick represents a left mouse click.
	RightClick
)

Variables

This section is empty.

Functions

This section is empty.

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"`
	BorderRight         int    `json:"border_right,omitempty"`
	BorderBottom        int    `json:"border_bottom,omitempty"`
	BorderLeft          int    `json:"border_left,omitempty"`
	MinWidth            int    `json:"min_width,omitempty"`
	Align               string `json:"align,omitempty"`
	Urgent              bool   `json:"urgent,omitempty"`
	Name                string `json:"name,omitempty"`
	Instance            string `json:"instance,omitempty"`
	Separator           bool   `json:"separator,omitempty"`
	SeparatorBlockWidth int    `json:"separator_block_width,omitempty"`
	Markup              string `json:"markup,omitempty"`
}

Block is a single section of the i3bar.

type ClickEvent

type ClickEvent struct {
	Name      string   `json:"name"`
	Instance  string   `json:"instance"`
	Button    int      `json:"button"`
	Modifiers []string `json:"modifiers"`
	X         int      `json:"x"`
	Y         int      `json:"y"`
	RelativeX int      `json:"relative_x"`
	RelativeY int      `json:"relative_y"`
	OutputX   int      `json:"output_x"`
	OutputY   int      `json:"output_y"`
	Width     int      `json:"width"`
	Height    int      `json:"height"`
}

ClickEvent is the data sent to this program via STDIN when a click is registered on the i3bar.

type Header struct {
	Version     int            `json:"version"`
	StopSignal  syscall.Signal `json:"stop_signal,omitempty"`
	ContSignal  syscall.Signal `json:"cont_signal,omitempty"`
	ClickEvents bool           `json:"click_events,omitempty"`
}

Header is the first thing that i3bar will read to determine how this program will interact with it.

Jump to

Keyboard shortcuts

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