Documentation ¶
Index ¶
- func ActiveOutputsNum(outputs []Output) float64
- func CurrentOutputNum(workspaceNum float64, outputsNum float64) float64
- func CurrentWorkspaceNum(workspaces []Workspace) float64
- func MaxWorkspaceNum(workspaces []Workspace) float64
- func MoveToWorkspace(workspace float64) error
- func MoveWorkspaceToOutput(workspaceNum float64, outputName string) error
- func SwitchToWorkspace(workspace float64) error
- type Output
- type Rect
- type Workspace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActiveOutputsNum ¶
ActiveOutputsNum counts the number of active outputs in the given slice of Outputs. This could be, but is unlikely to be 0.
func CurrentOutputNum ¶
CurrentOutputNum calculates the current "display number" that i3x3 uses internally based on the workspace number, and the number of outputs. We avoid trying to figure out the physical layout of displays because that will be both complicated, and error prone. This method works best if your only method of navigating workspaces is by using i3x3.
func CurrentWorkspaceNum ¶
CurrentWorkspaceNum gets the currently focused workspace number from the given workspaces.
func MaxWorkspaceNum ¶
MaxWorkspaceNum finds the workspace with the highest number in the given slice of workspaces.
func MoveToWorkspace ¶
MoveToWorkspace tells i3 to move the current container to the given workspace. It does not also switch to the workspace. Any error running the i3-msg command will be returned.
func MoveWorkspaceToOutput ¶
MoveWorkspaceToOutput takes a given workspace, and moves it to the given output (used for re-arranging workspaces on differing numbers of outputs).
func SwitchToWorkspace ¶
SwitchToWorkspace tells i3 to switch to the given workspace. Any error running the i3-msg command will be returned.
Types ¶
type Output ¶
type Output struct { Name string `json:"name"` Active bool `json:"active"` Primary bool `json:"primary"` Rect Rect `json:"rect"` CurrentWorkspace string `json:"current_workspace"` }
Output represents an i3 output (i.e. a display).
func ActiveOutputs ¶
ActiveOutputs returns the active outputs in the given slice of Outputs. This could be, but is unlikely to be empty.
func FindOutputs ¶
FindOutputs fetches an array of outputs from i3 via i3-msg. This will return all outputs, not just the active ones.
type Rect ¶
type Rect struct { X int `json:"x"` Y int `json:"y"` Width int `json:"width"` Height int `json:"height"` }
Rect represents a generic rectangular shape.
type Workspace ¶
type Workspace struct { Num int `json:"num"` Name string `json:"name"` Visible bool `json:"visible"` Focused bool `json:"focused"` Rect Rect `json:"rect"` Output string `json:"output"` Urgent bool `json:"urgent"` }
Workspace represents an i3 workspace.
func FindWorkspaces ¶
FindWorkspaces fetches an array of workspaces from i3 via i3-msg. This will return all workspaces, not just the visible ones, or focused ones.