1
0
Fork 0
forked from wry/wry

add unix socket ipc

This commit is contained in:
kossLAN 2026-06-08 19:56:17 -04:00
parent dc62d2240f
commit f92c092acc
No known key found for this signature in database
9 changed files with 1550 additions and 2 deletions

View file

@ -1,13 +1,21 @@
use {
crate::{
cli::{DpmsArgs, DpmsState, GlobalArgs},
ipc,
tools::tool_client::{ToolClient, with_tool_client},
utils::errorfmt::ErrorFmt,
wire::jay_compositor::SetDpms,
},
std::rc::Rc,
};
pub fn main(global: GlobalArgs, args: DpmsArgs) {
let active = args.state == DpmsState::On;
match ipc::request_unit(&ipc::Request::DpmsSet { active }) {
Ok(()) => return,
Err(e) if e.can_fallback() => {}
Err(e) => fatal!("Could not set DPMS state over IPC: {}", ErrorFmt(e)),
}
with_tool_client(global.log_level, |tc| async move {
run(tc, args).await;
});