Skip to content

Rust crate for listening to AC adapter plug events on Linux from `acpid`.

License

Notifications You must be signed in to change notification settings

pop-os/acpid-plug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

acpid-plug

Rust crate for listening to AC adapter plug events on Linux from acpid.

use futures_util::StreamExt;

#[tokio::main(flavor = "current_thread")]
async fn main() -> std::io::Result<()> {
    let mut ac_plug_events = acpid_plug::connect().await?;

    while let Some(event) = ac_plug_events.next().await {
        match event {
            Ok(event) => println!("{:?}", event),
            Err(why) => eprintln!("error: {}", why),
        }
    }

    Ok(())
}

About

Rust crate for listening to AC adapter plug events on Linux from `acpid`.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages