mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Anime: add base brightness control (dbus, cli)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use gumdrop::Options;
|
||||
use rog_anime::usb::Brightness;
|
||||
|
||||
#[derive(Options)]
|
||||
pub struct AnimeCommand {
|
||||
@@ -14,8 +15,13 @@ pub struct AnimeCommand {
|
||||
help = "enable/disable system animations (boot/sleep/shutdown)"
|
||||
)]
|
||||
pub boot_enable: Option<bool>,
|
||||
#[options(meta = "", help = "set global AniMe brightness value")]
|
||||
pub brightness: Option<f32>,
|
||||
#[options(
|
||||
meta = "",
|
||||
help = "set global base brightness value <Off, Low, Med, High>"
|
||||
)]
|
||||
pub brightness: Option<Brightness>,
|
||||
#[options(meta = "", help = "set global (image) brightness value")]
|
||||
pub image_brightness: Option<f32>,
|
||||
#[options(help = "clear the display")]
|
||||
pub clear: bool,
|
||||
#[options(command)]
|
||||
|
||||
@@ -226,6 +226,7 @@ fn handle_anime(
|
||||
&& cmd.enable.is_none()
|
||||
&& cmd.boot_enable.is_none()
|
||||
&& cmd.brightness.is_none()
|
||||
&& cmd.image_brightness.is_none()
|
||||
&& !cmd.clear)
|
||||
|| cmd.help
|
||||
{
|
||||
@@ -241,6 +242,9 @@ fn handle_anime(
|
||||
dbus.proxies().anime().set_animation_enabled(anime_boot)?;
|
||||
}
|
||||
if let Some(bright) = cmd.brightness {
|
||||
dbus.proxies().anime().set_brightness(bright)?;
|
||||
}
|
||||
if let Some(bright) = cmd.image_brightness {
|
||||
verify_brightness(bright);
|
||||
dbus.proxies().anime().set_image_brightness(bright)?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user