tiling

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateGrid

func CalculateGrid(numWindows int) (rows, cols int)

CalculateGrid determines the optimal grid dimensions for the given number of windows

Types

type Rect

type Rect struct {
	X      int
	Y      int
	Width  int
	Height int
}

Rect represents a window position and size

func ApplyRegion

func ApplyRegion(monitor Rect, region config.TileRegion) Rect

ApplyRegion applies the tile region to a monitor, returning adjusted bounds

func CalculatePositions

func CalculatePositions(numWindows int, monitor Rect, gapSize int) []Rect

CalculatePositions computes window positions for a grid layout with gaps

func CalculatePositionsWithLayout

func CalculatePositionsWithLayout(
	numWindows int,
	monitor Rect,
	layout *config.Layout,
	gapSize int,
) ([]Rect, error)

CalculatePositionsWithLayout computes window positions using layout configuration

type Tiler

type Tiler struct {
	// contains filtered or unexported fields
}

Tiler manages the tiling state across monitors

func NewTiler

func NewTiler(backend platform.Backend, detector *terminals.Detector, cfg *config.Config) *Tiler

NewTiler creates a new tiler instance

func (*Tiler) CycleActiveLayout

func (t *Tiler) CycleActiveLayout(delta int) (string, error)

CycleActiveLayout moves to the next/previous layout in sorted order.

func (*Tiler) GetActiveLayoutName

func (t *Tiler) GetActiveLayoutName() string

GetActiveLayoutName returns the current active layout name.

func (*Tiler) GetTerminalCount

func (t *Tiler) GetTerminalCount(monitorID int) int

GetTerminalCount returns the last known terminal count for a monitor.

func (*Tiler) GetWorkspace

func (t *Tiler) GetWorkspace(monitorID int) *Workspace

GetWorkspace returns a copy of the workspace for a given monitor ID.

func (*Tiler) PreviewLayout

func (t *Tiler) PreviewLayout(layoutName string, duration time.Duration) error

PreviewLayout temporarily applies a layout and restores previous geometry after a duration.

func (*Tiler) SetActiveLayout

func (t *Tiler) SetActiveLayout(name string) error

SetActiveLayout sets the current active layout (used by TileCurrentMonitor).

func (*Tiler) TileCurrentMonitor

func (t *Tiler) TileCurrentMonitor() error

TileCurrentMonitor tiles all terminals on the currently active monitor

func (*Tiler) TileWithOrder

func (t *Tiler) TileWithOrder(windowOrder []uint32) error

TileWithOrder tiles terminals using a specific window order instead of sorting by position. This is used by workspace load to ensure windows end up in the correct slots.

func (*Tiler) UndoCurrentMonitor

func (t *Tiler) UndoCurrentMonitor() error

UndoCurrentMonitor restores terminal windows to the geometry captured before the last tiling operation.

func (*Tiler) UpdateConfig

func (t *Tiler) UpdateConfig(cfg *config.Config)

UpdateConfig updates the tiler's configuration

type Workspace

type Workspace struct {
	MonitorID          int
	Terminals          []terminals.TerminalWindow
	LastTiledAt        time.Time
	PreviousGeometries map[platform.WindowID]Rect
}

Workspace tracks the tiling state for a monitor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL