mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Anime: remove sleep animation config
This commit is contained in:
@@ -223,7 +223,6 @@ fn handle_anime(
|
||||
dbus.proxies().anime().set_enable_display(enable)?;
|
||||
}
|
||||
if let Some(enable) = cmd.enable_powersave_anim {
|
||||
dbg!(enable);
|
||||
dbus.proxies().anime().set_builtins_enabled(enable)?;
|
||||
}
|
||||
if let Some(bright) = cmd.brightness {
|
||||
|
||||
@@ -26,7 +26,6 @@ impl From<AnimeConfigV460> for AnimeConfig {
|
||||
system: c.system,
|
||||
boot: c.boot,
|
||||
wake: c.wake,
|
||||
sleep: c.sleep,
|
||||
shutdown: c.shutdown,
|
||||
..Default::default()
|
||||
}
|
||||
@@ -54,7 +53,6 @@ impl From<AnimeConfigV472> for AnimeConfig {
|
||||
system: c.system,
|
||||
boot: c.boot,
|
||||
wake: c.wake,
|
||||
sleep: c.sleep,
|
||||
shutdown: c.shutdown,
|
||||
model_override: c.model_override,
|
||||
display_enabled: c.display_enabled,
|
||||
@@ -71,7 +69,6 @@ pub struct AnimeConfigCached {
|
||||
pub system: Vec<ActionData>,
|
||||
pub boot: Vec<ActionData>,
|
||||
pub wake: Vec<ActionData>,
|
||||
pub sleep: Vec<ActionData>,
|
||||
pub shutdown: Vec<ActionData>,
|
||||
}
|
||||
|
||||
@@ -99,12 +96,6 @@ impl AnimeConfigCached {
|
||||
}
|
||||
self.wake = wake;
|
||||
|
||||
let mut sleep = Vec::with_capacity(config.sleep.len());
|
||||
for ani in &config.sleep {
|
||||
sleep.push(ActionData::from_anime_action(anime_type, ani)?);
|
||||
}
|
||||
self.sleep = sleep;
|
||||
|
||||
let mut shutdown = Vec::with_capacity(config.shutdown.len());
|
||||
for ani in &config.shutdown {
|
||||
shutdown.push(ActionData::from_anime_action(anime_type, ani)?);
|
||||
@@ -121,7 +112,6 @@ pub struct AnimeConfig {
|
||||
pub system: Vec<ActionLoader>,
|
||||
pub boot: Vec<ActionLoader>,
|
||||
pub wake: Vec<ActionLoader>,
|
||||
pub sleep: Vec<ActionLoader>,
|
||||
pub shutdown: Vec<ActionLoader>,
|
||||
// pub brightness: f32,
|
||||
pub display_enabled: bool,
|
||||
@@ -140,7 +130,6 @@ impl Default for AnimeConfig {
|
||||
system: Vec::new(),
|
||||
boot: Vec::new(),
|
||||
wake: Vec::new(),
|
||||
sleep: Vec::new(),
|
||||
shutdown: Vec::new(),
|
||||
// brightness: 1.0,
|
||||
display_enabled: true,
|
||||
@@ -223,14 +212,6 @@ impl AnimeConfig {
|
||||
Duration::from_secs(2),
|
||||
)),
|
||||
}],
|
||||
sleep: vec![ActionLoader::ImageAnimation {
|
||||
file: "/usr/share/asusd/anime/custom/sonic-wait.gif".into(),
|
||||
scale: 0.9,
|
||||
angle: 0.0,
|
||||
translation: Vec2::new(3.0, 2.0),
|
||||
brightness: 1.0,
|
||||
time: AnimTime::Infinite,
|
||||
}],
|
||||
shutdown: vec![ActionLoader::ImageAnimation {
|
||||
file: "/usr/share/asusd/anime/custom/sonic-wait.gif".into(),
|
||||
scale: 0.9,
|
||||
|
||||
@@ -103,7 +103,6 @@ impl CtrlAnimeZbus {
|
||||
}
|
||||
}
|
||||
|
||||
lock.config.display_enabled = enabled;
|
||||
lock.config.builtin_anims_enabled = enabled;
|
||||
lock.config.write();
|
||||
if enabled {
|
||||
@@ -271,12 +270,13 @@ impl crate::CtrlTask for CtrlAnimeZbus {
|
||||
}
|
||||
if !lock.config.builtin_anims_enabled {
|
||||
if sleeping {
|
||||
CtrlAnime::run_thread(
|
||||
inner.clone(),
|
||||
lock.cache.sleep.clone(),
|
||||
true,
|
||||
)
|
||||
.await;
|
||||
lock.thread_exit.store(true, Ordering::Release);
|
||||
lock.node
|
||||
.write_bytes(&pkt_set_enable_display(!sleeping))
|
||||
.map_err(|err| {
|
||||
warn!("create_sys_event_tasks::off_when_suspended {}", err);
|
||||
})
|
||||
.ok();
|
||||
} else {
|
||||
CtrlAnime::run_thread(inner.clone(), lock.cache.wake.clone(), true)
|
||||
.await;
|
||||
|
||||
Reference in New Issue
Block a user