wayland

package
v0.99.2 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller wraps the existing WaylandClient to implement the display.DisplayController interface

func (*Controller) CaptureScreen

func (c *Controller) CaptureScreen(ctx context.Context, region *display.Region) (image.Image, error)

CaptureScreen captures a screenshot and returns an image.Image

func (*Controller) CaptureScreenBytes

func (c *Controller) CaptureScreenBytes(ctx context.Context, region *display.Region) ([]byte, error)

CaptureScreenBytes captures a screenshot and returns PNG bytes

func (*Controller) ClickMouse

func (c *Controller) ClickMouse(ctx context.Context, button display.MouseButton, clicks int) error

ClickMouse clicks the specified mouse button

func (*Controller) Close

func (c *Controller) Close() error

Close closes the Wayland client

func (*Controller) GetCursorPosition

func (c *Controller) GetCursorPosition(ctx context.Context) (x, y int, err error)

GetCursorPosition returns the current cursor position Note: Wayland doesn't provide a standard way to get cursor position

func (*Controller) GetScreenDimensions

func (c *Controller) GetScreenDimensions(ctx context.Context) (width, height int, err error)

GetScreenDimensions returns the screen width and height

func (*Controller) MoveMouse

func (c *Controller) MoveMouse(ctx context.Context, x, y int) error

MoveMouse moves the cursor to the specified coordinates

func (*Controller) ScrollMouse

func (c *Controller) ScrollMouse(ctx context.Context, clicks int, direction string) error

ScrollMouse scrolls the mouse wheel

func (*Controller) SendKeyCombo

func (c *Controller) SendKeyCombo(ctx context.Context, combo string) error

SendKeyCombo sends a key combination (e.g., "ctrl+c")

func (*Controller) TypeText

func (c *Controller) TypeText(ctx context.Context, text string, delayMs int) error

TypeText types the given text with the specified delay between keystrokes

type Provider

type Provider struct{}

Provider implements the display.Provider interface for Wayland

func NewProvider

func NewProvider() *Provider

NewProvider creates a new Wayland provider

func (*Provider) GetController

func (p *Provider) GetController() (display.DisplayController, error)

GetController creates a new DisplayController (auto-detects display from $WAYLAND_DISPLAY env var)

func (*Provider) GetDisplayInfo

func (p *Provider) GetDisplayInfo() display.DisplayInfo

GetDisplayInfo returns information about the Wayland platform

func (*Provider) IsAvailable

func (p *Provider) IsAvailable() bool

IsAvailable returns true if Wayland is available on the current system

type WaylandClient

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

WaylandClient provides Wayland screen control operations using command-line tools

func NewWaylandClient

func NewWaylandClient(display string) (*WaylandClient, error)

NewWaylandClient creates a new Wayland client

func (*WaylandClient) CaptureScreenBytes

func (c *WaylandClient) CaptureScreenBytes(x, y, width, height int) ([]byte, error)

CaptureScreenBytes captures a screenshot and returns it as PNG bytes

func (*WaylandClient) ClickMouse

func (c *WaylandClient) ClickMouse(button string, clicks int) error

ClickMouse performs a mouse click at the current cursor position

func (*WaylandClient) Close

func (c *WaylandClient) Close()

Close closes the Wayland client (no-op for command-line tools)

func (*WaylandClient) GetScreenDimensions

func (c *WaylandClient) GetScreenDimensions() (int, int, error)

GetScreenDimensions returns the screen width and height

func (*WaylandClient) MoveMouse

func (c *WaylandClient) MoveMouse(x, y int) error

MoveMouse moves the cursor to the specified absolute coordinates

func (*WaylandClient) ScrollMouse

func (c *WaylandClient) ScrollMouse(clicks int, direction string) error

ScrollMouse scrolls the mouse wheel

func (*WaylandClient) SendKeyCombo

func (c *WaylandClient) SendKeyCombo(combo string) error

SendKeyCombo sends a key combination (e.g., "ctrl+c")

func (*WaylandClient) TypeText

func (c *WaylandClient) TypeText(text string, delayMs int) error

TypeText types the given text with a configurable delay between keystrokes (in milliseconds)

Jump to

Keyboard shortcuts

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