add dpms on/off command
This commit is contained in:
parent
a29937ebe8
commit
2167484861
7 changed files with 76 additions and 13 deletions
17
src/cli.rs
17
src/cli.rs
|
|
@ -3,6 +3,7 @@ mod color;
|
|||
mod color_management;
|
||||
mod config;
|
||||
mod damage_tracking;
|
||||
mod dpms;
|
||||
mod duration;
|
||||
mod generate;
|
||||
mod idle;
|
||||
|
|
@ -85,6 +86,8 @@ pub enum Cmd {
|
|||
Screenshot(ScreenshotArgs),
|
||||
/// Inspect/modify the idle (screensaver) settings.
|
||||
Idle(IdleArgs),
|
||||
/// Turn monitors on or off.
|
||||
Dpms(DpmsArgs),
|
||||
/// Run a privileged program.
|
||||
RunPrivileged(RunPrivilegedArgs),
|
||||
/// Run a program with a connection tag.
|
||||
|
|
@ -131,6 +134,19 @@ pub struct IdleArgs {
|
|||
pub command: Option<IdleCmd>,
|
||||
}
|
||||
|
||||
#[derive(Args, Debug)]
|
||||
pub struct DpmsArgs {
|
||||
/// Whether monitors should be on or off.
|
||||
#[clap(value_enum)]
|
||||
pub state: DpmsState,
|
||||
}
|
||||
|
||||
#[derive(ValueEnum, Debug, Copy, Clone, Eq, PartialEq)]
|
||||
pub enum DpmsState {
|
||||
On,
|
||||
Off,
|
||||
}
|
||||
|
||||
#[derive(Args, Debug)]
|
||||
pub struct RunPrivilegedArgs {
|
||||
/// The program to run
|
||||
|
|
@ -250,6 +266,7 @@ pub fn main() {
|
|||
Cmd::SetLogLevel(a) => set_log_level::main(cli.global, a),
|
||||
Cmd::Screenshot(a) => screenshot::main(cli.global, a),
|
||||
Cmd::Idle(a) => idle::main(cli.global, a),
|
||||
Cmd::Dpms(a) => dpms::main(cli.global, a),
|
||||
Cmd::Unlock => unlock::main(cli.global),
|
||||
Cmd::RunPrivileged(a) => run_privileged::main(cli.global, a),
|
||||
Cmd::RunTagged(a) => run_tagged::main(cli.global, a),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue