Have remote commands return a success/failure message

This commit is contained in:
2022-05-14 14:55:22 -07:00
parent aafe026092
commit 8394d45d1a
8 changed files with 181 additions and 34 deletions

View File

@ -2,7 +2,7 @@ use async_std::task;
use futures::{future::FutureExt, pin_mut, select, AsyncReadExt, StreamExt};
use log::{debug, error, info, warn};
use logind_zbus::manager::{InhibitType, ManagerProxy};
use std::{os::unix::io::AsRawFd, process::exit};
use std::{os::unix::io::AsRawFd, process::exit, time::Duration};
use zbus::Connection;
use bscreensaver_command::{bscreensaver_command, BCommand};
@ -85,7 +85,7 @@ async fn dbus_task() -> anyhow::Result<()> {
async fn do_bscreensaver_command(command: BCommand) -> anyhow::Result<()> {
task::block_on(async {
bscreensaver_command(command)
bscreensaver_command(command, Some(Duration::from_secs(4)))
})?;
Ok(())
}