mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Anime: expose new options in CLI
This commit is contained in:
@@ -11,9 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Support Rog Ally LED modes (basic)
|
- Support Rog Ally LED modes (basic)
|
||||||
- Add on_lid_closed and on_external_power_changed events for running certain tasks
|
- Add on_lid_closed and on_external_power_changed events for running certain tasks
|
||||||
- Anime dbus: add:
|
- Anime dbus: add:
|
||||||
- SetOffWhenUnplugged
|
- SetOffWhenUnplugged, also add asusctl CLI option
|
||||||
- SetOffWhenSuspended
|
- SetOffWhenSuspended, also add asusctl CLI option
|
||||||
- SetOffWhenLidClosed
|
- SetOffWhenLidClosed, also add asusctl CLI option
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- asusd: remove set_image_brightness for anime
|
- asusd: remove set_image_brightness for anime
|
||||||
|
|||||||
@@ -19,6 +19,26 @@ pub struct AnimeCommand {
|
|||||||
pub brightness: Option<Brightness>,
|
pub brightness: Option<Brightness>,
|
||||||
#[options(help = "clear the display")]
|
#[options(help = "clear the display")]
|
||||||
pub clear: bool,
|
pub clear: bool,
|
||||||
|
#[options(
|
||||||
|
no_short,
|
||||||
|
meta = "",
|
||||||
|
help = "turn the anime off when external power is unplugged"
|
||||||
|
)]
|
||||||
|
pub off_when_unplugged: Option<bool>,
|
||||||
|
#[options(
|
||||||
|
no_short,
|
||||||
|
meta = "",
|
||||||
|
help = "turn the anime off when the laptop suspends"
|
||||||
|
)]
|
||||||
|
pub off_when_suspended: Option<bool>,
|
||||||
|
#[options(
|
||||||
|
no_short,
|
||||||
|
meta = "",
|
||||||
|
help = "turn the anime off when the lid is closed"
|
||||||
|
)]
|
||||||
|
pub off_when_lid_closed: Option<bool>,
|
||||||
|
#[options(no_short, meta = "", help = "Off with his head!!!")]
|
||||||
|
pub off_with_his_head: Option<bool>,
|
||||||
#[options(command)]
|
#[options(command)]
|
||||||
pub command: Option<AnimeActions>,
|
pub command: Option<AnimeActions>,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,6 +207,10 @@ fn handle_anime(
|
|||||||
&& cmd.enable_display.is_none()
|
&& cmd.enable_display.is_none()
|
||||||
&& cmd.enable_powersave_anim.is_none()
|
&& cmd.enable_powersave_anim.is_none()
|
||||||
&& cmd.brightness.is_none()
|
&& cmd.brightness.is_none()
|
||||||
|
&& cmd.off_when_lid_closed.is_none()
|
||||||
|
&& cmd.off_when_suspended.is_none()
|
||||||
|
&& cmd.off_when_unplugged.is_none()
|
||||||
|
&& cmd.off_with_his_head.is_none()
|
||||||
&& !cmd.clear)
|
&& !cmd.clear)
|
||||||
|| cmd.help
|
|| cmd.help
|
||||||
{
|
{
|
||||||
@@ -225,6 +229,18 @@ fn handle_anime(
|
|||||||
if let Some(bright) = cmd.brightness {
|
if let Some(bright) = cmd.brightness {
|
||||||
dbus.proxies().anime().set_brightness(bright)?;
|
dbus.proxies().anime().set_brightness(bright)?;
|
||||||
}
|
}
|
||||||
|
if let Some(enable) = cmd.off_when_lid_closed {
|
||||||
|
dbus.proxies().anime().set_off_when_lid_closed(enable)?;
|
||||||
|
}
|
||||||
|
if let Some(enable) = cmd.off_when_suspended {
|
||||||
|
dbus.proxies().anime().set_off_when_suspended(enable)?;
|
||||||
|
}
|
||||||
|
if let Some(enable) = cmd.off_when_unplugged {
|
||||||
|
dbus.proxies().anime().set_off_when_unplugged(enable)?;
|
||||||
|
}
|
||||||
|
if cmd.off_with_his_head.is_some() {
|
||||||
|
println!("Did Alice _really_ make it back from Wonderland?");
|
||||||
|
}
|
||||||
|
|
||||||
let mut anime_type = get_anime_type()?;
|
let mut anime_type = get_anime_type()?;
|
||||||
if let AnimeType::Unknown = anime_type {
|
if let AnimeType::Unknown = anime_type {
|
||||||
|
|||||||
@@ -44,8 +44,5 @@ trait Anime {
|
|||||||
|
|
||||||
/// NotifyDeviceState signal
|
/// NotifyDeviceState signal
|
||||||
#[dbus_proxy(signal)]
|
#[dbus_proxy(signal)]
|
||||||
fn notify_device_state(
|
fn notify_device_state(&self, data: AnimeDeviceState) -> zbus::Result<()>;
|
||||||
&self,
|
|
||||||
data: (bool, &str, bool, (&str, &str, &str, &str)),
|
|
||||||
) -> zbus::Result<()>;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user