utils

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IPC_TYPE_RUN_COMMAND    = 0
	IPC_TYPE_GET_MONITORS   = 1
	IPC_TYPE_GET_TAGS       = 2
	IPC_TYPE_GET_LAYOUTS    = 3
	IPC_TYPE_GET_DWM_CLIENT = 4
	IPC_TYPE_SUBSCRIBE      = 5
	IPC_TYPE_EVENT          = 6
)
View Source
const HEADER_LEN = 12
View Source
const MAGIC_LEN = 7

Variables

This section is empty.

Functions

func GenerateMessage

func GenerateMessage(message []byte, messageType int) []byte

func InitSubscribe added in v0.1.2

func InitSubscribe(c *net.Conn) error

func SendStruct

func SendStruct(c *net.Conn, msgStruct any, messageType int) error

Types

type Client

type Client struct {
	Name string `json:"name"`
}

type IPCGetDWMClientPayload

type IPCGetDWMClientPayload struct {
	Id int `json:"client_window_id"`
}

type IPCLayoutChangeEvent

type IPCLayoutChangeEvent struct {
	Event struct {
		MonitorNumber int    `json:"monitor_number"`
		NewSymbol     string `json:"new_symbol"`
	} `json:"layout_change_event"`
}

type IPCSubscribePayload

type IPCSubscribePayload struct {
	Event  string `json:"event"`
	Action string `json:"action"`
}

type IPCTagChangeEvent

type IPCTagChangeEvent struct {
	Event struct {
		MonitorNumber int                 `json:"monitor_number"`
		OldState      TagChangeEventState `json:"old_state"`
		NewState      TagChangeEventState `json:"new_state"`
	} `json:"tag_change_event"`
}

type Monitor

type Monitor struct {
	Number     int                 `json:"num"`
	IsSelected bool                `json:"is_selected"`
	TagState   TagChangeEventState `json:"tag_state"`
	Layout     struct {
		Symbol struct {
			Current string `json:"current"`
		} `json:"symbol"`
	} `json:"layout"`
	Clients struct {
		Selected int `json:"selected"`
	}
}

type Tag

type Tag struct {
	BitMask    int    `json:"bit_mask"`
	Name       string `json:"name"`
	IsUrgent   bool
	IsActive   bool
	IsOccupied bool
}

type TagChangeEventState

type TagChangeEventState struct {
	Selected int `json:"selected"`
	Occupied int `json:"occupied"`
	Urgent   int `json:"urgent"`
}

Jump to

Keyboard shortcuts

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