feat(src): adddisplay management commands
Implement display command to query and set refresh rates. New Features - Add DisplayCommands with Rates and SetRate subcommands - Register display command in CLI dispatcher Enhancements - Extend command dispatch to handle Display subcommand Bug Fixes - None
This commit is contained in:
2 files changed
+17
No files matched your search
+16
@@ -37,6 +37,11 @@ pub enum Commands {
|
|||||||
#[command(subcommand)]
|
#[command(subcommand)]
|
||||||
command: CoolingCommands,
|
command: CoolingCommands,
|
||||||
},
|
},
|
||||||
|
/// Display management commands
|
||||||
|
Display {
|
||||||
|
#[command(subcommand)]
|
||||||
|
command: DisplayCommands,
|
||||||
|
},
|
||||||
/// Hardware status
|
/// Hardware status
|
||||||
Status,
|
Status,
|
||||||
/// Install udev rules for rootless operation
|
/// Install udev rules for rootless operation
|
||||||
@@ -144,3 +149,14 @@ pub enum TouchpadCommands {
|
|||||||
/// Disable the touchpad
|
/// Disable the touchpad
|
||||||
Disable,
|
Disable,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Subcommand, Debug)]
|
||||||
|
pub enum DisplayCommands {
|
||||||
|
/// Show available and active refresh rates
|
||||||
|
Rates,
|
||||||
|
/// Set the display refresh rate
|
||||||
|
SetRate {
|
||||||
|
/// Target refresh rate in Hz
|
||||||
|
rate: f32,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -26,6 +26,7 @@ fn main() {
|
|||||||
Commands::Battery { command } => commands::battery::execute(command),
|
Commands::Battery { command } => commands::battery::execute(command),
|
||||||
Commands::Power { command } => commands::power::execute(command),
|
Commands::Power { command } => commands::power::execute(command),
|
||||||
Commands::Cooling { command } => commands::cooling::execute(command),
|
Commands::Cooling { command } => commands::cooling::execute(command),
|
||||||
|
Commands::Display { command } => commands::display::execute(command),
|
||||||
Commands::Status => commands::status::execute(),
|
Commands::Status => commands::status::execute(),
|
||||||
Commands::InstallRules => commands::install_rules::execute(),
|
Commands::InstallRules => commands::install_rules::execute(),
|
||||||
Commands::Touchpad { command } => commands::touchpad::execute(command),
|
Commands::Touchpad { command } => commands::touchpad::execute(command),
|
||||||
|
|||||||
Reference in new issue
Block a user