pub struct Logind { /* private fields */ }Expand description
logind, from cx.logind(). Cloning it is cheap.
Implementations§
Source§impl Logind
impl Logind
Sourcepub fn preparing_for_sleep(&self) -> ReadSignal<bool>
pub fn preparing_for_sleep(&self) -> ReadSignal<bool>
Whether the machine is about to sleep: true from logind’s
PrepareForSleep(true) until its PrepareForSleep(false) after
the resume. false while logind isn’t running.
Sourcepub fn delay_sleep_until(&self, ready: impl IntoProp<bool>)
pub fn delay_sleep_until(&self, ready: impl IntoProp<bool>)
Holds sleep off until ready reads true, as a lock screen locks
before the machine sleeps. While the asking context lives, the
shell holds a logind delay inhibitor. When the machine is about to
sleep, it lets go as soon as ready reads true, and takes a new
one after the resume. logind’s InhibitDelayMaxSec, 5 s by
default, bounds the wait. Each call holds its own. An inhibitor
logind refuses is logged and asked for again only after the next
resume or when logind starts again.
ready is read only while the machine is about to sleep. If it
panics, that is logged and the inhibitor goes.