/psp

Rust Cross-platform Power State Plugin (PSP). Monitoring the power state and emit events via an MPSC channel.

Primary LanguageRustApache License 2.0Apache-2.0

Power State Plugin (PSP)

Rust Cross-platform Power State Plugin (PSP).

Using an MPSC channel for emitting events when screen-locked, unlocked, sleep, wake up.

Support Platform

  • macOS
  • Windows
  • Unix (with D-Bus only)

Events

ScreenLocked

When you logout the session or close your laptop lid

ScreenUnlocked

When you login the session or open the laptop lid

Resume

Resume from sleep mode

Suspend

Turn your computer into sleep mode

Examples

With Tao

cargo run --example tao

With winit

cargo run --example winit