Skip to main content

session_candidates

Function session_candidates 

Source
pub(super) fn session_candidates(env_session_id: Option<&str>) -> Vec<String>
Expand description

Ordered loginctl show-session identifiers to try. The caller’s own XDG_SESSION_ID is the most specific, but it’s frequently unset for GUI apps launched detached from the logind session (D-Bus activation, some autostart paths) — and there the old literal self fallback resolved to nothing, so loginctl exited non-zero and lock detection disabled itself (#191). auto is logind’s lenient resolver — the caller’s session if it has one, otherwise the user’s display session — so it succeeds where self can’t. Pure so the fallback order is testable without a logind session.