Documentation
¶
Overview ¶
Package wmipc is the wire contract of lys-wm's IPC socket: JSON lines, each request answered by a Response, and a watch stream of events. The compositor serves it and its clients speak it. Output, Workspace and Window are the views clients decode, a subset of what the compositor sends, so that a list of windows does not decode every window's icon.
Index ¶
Constants ¶
const SocketEnv = "LYS_WM_SOCKET"
SocketEnv is the variable lys-wm exports its socket path in.
const Version = 1
Version is the protocol version every Response carries.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaptureEventKind ¶
type CaptureEventKind string
CaptureEventKind names one event of an input capture stream.
const ( CaptureKeymap CaptureEventKind = "keymap" CaptureActivated CaptureEventKind = "activated" CaptureDeactivated CaptureEventKind = "deactivated" CaptureDisabled CaptureEventKind = "disabled" CaptureMotion CaptureEventKind = "motion" CaptureButton CaptureEventKind = "button" CaptureScroll CaptureEventKind = "scroll" CaptureScrollDiscrete CaptureEventKind = "scroll_discrete" CaptureScrollStop CaptureEventKind = "scroll_stop" CaptureFrame CaptureEventKind = "frame" CaptureKey CaptureEventKind = "key" CaptureModifiers CaptureEventKind = "modifiers" CaptureError CaptureEventKind = "error" CaptureApplied CaptureEventKind = "applied" )
The input capture events.
type CapturePoint ¶
CapturePoint is a point of the layout in logical pixels.
type EventKind ¶
type EventKind string
EventKind names one event of the watch stream.
const ( EventOutput EventKind = "output" EventWorkspace EventKind = "workspace" EventFocusedOutput EventKind = "focusedoutput" EventOpen EventKind = "open" EventClose EventKind = "close" EventMove EventKind = "move" EventTitle EventKind = "title" EventAppID EventKind = "appid" EventRect EventKind = "rect" EventIcon EventKind = "icon" EventUrgent EventKind = "urgent" EventMinimized EventKind = "minimized" EventMode EventKind = "mode" EventUnresponsive EventKind = "unresponsive" EventPin EventKind = "pin" EventSwallow EventKind = "swallow" EventStack EventKind = "stack" EventFocus EventKind = "focus" EventSubmap EventKind = "submap" EventLayout EventKind = "layout" EventLocks EventKind = "locks" EventReducedMotion EventKind = "reducedmotion" EventDispatch EventKind = "dispatch" EventOverview EventKind = "overview" EventConfigProblems EventKind = "configproblems" EventWindowMenu EventKind = "windowmenu" EventShowDesktop EventKind = "showdesktop" EventScratchpad EventKind = "scratchpad" EventLayer EventKind = "layer" EventGroup EventKind = "group" EventBell EventKind = "bell" EventCastTarget EventKind = "casttarget" EventBinds EventKind = "binds" EventMRU EventKind = "mru" EventSwitcher EventKind = "switcher" )
The watch events.
type Kind ¶
type Kind string
Kind names a request.
const ( KindVersion Kind = "version" KindOutputs Kind = "outputs" KindWorkspaces Kind = "workspaces" KindWindows Kind = "windows" KindActiveWindow Kind = "activewindow" KindSubmap Kind = "submap" KindLayout Kind = "layout" KindLocks Kind = "locks" KindReducedMotion Kind = "reducedmotion" KindDispatch Kind = "dispatch" KindWatch Kind = "watch" KindIcon Kind = "icon" KindOverview Kind = "overview" KindScratchpads Kind = "scratchpads" KindConfigProblems Kind = "configproblems" KindUpgrade Kind = "upgrade" KindCreateOutput Kind = "createoutput" KindRemoveOutput Kind = "removeoutput" KindCapture Kind = "capture" KindLayers Kind = "layers" KindDevices Kind = "devices" KindPickWindow Kind = "pickwindow" KindCastTarget Kind = "casttarget" KindBinds Kind = "binds" )
The requests.
type Mode ¶
type Mode struct {
Width int `json:"width"`
Height int `json:"height"`
RefreshMHz int32 `json:"refresh_mhz"`
}
Mode is an output mode: its size in pixels and its refresh rate in millihertz.
type Output ¶
type Output struct {
Name string `json:"name"`
Description string `json:"description"`
Rect Rect `json:"rect"`
Scale float64 `json:"scale"`
Mode Mode `json:"mode"`
Workspace int `json:"workspace"`
Focused bool `json:"focused"`
Powered bool `json:"powered"`
}
Output is a client's view of one entry of the outputs result.
type Rect ¶
type Rect struct {
X int `json:"x"`
Y int `json:"y"`
Width int `json:"width"`
Height int `json:"height"`
}
Rect is a rectangle in logical pixels of the output layout.
type Response ¶
type Response struct {
Version int `json:"version"`
Error string `json:"error,omitempty"`
Result json.RawMessage `json:"result,omitempty"`
}
Response answers one request: Error when the compositor refused it, otherwise Result.
type Window ¶
type Window struct {
ID uint64 `json:"id"`
AppID string `json:"app_id"`
Title string `json:"title"`
Workspace int `json:"workspace"`
Output string `json:"output"`
Rect Rect `json:"rect"`
Floating bool `json:"floating"`
Fullscreen bool `json:"fullscreen"`
Minimized bool `json:"minimized"`
Urgent bool `json:"urgent"`
Focused bool `json:"focused"`
// Stack is the window's front-to-back index among the windows its
// output shows, 0 on top; nil while no output shows it.
Stack *int `json:"stack,omitempty"`
}
Window is a client's view of one mapped window.