Documentation ¶
Index ¶
- Constants
- func Get(size int) []byte
- func Put(buf []byte)
- func Subscribe(c IPC, ev EventHandler, events ...EventType) error
- func UnsafeBytes(s string) []byte
- type ActiveLayout
- type ActiveWindow
- type ActiveWorkspace
- type Bind
- type ByteQueue
- type Client
- type CloseLayer
- type CloseWindow
- type CursorPos
- type Devices
- type DummyEvHandler
- func (e *DummyEvHandler) ActiveLayout(ActiveLayout)
- func (e *DummyEvHandler) ActiveWindow(ActiveWindow)
- func (e *DummyEvHandler) CloseLayer(CloseLayer)
- func (e *DummyEvHandler) CloseWindow(CloseWindow)
- func (e *DummyEvHandler) CreateWorkspace(WorkspaceName)
- func (e *DummyEvHandler) DestroyWorkspace(WorkspaceName)
- func (e *DummyEvHandler) FocusedMonitor(FocusedMonitor)
- func (e *DummyEvHandler) Fullscreen(bool)
- func (e *DummyEvHandler) MonitorAdded(MonitorName)
- func (e *DummyEvHandler) MonitorRemoved(MonitorName)
- func (e *DummyEvHandler) MoveWindow(MoveWindow)
- func (e *DummyEvHandler) MoveWorkspace(MoveWorkspace)
- func (e *DummyEvHandler) OpenLayer(OpenLayer)
- func (e *DummyEvHandler) OpenWindow(OpenWindow)
- func (e *DummyEvHandler) SubMap(SubMap)
- func (e *DummyEvHandler) Workspace(WorkspaceName)
- type DummyIPC
- func (d DummyIPC) ActiveWindow() (Window, error)
- func (d DummyIPC) ActiveWorkspace() (Workspace, error)
- func (d DummyIPC) Binds() ([]Bind, error)
- func (d DummyIPC) Clients() ([]Client, error)
- func (d DummyIPC) CursorPos() (CursorPos, error)
- func (d DummyIPC) Devices() (Devices, error)
- func (d DummyIPC) Dispatch(*ByteQueue) ([]byte, error)
- func (d DummyIPC) GetOption(string) (string, error)
- func (d DummyIPC) Keyword(*ByteQueue) error
- func (d DummyIPC) Kill() error
- func (d DummyIPC) Layers() (Layers, error)
- func (d DummyIPC) Monitors() ([]Monitor, error)
- func (d DummyIPC) Receive() ([]ReceivedData, error)
- func (d DummyIPC) Reload() error
- func (d DummyIPC) SetCursor(string, string) error
- func (d DummyIPC) Splash() (string, error)
- func (d DummyIPC) Version() (Version, error)
- func (d DummyIPC) Workspaces() ([]Workspace, error)
- type EventHandler
- type EventType
- type FocusedMonitor
- type IPC
- type IPCClient
- func (c *IPCClient) ActiveWindow() (Window, error)
- func (c *IPCClient) ActiveWorkspace() (Workspace, error)
- func (c *IPCClient) Binds() ([]Bind, error)
- func (c *IPCClient) Clients() ([]Client, error)
- func (c *IPCClient) CursorPos() (CursorPos, error)
- func (c *IPCClient) Devices() (Devices, error)
- func (c *IPCClient) Dispatch(a *ByteQueue) ([]byte, error)
- func (c *IPCClient) GetOption(name string) (string, error)
- func (c *IPCClient) Keyword(args *ByteQueue) error
- func (c *IPCClient) Kill() error
- func (c *IPCClient) Layers() (Layers, error)
- func (c *IPCClient) Monitors() ([]Monitor, error)
- func (c *IPCClient) Receive() ([]ReceivedData, error)
- func (c *IPCClient) Reload() error
- func (c *IPCClient) SetCursor(theme, size string) error
- func (c *IPCClient) Splash() (string, error)
- func (c *IPCClient) Version() (Version, error)
- func (c *IPCClient) Workspaces() ([]Workspace, error)
- type Layer
- type LayerField
- type Layers
- type Monitor
- type MonitorName
- type MoveWindow
- type MoveWorkspace
- type OpenLayer
- type OpenWindow
- type Pool
- type PriorityQueue
- func (q *PriorityQueue[T]) Add(value T)
- func (q *PriorityQueue[T]) Back(value T)
- func (q *PriorityQueue[T]) IsEmpty() bool
- func (q *PriorityQueue[T]) Len() int
- func (q *PriorityQueue[T]) Peek() T
- func (q *PriorityQueue[T]) Pop() T
- func (q *PriorityQueue[T]) Push(priority int, value T)
- func (q *PriorityQueue[T]) Reset()
- type ReceivedData
- type SubMap
- type Version
- type Window
- type Workspace
- type WorkspaceName
- type WorkspaceType
Constants ¶
View Source
const ( BufSize = 8192 Separator = ">>" Success = "ok" )
Variables ¶
This section is empty.
Functions ¶
func UnsafeBytes ¶
UnsafeBytes returns a byte pointer without allocation.
Types ¶
type ActiveLayout ¶
type ActiveLayout struct {
Type, Name string
}
type ActiveWindow ¶
type ActiveWindow struct {
Name, Title string
}
type ActiveWorkspace ¶
type ActiveWorkspace WorkspaceName
type Bind ¶
type Bind struct { Locked bool `json:"locked"` Mouse bool `json:"mouse"` Release bool `json:"release"` Repeat bool `json:"repeat"` NoConsuming bool `json:"non_consuming"` ModMask int `json:"modmask"` SubMap string `json:"submap"` Key string `json:"key"` KeyCode int `json:"keycode"` Dispatcher string `json:"dispatcher"` Arg string `json:"arg"` }
type ByteQueue ¶
type ByteQueue struct { *PriorityQueue[[]byte] }
func NewByteQueue ¶
func NewByteQueue() *ByteQueue
type Client ¶
type Client struct { Address string `json:"address"` At []int `json:"at"` Size []int `json:"size"` Workspace Workspace `json:"workspace"` Floating bool `json:"floating"` Monitor int `json:"monitor"` Class string `json:"class"` Title string `json:"title"` Pid int `json:"pid"` Xwayland bool `json:"xwayland"` Pinned bool `json:"pinned"` Fullscreen bool `json:"fullscreen"` FullscreenMode int `json:"fullscreenMode"` }
type CloseLayer ¶
type CloseLayer string
type CloseWindow ¶
type CloseWindow struct {
Address string
}
type Devices ¶
type Devices struct { Mice []struct { Address string `json:"address"` Name string `json:"name"` DefaultSpeed float64 `json:"defaultSpeed"` } `json:"mice"` Keyboards []struct { Address string `json:"address"` Name string `json:"name"` Rules string `json:"rules"` Model string `json:"model"` Layout string `json:"layout"` Variant string `json:"variant"` Options string `json:"options"` ActiveKeymap string `json:"active_keymap"` Main bool `json:"main"` } `json:"keyboards"` Tablets []interface{} `json:"tablets"` Touch []interface{} `json:"touch"` Switches []struct { Address string `json:"address"` Name string `json:"name"` } `json:"switches"` }
type DummyEvHandler ¶
type DummyEvHandler struct{}
func (*DummyEvHandler) ActiveLayout ¶
func (e *DummyEvHandler) ActiveLayout(ActiveLayout)
func (*DummyEvHandler) ActiveWindow ¶
func (e *DummyEvHandler) ActiveWindow(ActiveWindow)
func (*DummyEvHandler) CloseLayer ¶
func (e *DummyEvHandler) CloseLayer(CloseLayer)
func (*DummyEvHandler) CloseWindow ¶
func (e *DummyEvHandler) CloseWindow(CloseWindow)
func (*DummyEvHandler) CreateWorkspace ¶
func (e *DummyEvHandler) CreateWorkspace(WorkspaceName)
func (*DummyEvHandler) DestroyWorkspace ¶
func (e *DummyEvHandler) DestroyWorkspace(WorkspaceName)
func (*DummyEvHandler) FocusedMonitor ¶
func (e *DummyEvHandler) FocusedMonitor(FocusedMonitor)
func (*DummyEvHandler) Fullscreen ¶
func (e *DummyEvHandler) Fullscreen(bool)
func (*DummyEvHandler) MonitorAdded ¶
func (e *DummyEvHandler) MonitorAdded(MonitorName)
func (*DummyEvHandler) MonitorRemoved ¶
func (e *DummyEvHandler) MonitorRemoved(MonitorName)
func (*DummyEvHandler) MoveWindow ¶
func (e *DummyEvHandler) MoveWindow(MoveWindow)
func (*DummyEvHandler) MoveWorkspace ¶
func (e *DummyEvHandler) MoveWorkspace(MoveWorkspace)
func (*DummyEvHandler) OpenLayer ¶
func (e *DummyEvHandler) OpenLayer(OpenLayer)
func (*DummyEvHandler) OpenWindow ¶
func (e *DummyEvHandler) OpenWindow(OpenWindow)
func (*DummyEvHandler) SubMap ¶
func (e *DummyEvHandler) SubMap(SubMap)
func (*DummyEvHandler) Workspace ¶
func (e *DummyEvHandler) Workspace(WorkspaceName)
type DummyIPC ¶
type DummyIPC struct{}
func (DummyIPC) ActiveWindow ¶
func (DummyIPC) ActiveWorkspace ¶
func (DummyIPC) Receive ¶
func (d DummyIPC) Receive() ([]ReceivedData, error)
func (DummyIPC) Workspaces ¶
type EventHandler ¶
type EventHandler interface { // Workspace emitted on workspace change. Is emitted ONLY when a user requests a workspace change, and is not emitted on mouse movements (see activemon) Workspace(w WorkspaceName) // FocusedMonitor emitted on the active monitor being changed. FocusedMonitor(m FocusedMonitor) // ActiveWindow emitted on the active window being changed. ActiveWindow(w ActiveWindow) // Fullscreen emitted when a fullscreen status of a window changes. Fullscreen(f bool) // MonitorRemoved emitted when a monitor is removed (disconnected) MonitorRemoved(m MonitorName) // MonitorAdded emitted when a monitor is added (connected) MonitorAdded(m MonitorName) // CreateWorkspace emitted when a workspace is created CreateWorkspace(w WorkspaceName) // DestroyWorkspace emitted when a workspace is destroyed DestroyWorkspace(w WorkspaceName) // MoveWorkspace emitted when a workspace is moved to a different monitor MoveWorkspace(w MoveWorkspace) // ActiveLayout emitted on a layout change of the active keyboard ActiveLayout(l ActiveLayout) // OpenWindow emitted when a window is opened OpenWindow(o OpenWindow) // CloseWindow emitted when a window is closed CloseWindow(c CloseWindow) // MoveWindow emitted when a window is moved to a workspace MoveWindow(m MoveWindow) // OpenLayer emitted when a layerSurface is mapped OpenLayer(l OpenLayer) // CloseLayer emitted when a layerSurface is unmapped CloseLayer(c CloseLayer) // SubMap emitted when a keybind submap changes. Empty means default. SubMap(s SubMap) }
EventHandler Hyprland will write to each connected ipc live events like this:
type EventType ¶
type EventType string
const ( EventWorkspace EventType = "workspace" EventFocusedMonitor EventType = "focusedmon" EventActiveWindow EventType = "activewindow" EventFullscreen EventType = "fullscreen" EventMonitorRemoved EventType = "monitorremoved" EventMonitorAdded EventType = "monitoradded" EventCreateWorkspace EventType = "createworkspace" EventDestroyWorkspace EventType = "destroyworkspace" EventMoveWorkspace EventType = "moveworkspace" EventActiveLayout EventType = "activelayout" EventOpenWindow EventType = "openwindow" EventCloseWindow EventType = "closewindow" EventMoveWindow EventType = "movewindow" EventOpenLayer EventType = "openlayer" EventCloseLayer EventType = "closelayer" EventSubMap EventType = "submap" )
func GetAllEvents ¶
func GetAllEvents() []EventType
type FocusedMonitor ¶
type FocusedMonitor struct { MonitorName WorkspaceName }
type IPC ¶
type IPC interface { Receive() ([]ReceivedData, error) Dispatch(args *ByteQueue) ([]byte, error) Workspaces() ([]Workspace, error) ActiveWorkspace() (Workspace, error) Monitors() ([]Monitor, error) Clients() ([]Client, error) ActiveWindow() (Window, error) Layers() (Layers, error) Devices() (Devices, error) Keyword(args *ByteQueue) error Version() (Version, error) Kill() error Splash() (string, error) Reload() error SetCursor(theme, size string) error GetOption(name string) (string, error) CursorPos() (CursorPos, error) Binds() ([]Bind, error) }
type IPCClient ¶
type IPCClient struct {
// contains filtered or unexported fields
}
func MustClient ¶
func (*IPCClient) ActiveWindow ¶
func (*IPCClient) ActiveWorkspace ¶
func (*IPCClient) Receive ¶
func (c *IPCClient) Receive() ([]ReceivedData, error)
func (*IPCClient) Workspaces ¶
type Layer ¶
type Layer struct {
Levels map[int][]LayerField `json:"levels"`
}
type LayerField ¶
type Monitor ¶
type Monitor struct { Id int `json:"id"` Name string `json:"name"` Description string `json:"description"` Width int `json:"width"` Height int `json:"height"` RefreshRate float64 `json:"refreshRate"` X int `json:"x"` Y int `json:"y"` ActiveWorkspace WorkspaceType `json:"activeWorkspace"` Reserved []int `json:"reserved"` Scale float64 `json:"scale"` Transform int `json:"transform"` Focused bool `json:"focused"` DpmsStatus bool `json:"dpmsStatus"` }
type MonitorName ¶
type MonitorName string
type MoveWindow ¶
type MoveWindow struct { Address string WorkspaceName }
type MoveWorkspace ¶
type MoveWorkspace struct { WorkspaceName MonitorName }
type OpenWindow ¶
type OpenWindow struct {
Address, Class, Title string
WorkspaceName
}
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool consists of 32 sync.Pool, representing byte slices of length from 0 to 32 in powers of 2.
type PriorityQueue ¶
type PriorityQueue[T any] struct { // contains filtered or unexported fields }
func NewQueue ¶
func NewQueue[T any]() *PriorityQueue[T]
func (*PriorityQueue[T]) Add ¶
func (q *PriorityQueue[T]) Add(value T)
func (*PriorityQueue[T]) Back ¶
func (q *PriorityQueue[T]) Back(value T)
func (*PriorityQueue[T]) IsEmpty ¶
func (q *PriorityQueue[T]) IsEmpty() bool
func (*PriorityQueue[T]) Len ¶
func (q *PriorityQueue[T]) Len() int
func (*PriorityQueue[T]) Peek ¶
func (q *PriorityQueue[T]) Peek() T
func (*PriorityQueue[T]) Pop ¶
func (q *PriorityQueue[T]) Pop() T
func (*PriorityQueue[T]) Push ¶
func (q *PriorityQueue[T]) Push(priority int, value T)
func (*PriorityQueue[T]) Reset ¶
func (q *PriorityQueue[T]) Reset()
type ReceivedData ¶
type Window ¶
type Window struct { Address string `json:"address"` At []int `json:"at"` Size []int `json:"size"` Workspace WorkspaceType `json:"workspace"` Floating bool `json:"floating"` Monitor int `json:"monitor"` Class string `json:"class"` Title string `json:"title"` Pid int `json:"pid"` Xwayland bool `json:"xwayland"` }
type WorkspaceName ¶
type WorkspaceName string
type WorkspaceType ¶
Click to show internal directories.
Click to hide internal directories.