logind-dbus 0.1.1

Communicate with the LoginManager DBus API
Documentation
  • Coverage
  • 71.43%
    5 out of 7 items documented1 out of 7 items with examples
  • Size
  • Source code size: 6.71 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 408.95 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • pop-os/logind-dbus
    10 4 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mmstick jackpot51

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.
}