add unix socket ipc
This commit is contained in:
parent
dc62d2240f
commit
f92c092acc
9 changed files with 1550 additions and 2 deletions
|
|
@ -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;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue