Documentation
¶
Overview ¶
Package ipc serves lys-wm's state, actions and events over a Unix socket as JSON lines, for lys-wmctl, bars and scripts.
Index ¶
- Variables
- func AppendEvent(dst []byte, e Event) ([]byte, error)
- func Do(path string, req Request) (json.RawMessage, error)
- func Encode(e Event) ([]byte, error)
- func EncodeCaptureCommand(cmd CaptureCommand) ([]byte, error)
- func FindSocket(getenv func(string) string) (string, error)
- func ParseMode(s string) (wmipc.Mode, error)
- func RectOf(r image.Rectangle) wmipc.Rect
- func ReplyUpgrade(file *os.File, result UpgradeResult) error
- func SocketPath(runtimeDir, display string) (string, error)
- type AppIDEvent
- type Barrier
- type BarrierID
- type BellEvent
- type Bind
- type BindsEvent
- type Capability
- type CaptureActivatedEvent
- type CaptureAppliedEvent
- type CaptureButtonEvent
- type CaptureCommand
- type CaptureConn
- type CaptureDeactivatedEvent
- type CaptureDisabledEvent
- type CaptureErrorEvent
- type CaptureFrameEvent
- type CaptureKeyEvent
- type CaptureKeymapEvent
- type CaptureModifiersEvent
- type CaptureMotionEvent
- type CaptureScrollDiscreteEvent
- type CaptureScrollEvent
- type CaptureScrollStopEvent
- type CaptureSession
- type CastKind
- type CastTarget
- type CastTargetEvent
- type CloseEvent
- type ConfigProblems
- type ConfigProblemsEvent
- type CreatedOutput
- type Device
- type DisableCapture
- type DispatchEvent
- type EnableCapture
- type Event
- type FocusEvent
- type FocusedOutputEvent
- type Group
- type GroupEvent
- type Handler
- type Icon
- type IconEvent
- type IconImage
- type KeyboardInteractivity
- type Layer
- type LayerChange
- type LayerEvent
- type LayerLevel
- type LayoutEvent
- type LocksEvent
- type MRUEvent
- type MinimizedEvent
- type ModeEvent
- type MoveEvent
- type OpenEvent
- type Output
- type OutputChange
- type OutputEvent
- type OutputSpec
- type OverviewEvent
- type PinEvent
- type RectEvent
- type ReducedMotionEvent
- type ReleaseCapture
- type Request
- type Scratchpad
- type ScratchpadEvent
- type Server
- func (s *Server) AdoptWatcher(file *os.File) error
- func (s *Server) Announce(e Event)
- func (s *Server) Changed()
- func (s *Server) Close() error
- func (s *Server) Dispatched(a wm.Action)
- func (s *Server) ListenerFD() (*os.File, error)
- func (s *Server) OnUpgrade(u Upgrader)
- func (s *Server) Path() string
- func (s *Server) PauseAccept() error
- func (s *Server) ResumeAccept() error
- func (s *Server) Start()
- func (s *Server) WatcherFiles() ([]*os.File, error)
- type SetBarriers
- type ShowDesktopEvent
- type Snapshot
- type StackEvent
- type Stream
- type SubmapEvent
- type SwallowEvent
- type Switcher
- type SwitcherEvent
- type TitleEvent
- type UnresponsiveEvent
- type UpgradeResult
- type Upgrader
- type UrgentEvent
- type Window
- type WindowMenuEvent
- type Workspace
- type WorkspaceEvent
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadRequest = errors.New("ipc: bad request")
View Source
var ErrNoSocket = errors.New("ipc: no lys-wm socket")
View Source
var ErrShutdown = errors.New("ipc: lys-wm is shutting down")
Functions ¶
func EncodeCaptureCommand ¶
func EncodeCaptureCommand(cmd CaptureCommand) ([]byte, error)
func ReplyUpgrade ¶
func ReplyUpgrade(file *os.File, result UpgradeResult) error
func SocketPath ¶
Types ¶
type AppIDEvent ¶
func (AppIDEvent) Name ¶
func (AppIDEvent) Name() string
type Barrier ¶
type Bind ¶
type BindsEvent ¶
type BindsEvent struct {
Binds []Bind `json:"binds"`
}
func (BindsEvent) Name ¶
func (BindsEvent) Name() string
type Capability ¶
type Capability string
const ( CapKeyboard Capability = "keyboard" CapPointer Capability = "pointer" CapTouch Capability = "touch" CapTablet Capability = "tablet" CapTabletPad Capability = "tablet_pad" )
type CaptureActivatedEvent ¶
type CaptureActivatedEvent struct {
Activation uint32 `json:"activation"`
At wmipc.CapturePoint `json:"at"`
Barrier BarrierID `json:"barrier"`
}
func (CaptureActivatedEvent) Name ¶
func (CaptureActivatedEvent) Name() string
type CaptureAppliedEvent ¶
type CaptureAppliedEvent struct{}
func (CaptureAppliedEvent) Name ¶
func (CaptureAppliedEvent) Name() string
type CaptureButtonEvent ¶
func (CaptureButtonEvent) Name ¶
func (CaptureButtonEvent) Name() string
type CaptureCommand ¶
type CaptureCommand interface {
// contains filtered or unexported methods
}
type CaptureConn ¶
type CaptureConn struct {
// contains filtered or unexported fields
}
func OpenCapture ¶
func OpenCapture(path string) (*CaptureConn, error)
func (*CaptureConn) Close ¶
func (c *CaptureConn) Close() error
func (*CaptureConn) Next ¶
func (c *CaptureConn) Next() ([]byte, error)
func (*CaptureConn) Send ¶
func (c *CaptureConn) Send(cmd CaptureCommand) error
type CaptureDeactivatedEvent ¶
type CaptureDeactivatedEvent struct {
Activation uint32 `json:"activation"`
At wmipc.CapturePoint `json:"at"`
}
func (CaptureDeactivatedEvent) Name ¶
func (CaptureDeactivatedEvent) Name() string
type CaptureDisabledEvent ¶
type CaptureDisabledEvent struct{}
func (CaptureDisabledEvent) Name ¶
func (CaptureDisabledEvent) Name() string
type CaptureErrorEvent ¶
type CaptureErrorEvent struct {
Error string `json:"error"`
}
func (CaptureErrorEvent) Name ¶
func (CaptureErrorEvent) Name() string
type CaptureFrameEvent ¶
type CaptureFrameEvent struct{}
func (CaptureFrameEvent) Name ¶
func (CaptureFrameEvent) Name() string
type CaptureKeyEvent ¶
func (CaptureKeyEvent) Name ¶
func (CaptureKeyEvent) Name() string
type CaptureKeymapEvent ¶
type CaptureKeymapEvent struct {
Keymap string `json:"keymap"`
}
func (CaptureKeymapEvent) Name ¶
func (CaptureKeymapEvent) Name() string
type CaptureModifiersEvent ¶
type CaptureModifiersEvent struct {
Depressed uint32 `json:"depressed"`
Latched uint32 `json:"latched"`
Locked uint32 `json:"locked"`
Group uint32 `json:"group"`
}
func (CaptureModifiersEvent) Name ¶
func (CaptureModifiersEvent) Name() string
type CaptureMotionEvent ¶
func (CaptureMotionEvent) Name ¶
func (CaptureMotionEvent) Name() string
type CaptureScrollDiscreteEvent ¶
func (CaptureScrollDiscreteEvent) Name ¶
func (CaptureScrollDiscreteEvent) Name() string
type CaptureScrollEvent ¶
func (CaptureScrollEvent) Name ¶
func (CaptureScrollEvent) Name() string
type CaptureScrollStopEvent ¶
func (CaptureScrollStopEvent) Name ¶
func (CaptureScrollStopEvent) Name() string
type CaptureSession ¶
type CaptureSession interface {
Apply(cmd CaptureCommand) error
Close() error
}
type CastTarget ¶
type CastTargetEvent ¶
type CastTargetEvent struct {
Target CastTarget `json:"target"`
}
func (CastTargetEvent) Name ¶
func (CastTargetEvent) Name() string
type CloseEvent ¶
func (CloseEvent) Name ¶
func (CloseEvent) Name() string
type ConfigProblems ¶
type ConfigProblemsEvent ¶
type ConfigProblemsEvent struct {
ConfigProblems
}
func (ConfigProblemsEvent) Name ¶
func (ConfigProblemsEvent) Name() string
type CreatedOutput ¶
type CreatedOutput struct {
Name string `json:"name"`
}
type Device ¶
type Device struct {
Name string `json:"name"`
Capabilities []Capability `json:"capabilities"`
Layout *wmipc.Layout `json:"layout,omitempty"`
}
type DisableCapture ¶
type DisableCapture struct{}
type DispatchEvent ¶
type DispatchEvent struct {
Action string `json:"action"`
}
func (DispatchEvent) Name ¶
func (DispatchEvent) Name() string
type EnableCapture ¶
type EnableCapture struct{}
type FocusEvent ¶
func (FocusEvent) Name ¶
func (FocusEvent) Name() string
type FocusedOutputEvent ¶
type FocusedOutputEvent struct {
Output string `json:"output"`
}
func (FocusedOutputEvent) Name ¶
func (FocusedOutputEvent) Name() string
type GroupEvent ¶
func (GroupEvent) Name ¶
func (GroupEvent) Name() string
type Handler ¶
type Handler interface {
Snapshot() Snapshot
DispatchPrepared(a wm.Action, loaded func() error) error
PrepareDispatch(a wm.Action) func() error
Icon(w wm.WindowID, size int) (*image.RGBA, int, error)
CreateOutput(spec OutputSpec) (CreatedOutput, error)
RemoveOutput(name string) error
Capture(send func(Event)) (CaptureSession, error)
PickWindow(answer func(*wm.WindowID, error)) (cancel func(), err error)
}
type KeyboardInteractivity ¶
type KeyboardInteractivity string
const ( KeyboardNone KeyboardInteractivity = "none" KeyboardExclusive KeyboardInteractivity = "exclusive" KeyboardOnDemand KeyboardInteractivity = "on_demand" )
type Layer ¶
type Layer struct {
ID uint64 `json:"id"`
Namespace string `json:"namespace"`
Layer LayerLevel `json:"layer"`
Output string `json:"output"`
Rect wmipc.Rect `json:"rect"`
Keyboard KeyboardInteractivity `json:"keyboard_interactivity"`
}
type LayerChange ¶
type LayerChange string
const ( LayerOpened LayerChange = "open" LayerClosed LayerChange = "close" )
type LayerEvent ¶
type LayerEvent struct {
Change LayerChange `json:"change"`
ID uint64 `json:"id"`
Namespace string `json:"namespace"`
Output string `json:"output"`
Layer LayerLevel `json:"layer"`
}
func (LayerEvent) Name ¶
func (LayerEvent) Name() string
type LayerLevel ¶
type LayerLevel string
const ( LayerBackground LayerLevel = "background" LayerBottom LayerLevel = "bottom" LayerTop LayerLevel = "top" LayerOverlay LayerLevel = "overlay" )
type LayoutEvent ¶
func (LayoutEvent) Name ¶
func (LayoutEvent) Name() string
type LocksEvent ¶
func (LocksEvent) Name ¶
func (LocksEvent) Name() string
type MinimizedEvent ¶
func (MinimizedEvent) Name ¶
func (MinimizedEvent) Name() string
type ModeEvent ¶
type MoveEvent ¶
type MoveEvent struct {
Window wm.WindowID `json:"window"`
Workspace wm.WorkspaceID `json:"workspace"`
}
type Output ¶
type Output struct {
Name string `json:"name"`
Description string `json:"description"`
Rect wmipc.Rect `json:"rect"`
Scale float64 `json:"scale"`
Mode wmipc.Mode `json:"mode"`
Workspace wm.WorkspaceID `json:"workspace"`
Focused bool `json:"focused"`
Powered bool `json:"powered"`
Shader string `json:"shader,omitempty"`
ShaderError string `json:"shader_error,omitempty"`
HDR bool `json:"hdr,omitempty"`
Zoom float64 `json:"zoom,omitempty"`
Transform string `json:"transform,omitempty"`
MirrorOf string `json:"mirror_of,omitempty"`
}
type OutputChange ¶
type OutputChange string
const ( OutputAdded OutputChange = "added" OutputRemoved OutputChange = "removed" OutputChanged OutputChange = "changed" )
type OutputEvent ¶
type OutputEvent struct {
Change OutputChange `json:"change"`
Output Output `json:"output"`
}
func (OutputEvent) Name ¶
func (OutputEvent) Name() string
type OutputSpec ¶
type OverviewEvent ¶
type OverviewEvent struct {
Open bool `json:"open"`
}
func (OverviewEvent) Name ¶
func (OverviewEvent) Name() string
type RectEvent ¶
type ReducedMotionEvent ¶
type ReducedMotionEvent struct {
ReducedMotion bool `json:"reduced_motion"`
}
func (ReducedMotionEvent) Name ¶
func (ReducedMotionEvent) Name() string
type ReleaseCapture ¶
type ReleaseCapture struct{ At *wmipc.CapturePoint }
type Request ¶
type Request struct {
Request wmipc.Kind `json:"request"`
Action string `json:"action,omitempty"`
Actions []string `json:"actions,omitempty"`
Snapshot bool `json:"snapshot,omitempty"`
Window wm.WindowID `json:"window,omitempty"`
Size int `json:"size,omitempty"`
Binary string `json:"binary,omitempty"`
DropX11 bool `json:"drop_x11,omitempty"`
Name string `json:"name,omitempty"`
Mode *wmipc.Mode `json:"mode,omitempty"`
Scale float64 `json:"scale,omitempty"`
}
type Scratchpad ¶
type Scratchpad struct {
Name wm.ScratchpadName `json:"name"`
Output string `json:"output"`
Shown bool `json:"shown"`
Windows int `json:"windows"`
}
type ScratchpadEvent ¶
type ScratchpadEvent struct {
Scratchpad
}
func (ScratchpadEvent) Name ¶
func (ScratchpadEvent) Name() string
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Dispatched ¶
func (*Server) PauseAccept ¶
func (*Server) ResumeAccept ¶
type SetBarriers ¶
type SetBarriers struct{ Barriers []Barrier }
type ShowDesktopEvent ¶
func (ShowDesktopEvent) Name ¶
func (ShowDesktopEvent) Name() string
type Snapshot ¶
type Snapshot struct {
Outputs []Output
Workspaces []Workspace
Scratchpads []Scratchpad
ShowDesktop []string
Windows []Window
Layers []Layer
CastTarget CastTarget
Devices []Device
Binds []Bind
MRU []wm.WindowID
Switcher *Switcher
Submap string
Layout wmipc.Layout
Locks wmipc.Locks
ReducedMotion bool
Overview bool
ConfigProblems ConfigProblems
}
type StackEvent ¶
func (StackEvent) Name ¶
func (StackEvent) Name() string
type SubmapEvent ¶
type SubmapEvent struct {
Submap string `json:"submap"`
}
func (SubmapEvent) Name ¶
func (SubmapEvent) Name() string
type SwallowEvent ¶
type SwallowEvent struct {
Window wm.WindowID `json:"window"`
SwallowedBy wm.WindowID `json:"swallowed_by"`
}
func (SwallowEvent) Name ¶
func (SwallowEvent) Name() string
type SwitcherEvent ¶
type SwitcherEvent struct {
Open bool `json:"open"`
Selected *wm.WindowID `json:"selected"`
Title string `json:"title"`
}
func (SwitcherEvent) Name ¶
func (SwitcherEvent) Name() string
type TitleEvent ¶
func (TitleEvent) Name ¶
func (TitleEvent) Name() string
type UnresponsiveEvent ¶
type UnresponsiveEvent struct {
Window wm.WindowID `json:"window"`
Unresponsive bool `json:"unresponsive"`
}
func (UnresponsiveEvent) Name ¶
func (UnresponsiveEvent) Name() string
type UpgradeResult ¶
type UrgentEvent ¶
func (UrgentEvent) Name ¶
func (UrgentEvent) Name() string
type Window ¶
type Window struct {
ID wm.WindowID `json:"id"`
AppID string `json:"app_id"`
Title string `json:"title"`
PID int32 `json:"pid"`
Workspace wm.WorkspaceID `json:"workspace"`
Scratchpad wm.ScratchpadName `json:"scratchpad,omitempty"`
Output string `json:"output"`
Rect wmipc.Rect `json:"rect"`
Floating bool `json:"floating"`
Fullscreen bool `json:"fullscreen"`
Maximized bool `json:"maximized"`
ClientFull bool `json:"client_fullscreen"`
Pinned bool `json:"pinned"`
Minimized bool `json:"minimized"`
Urgent bool `json:"urgent"`
Unresponsive bool `json:"unresponsive"`
Focused bool `json:"focused"`
InhibitsKeys bool `json:"inhibits_shortcuts"`
ContentType wm.ContentType `json:"content_type"`
ContentSource wm.ContentSource `json:"content_source"`
Icon *Icon `json:"icon"`
Stack *int `json:"stack,omitempty"`
SwallowedBy wm.WindowID `json:"swallowed_by,omitempty"`
FocusTimestamp uint64 `json:"focus_timestamp"`
Group *Group `json:"group"`
}
type WindowMenuEvent ¶
type WindowMenuEvent struct {
Window wm.WindowID `json:"window"`
X int `json:"x"`
Y int `json:"y"`
}
func (WindowMenuEvent) Name ¶
func (WindowMenuEvent) Name() string
type WorkspaceEvent ¶
type WorkspaceEvent struct {
Output string `json:"output"`
Workspace wm.WorkspaceID `json:"workspace"`
}
func (WorkspaceEvent) Name ¶
func (WorkspaceEvent) Name() string
Click to show internal directories.
Click to hide internal directories.