idle

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 8 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 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

func Since() (time.Duration, bool, bool)

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.

Jump to

Keyboard shortcuts

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