Documentation
¶
Overview ¶
Package idle reports how long it has been since the user last touched the keyboard or mouse.
It is pure Go (no cgo) and supports:
- macOS: CoreGraphics via purego, falling back to parsing ioreg.
- Windows: GetLastInputInfo.
- Linux: the X11 MIT-SCREEN-SAVER extension, GNOME's Mutter IdleMonitor and systemd-logind's IdleSinceHint, whichever works for the current session.
Idle time is a property of an interactive desktop session. Processes that are not part of one (SSH sessions, system services, containers, headless servers) get an error wrapping ErrUnsupported, never a made-up zero.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupported = errors.New("idle: idle time is not available in this environment")
ErrUnsupported is returned (wrapped) when idle time cannot be determined in the current environment, for example on a headless machine or on a Wayland compositor that does not expose it. Use errors.Is to test for it.
Functions ¶
Types ¶
This section is empty.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.
