logind-dbus

Crates.iologind-dbus
lib.rslogind-dbus
version0.1.1
sourcesrc
created_at2018-11-02 16:26:20.42678
updated_at2019-02-15 23:27:06.673711
descriptionCommunicate with the LoginManager DBus API
homepage
repositoryhttps://github.com/pop-os/logind-dbus
max_upload_size
id94345
size6,005
Jeremy Soller (jackpot51)

documentation

README

logind-dbus

Rust crate that provides a DBus API for interacting with logind, which is useful for doing things such as inhibiting suspension.

extern crate logind_dbus;
use logind_dbus::LoginManager;

pub fn main() -> io::Result<()> {
    let login_manager = LoginManager::new()?;
    let suspend_lock = login_manager.connect().inhibit_suspend()?;
    /// Do sensitive thing with the guarantee that suspend will not work.
}
Commit count: 3

cargo fmt