refactor: split cargo workspace
This commit is contained in:
parent
5db14936e7
commit
1c21bd1259
695 changed files with 32023 additions and 44964 deletions
23
src/cli/dpms.rs
Normal file
23
src/cli/dpms.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
use {
|
||||
crate::{
|
||||
cli::{DpmsArgs, DpmsState, GlobalArgs},
|
||||
tools::tool_client::{ToolClient, with_tool_client},
|
||||
wire::jay_compositor::SetDpms,
|
||||
},
|
||||
std::rc::Rc,
|
||||
};
|
||||
|
||||
pub fn main(global: GlobalArgs, args: DpmsArgs) {
|
||||
with_tool_client(global.log_level, |tc| async move {
|
||||
run(tc, args).await;
|
||||
});
|
||||
}
|
||||
|
||||
async fn run(tc: Rc<ToolClient>, args: DpmsArgs) {
|
||||
let comp = tc.jay_compositor().await;
|
||||
tc.send(SetDpms {
|
||||
self_id: comp,
|
||||
active: (args.state == DpmsState::On) as u32,
|
||||
});
|
||||
tc.round_trip().await;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue