Support unlock from logind dbus

This commit is contained in:
Jeremy Soller 2024-04-05 11:31:15 -06:00
parent e9b5524992
commit 349c009321
2 changed files with 6 additions and 8 deletions

View file

@ -63,8 +63,10 @@ pub async fn handler(msg_tx: &mut mpsc::Sender<bool>) -> Result<(), Box<dyn Erro
loop {
// Waits until lock or unlock signals have been received
tokio::select!(_ = lock.next() => {
log::info!("logind lock");
msg_tx.send(true).await?;
}, _ = unlock.next() => {
log::info!("logind unlock");
msg_tx.send(false).await?;
});
}