Documentation ¶
Overview ¶
Package hypripc provides an API for interacting with the Hyprland IPC bus
Index ¶
- Constants
- type CancelFunc
- type Client
- type Event
- type HyprIPC
- func (h *HyprIPC) ActiveWindow() (*Client, error)
- func (h *HyprIPC) ActiveWorkspace() (*Workspace, error)
- func (h *HyprIPC) Clients() ([]Client, error)
- func (h *HyprIPC) Close()
- func (h *HyprIPC) Dispatch(args ...string) error
- func (h *HyprIPC) Monitors() ([]Monitor, error)
- func (h *HyprIPC) StartEvents()
- func (h *HyprIPC) Subscribe(evt ...Event) (chan *eventv1.Event, CancelFunc)
- func (h *HyprIPC) Workspaces() ([]Workspace, error)
- type Monitor
- type Workspace
Constants ¶
View Source
const ( // EventUnspecified is the default catch-all event. EventUnspecified = `unspecified` // EventWorkspace event identifier. EventWorkspace = `workspace` // EventWorkspaceV2 event identifier. EventWorkspaceV2 = `workspacev2` // EventFocusedMon event identifier. EventFocusedMon = `focusedmon` // EventActiveWindow event identifier. EventActiveWindow = `activewindow` // EventActiveWindowV2 event identifier. EventActiveWindowV2 = `activewindowv2` // EventFullscreen event identifier. EventFullscreen = `fullscreen` // EventMonitorRemoved event identifier. EventMonitorRemoved = `monitorremoved` // EventMonitorAdded event identifier. EventMonitorAdded = `monitoradded` // EventCreateWorkspace event identifier. EventCreateWorkspace = `createworkspace` // EventCreateWorkspaceV2 event identifier. EventCreateWorkspaceV2 = `createworkspacev2` // EventDestroyWorkspace event identifier. EventDestroyWorkspace = `destroyworkspace` // EventDestroyWorkspaceV2 event identifier. EventDestroyWorkspaceV2 = `destroyworkspacev2` // EventMoveWorkspace event identifier. EventMoveWorkspace = `moveworkspace` // EventMoveWorkspaceV2 event identifier. EventMoveWorkspaceV2 = `moveworkspacev2` // EventRenameWorkspace event identifier. EventRenameWorkspace = `renameworkspace` // EventActiveSpecial event identifier. EventActiveSpecial = `activespecial` // EventActiveLayout event identifier. EventActiveLayout = `activelayout` // EventOpenWindow event identifier. EventOpenWindow = `openwindow` // EventCloseWindow event identifier. EventCloseWindow = `closewindow` // EventMoveWindow event identifier. EventMoveWindow = `movewindow` // EventMoveWindowV2 event identifier. EventMoveWindowV2 = `movewindowv2` // EventOpenLayer event identifier. EventOpenLayer = `openlayer` // EventCloseLayer event identifier. EventCloseLayer = `closelayer` // EventSubmap event identifier. EventSubmap = `submap` // EventChangeFloatingMode event identifier. EventChangeFloatingMode = `changefloatingmode` // EventUrgent event identifier. EventUrgent = `urgent` // EventMinimize event identifier. EventMinimize = `minimize` // EventScreencast event identifier. EventScreencast = `screencast` // EventWindowTitle event identifier. EventWindowTitle = `windowtitle` // EventIgnoreGroupLock event identifier. EventIgnoreGroupLock = `ignoregrouplock` // EventLockGroups event identifier. EventLockGroups = `lockgroups` // DispatchWorkspace dispatcher identifier. DispatchWorkspace = `workspace` // DispatchFocusWindow dispatcher identifier. DispatchFocusWindow = `focuswindow` // DispatchCloseWindow dispatcher identifier. DispatchCloseWindow = `closewindow` )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Address string `json:"address"` Mapped bool `json:"mapped"` Hidden bool `json:"hidden"` At []int `json:"at"` Size []int `json:"size"` Workspace struct { ID int `json:"id"` Name string `json:"name"` } `json:"workspace"` Floating bool `json:"floating"` Monitor int `json:"monitor"` Class string `json:"class"` Title string `json:"title"` InitialClass string `json:"initialClass"` InitialTitle string `json:"initialTitle"` Pid int64 `json:"pid"` Xwayland bool `json:"xwayland"` Pinned bool `json:"pinned"` Fullscreen bool `json:"fullscreen"` FullscreenMode int `json:"fullscreenMode"` FakeFullscreen bool `json:"fakeFullscreen"` Grouped []interface{} `json:"grouped"` Swallowing string `json:"swallowing"` FocusHistoryID int `json:"focusHistoryID"` }
Client window container.
type HyprIPC ¶
type HyprIPC struct {
// contains filtered or unexported fields
}
HyprIPC client.
func (*HyprIPC) ActiveWindow ¶
ActiveWindow returns the currently active window client.
func (*HyprIPC) ActiveWorkspace ¶
ActiveWorkspace returns the currently actie workspace.
func (*HyprIPC) Close ¶
func (h *HyprIPC) Close()
Close terminates all connections, event loops, and closes all subscriptions.
func (*HyprIPC) Subscribe ¶
func (h *HyprIPC) Subscribe(evt ...Event) (chan *eventv1.Event, CancelFunc)
Subscribe returns a channel that will emit the specified event(s) when they arrive.
func (*HyprIPC) Workspaces ¶
Workspaces returns a list of all active workspaces.
type Monitor ¶
type Monitor struct { ID int `json:"id"` Name string `json:"name"` Description string `json:"description"` Make string `json:"make"` Model string `json:"model"` Serial string `json:"serial"` Width int `json:"width"` Height int `json:"height"` RefreshRate float64 `json:"refreshRate"` X int `json:"x"` Y int `json:"y"` ActiveWorkspace struct { ID int `json:"id"` Name string `json:"name"` } `json:"activeWorkspace"` SpecialWorkspace struct { ID int `json:"id"` Name string `json:"name"` } `json:"specialWorkspace"` Reserved []int `json:"reserved"` Scale float64 `json:"scale"` Transform int `json:"transform"` Focused bool `json:"focused"` DpmsStatus bool `json:"dpmsStatus"` Vrr bool `json:"vrr"` ActivelyTearing bool `json:"activelyTearing"` }
Monitor container.
type Workspace ¶
type Workspace struct { ID int `json:"id"` Name string `json:"name"` Monitor string `json:"monitor"` MonitorID int `json:"monitorID"` Windows int `json:"windows"` Hasfullscreen bool `json:"hasfullscreen"` Lastwindow string `json:"lastwindow"` Lastwindowtitle string `json:"lastwindowtitle"` }
Workspace container.
Click to show internal directories.
Click to hide internal directories.