1
0
Fork 0
forked from wry/wry

add dpms on/off command

This commit is contained in:
kossLAN 2026-05-25 21:56:48 -04:00
parent a29937ebe8
commit 2167484861
No known key found for this signature in database
7 changed files with 76 additions and 13 deletions

View file

@ -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),