Crates.io | logind-dbus |
lib.rs | logind-dbus |
version | 0.1.1 |
source | src |
created_at | 2018-11-02 16:26:20.42678 |
updated_at | 2019-02-15 23:27:06.673711 |
description | Communicate with the LoginManager DBus API |
homepage | |
repository | https://github.com/pop-os/logind-dbus |
max_upload_size | |
id | 94345 |
size | 6,005 |
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.
}