Skip to content

Idle ​

[idle] runs commands after a stretch without keyboard or pointer input. Each command is a listener with its own timeout, and you keep one set of listeners for AC power and another for battery.

[idle]
enabledboolean default true

Whether the idle timers run at all.

Your idle actions while plugged in and while on battery.

Its settings are listed under [idle.profiles].

respect-inhibitorsboolean default true

Pause idle timers while an app keeps your screen awake, such as during a video. Each listener can override this.

[idle.profiles]
actable

The listeners used on AC power.

Its settings are listed under [idle.profiles.ac].

batterytable

The listeners used on battery.

Its settings are listed under [idle.profiles.battery].

[idle.profiles.ac]
listenerslist of tables

The actions you run after a period without input. Setting this list replaces the default actions.

Its settings are listed under [[idle.profiles.ac.listeners]].

[[idle.profiles.ac.listeners]]
on-idlestring default ""

The shell command run when the timeout passes, e.g. loginctl lock-session.

on-resumestring default ""

The shell command run on the next input after on-idle ran. Empty runs nothing.

respect-inhibitorsbooleannot set by default

Overrides [idle] respect-inhibitors for this listener.

timeoutinteger default 0

Seconds without input before on-idle runs. 0 disables the listener.

[idle.profiles.battery] takes the same settings as [idle.profiles.ac].

Default listeners ​

ProfileAfterRunsOn input
AC15 minutesglimpse-dpms offglimpse-dpms on
AC30 minutesloginctl lock-session
AC60 minutessystemctl suspend
Battery15 minutesglimpse-dpms offglimpse-dpms on
Battery30 minutessystemctl suspend

A profile can't have two listeners with the same timeout, and on-idle can't be empty. glimpsectl config validate reports both. For these problems, a running glimpse-idle logs a warning and applies the file anyway. Set timeout = 0 to turn a listener off.

on-idle and on-resume run with /bin/sh -c in glimpse-idle's own environment. Commands for one listener run one at a time without blocking other listeners. A failed command is only logged.

glimpse-dpms turns the screens off and on, and supports niri and Hyprland only. It needs NIRI_SOCKET or HYPRLAND_INSTANCE_SIGNATURE in its environment and exits 1 when neither is set. With no off or on argument, it prints usage and exits 2. loginctl lock-session locks the screen.

For syntax errors and a file that was already broken at startup, see When something is wrong.

Writing listeners for a profile replaces that profile's defaults, so list every listener you want:

toml
[[idle.profiles.battery.listeners]]
timeout = 300
on-idle = "glimpse-dpms off"
on-resume = "glimpse-dpms on"

[[idle.profiles.battery.listeners]]
timeout = 600
on-idle = "systemctl suspend"

Hold idle and suspend ​

Apps that play video or hold a call keep the timers from firing while respect-inhibitors is on. A listener whose timeout passes during a hold waits. When the last hold ends, every waiting listener fires at once if you are still idle. Listeners with respect-inhibitors = false still fire during a hold.

glimpsectl idle inhibit creates a manual hold that blocks both idle and suspend. It needs logind; Idle1.Hold fails without it. The registry allows 32 holds per source and 128 in total.

Without a command, inhibit prints the hold's id first; --json prints {"id": 7} instead. End the hold with Ctrl-C, --for, or glimpsectl idle release <id>. Durations are whole positive numbers with an optional s, m, or h suffix, such as 90, 90s, 15m, or 2h. 0, 1d, and 1.5h are refused with exit 2.

glimpsectl idle inhibit -- CMD... holds only while CMD runs and exits with the command's status. glimpsectl idle release <id> can release a manual hold or an app's screen-saver inhibitor. A hold another app acquired through logind is not releasable, and an unknown id exits 4. If you release a manual hold from another command, its original inhibit process keeps running; Ctrl-C on that process then exits 4 because the hold is already gone.

Apps that hold through systemd-inhibit are polled every 5 seconds, so their holds can take up to 5 seconds to count.

Inspect inhibitors ​

glimpsectl idle status does not need the panel. Its SOURCES table lists screensaver, portal, login1, and wayland, with a state of ready, degraded, or unsupported. Its INHIBITORS table has ID, WHO, WHY, BLOCKS, RELEASABLE, and EXPIRES columns. --watch reprints the tables on change, and --json prints JSON.

Released under the BSD 3-Clause license.