Recover previous locked state

This commit is contained in:
Jeremy Soller 2024-11-07 09:37:16 -07:00
parent 7366808e8c
commit 08202f1572
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
4 changed files with 83 additions and 27 deletions

View file

@ -7,7 +7,6 @@ use logind_zbus::{
session::SessionProxy,
};
use std::{any::TypeId, error::Error, os::fd::OwnedFd, sync::Arc};
use tokio::time;
use zbus::Connection;
use crate::locker::Message;
@ -68,7 +67,9 @@ pub fn subscription() -> Subscription<Message> {
pub async fn handler(msg_tx: &mut mpsc::Sender<Message>) -> Result<(), Box<dyn Error>> {
let connection = Connection::system().await?;
let manager = ManagerProxy::new(&connection).await?;
let session_path = manager.get_session_by_PID(std::os::unix::process::parent_id()).await?;
let session_path = manager
.get_session_by_PID(std::os::unix::process::parent_id())
.await?;
let session = SessionProxy::builder(&connection)
.path(&session_path)?
.build()