Documentation
¶
Overview ¶
Package hypr gives the shared Chrome window a drawn surface for a browse turn under Hyprland and puts it back after: Chrome draws nothing in a window the compositor does not show (on a workspace not shown, under a special workspace shown over its own, behind the front window of a monocle workspace), and a turn's draw checks, screenshots and clicks fail there. The surface is a headless output of its own, placed where no edge touches the person's monitors: the window is drawn there and never appears on the person's screen, and their monitors, workspaces and focus stay as they are. It never changes Hyprland's configuration files: the output's monitor and workspace rules are set at runtime only.
Index ¶
Constants ¶
const ( Output = "BEEKEEPER-BROWSE" Surface = "beekeeper-browse" )
Output is the headless output a turn draws the window on, and Surface its workspace: named, so the person's workspace numbers stay theirs.
Variables ¶
var Size = [2]int{1280, 800}
Size is the output's mode: big enough for a page's screenshot.
Functions ¶
Types ¶
type Monitor ¶
type Monitor struct {
ID int `json:"id"`
Name string `json:"name"`
X int `json:"x"`
Y int `json:"y"`
Width int `json:"width"`
Height int `json:"height"`
ActiveWorkspace Workspace `json:"activeWorkspace"`
SpecialWorkspace Workspace `json:"specialWorkspace"`
Focused bool `json:"focused"`
}
Monitor is a monitor as hyprctl monitors names it: X and Y in layout coordinates, Width and Height in pixels.
type Shown ¶
type Shown struct {
// Before is the window as it was; Where says where that was.
Before Window `json:"before"`
Where string `json:"where"`
// Created says the placement created the output, which Restore removes.
Created bool `json:"created"`
// Left says why Restore left the window where it was: closed, or moved
// by the person to another workspace; "" when it put it back.
Left string `json:"left,omitempty"`
}
Shown is a window a placement moved onto the headless output, with what it was before. It is kept as JSON while the turn runs, so a browse that died mid-turn still puts the window back.
func Show ¶
Show moves Chrome's browser window onto the headless output when the compositor does not show it, creating the output when there is none: drawn there, never on the person's screen, the focus left where it is. An output that changed the person's view (their monitors' place, shown workspaces or focus) or took a numbered workspace is removed again and the window left where it is. It returns nil when there is no browser window or it is shown already; a step that fails is undone and its error names where the window is.
func (*Shown) Restore ¶
Restore puts the window back on its own workspace, and any other window on the output's workspace with it (one the turn opened); then it removes the output, unless a window failed to move off it, which removing the output would put on the person's screen. One closed since, or moved by the person to a third workspace, is left where it is, and Left says so.
type Window ¶
type Window struct {
Address string `json:"address"`
Class string `json:"class"`
Workspace Workspace `json:"workspace"`
Floating bool `json:"floating"`
Fullscreen int `json:"fullscreen"`
Monitor int `json:"monitor"`
FocusHistoryID int `json:"focusHistoryID"`
}
Window is a client as hyprctl clients names it.