wlcursor

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package wlcursor reads the global pointer position on Wayland through compositor-specific IPC, since no Wayland protocol or portal exposes it: Hyprland's request socket (cursorpos) and KWin's scripting D-Bus API (workspace.cursorPos). Coordinates are global logical layout coordinates.

Index

Constants

View Source
const Backoff = 10 * time.Second

Backoff is how long the KWin query is skipped after it fails, so a broken session does not cost Timeout on every call.

View Source
const Timeout = 2 * time.Second

Timeout bounds one position query.

Variables

View Source
var ErrUnavailable = errors.New("wlcursor: compositor does not expose the cursor position")

ErrUnavailable is returned when the running compositor offers no cursor position query (GNOME, Sway and other wlroots compositors).

Functions

func Position

func Position() (int, int, error)

Position returns the global pointer position from the running compositor.

Types

This section is empty.

Jump to

Keyboard shortcuts

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