Documentation
¶
Overview ¶
Package idle answers how long this computer has gone without keyboard or mouse input, in any application, and whether its screen is locked -- the two facts the push loop needs to tell that somebody is actually at the desk, rather than merely that a Flockdeck window is in front of them.
Flockdeck is one binary built with CGO_ENABLED=0 for every platform. On Windows Since is read through the plain syscall package, in keeping with internal/session/usage_windows.go. On Linux and macOS there is no such call available without cgo, so it is read by running a short-lived command, under probeTimeout, and parsing what it says. Since is meant to be asked only when a push is actually due, not on every tick of the wait loop.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Since ¶
Since tries, in order, the first of these that answers:
- GNOME Mutter's own idle monitor, over its session D-Bus interface -- present on a stock GNOME desktop with nothing extra installed;
- xprintidle, an X11 tool some other desktops carry;
- logind, which does not read the idle time itself but exposes a hint of it once the compositor has told it the session is idle, and says whether the session is locked.
The first that answers is taken whole, rather than mixing readings from two of them. logind answers only when it says the session is locked or idle; otherwise, as for an SSH session, there is no answer, and the push loop falls back to input seen in Flockdeck's own windows.
Types ¶
This section is empty.