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)?;
|
dbus.proxies().anime().set_enable_display(enable)?;
|
||||||
}
|
}
|
||||||
if let Some(enable) = cmd.enable_powersave_anim {
|
if let Some(enable) = cmd.enable_powersave_anim {
|
||||||
dbg!(enable);
|
|
||||||
dbus.proxies().anime().set_builtins_enabled(enable)?;
|
dbus.proxies().anime().set_builtins_enabled(enable)?;
|
||||||
}
|
}
|
||||||
if let Some(bright) = cmd.brightness {
|
if let Some(bright) = cmd.brightness {
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ impl From<AnimeConfigV460> for AnimeConfig {
|
|||||||
system: c.system,
|
system: c.system,
|
||||||
boot: c.boot,
|
boot: c.boot,
|
||||||
wake: c.wake,
|
wake: c.wake,
|
||||||
sleep: c.sleep,
|
|
||||||
shutdown: c.shutdown,
|
shutdown: c.shutdown,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
@@ -54,7 +53,6 @@ impl From<AnimeConfigV472> for AnimeConfig {
|
|||||||
system: c.system,
|
system: c.system,
|
||||||
boot: c.boot,
|
boot: c.boot,
|
||||||
wake: c.wake,
|
wake: c.wake,
|
||||||
sleep: c.sleep,
|
|
||||||
shutdown: c.shutdown,
|
shutdown: c.shutdown,
|
||||||
model_override: c.model_override,
|
model_override: c.model_override,
|
||||||
display_enabled: c.display_enabled,
|
display_enabled: c.display_enabled,
|
||||||
@@ -71,7 +69,6 @@ pub struct AnimeConfigCached {
|
|||||||
pub system: Vec<ActionData>,
|
pub system: Vec<ActionData>,
|
||||||
pub boot: Vec<ActionData>,
|
pub boot: Vec<ActionData>,
|
||||||
pub wake: Vec<ActionData>,
|
pub wake: Vec<ActionData>,
|
||||||
pub sleep: Vec<ActionData>,
|
|
||||||
pub shutdown: Vec<ActionData>,
|
pub shutdown: Vec<ActionData>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,12 +96,6 @@ impl AnimeConfigCached {
|
|||||||
}
|
}
|
||||||
self.wake = wake;
|
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());
|
let mut shutdown = Vec::with_capacity(config.shutdown.len());
|
||||||
for ani in &config.shutdown {
|
for ani in &config.shutdown {
|
||||||
shutdown.push(ActionData::from_anime_action(anime_type, ani)?);
|
shutdown.push(ActionData::from_anime_action(anime_type, ani)?);
|
||||||
@@ -121,7 +112,6 @@ pub struct AnimeConfig {
|
|||||||
pub system: Vec<ActionLoader>,
|
pub system: Vec<ActionLoader>,
|
||||||
pub boot: Vec<ActionLoader>,
|
pub boot: Vec<ActionLoader>,
|
||||||
pub wake: Vec<ActionLoader>,
|
pub wake: Vec<ActionLoader>,
|
||||||
pub sleep: Vec<ActionLoader>,
|
|
||||||
pub shutdown: Vec<ActionLoader>,
|
pub shutdown: Vec<ActionLoader>,
|
||||||
// pub brightness: f32,
|
// pub brightness: f32,
|
||||||
pub display_enabled: bool,
|
pub display_enabled: bool,
|
||||||
@@ -140,7 +130,6 @@ impl Default for AnimeConfig {
|
|||||||
system: Vec::new(),
|
system: Vec::new(),
|
||||||
boot: Vec::new(),
|
boot: Vec::new(),
|
||||||
wake: Vec::new(),
|
wake: Vec::new(),
|
||||||
sleep: Vec::new(),
|
|
||||||
shutdown: Vec::new(),
|
shutdown: Vec::new(),
|
||||||
// brightness: 1.0,
|
// brightness: 1.0,
|
||||||
display_enabled: true,
|
display_enabled: true,
|
||||||
@@ -223,14 +212,6 @@ impl AnimeConfig {
|
|||||||
Duration::from_secs(2),
|
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 {
|
shutdown: vec![ActionLoader::ImageAnimation {
|
||||||
file: "/usr/share/asusd/anime/custom/sonic-wait.gif".into(),
|
file: "/usr/share/asusd/anime/custom/sonic-wait.gif".into(),
|
||||||
scale: 0.9,
|
scale: 0.9,
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ impl CtrlAnimeZbus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lock.config.display_enabled = enabled;
|
|
||||||
lock.config.builtin_anims_enabled = enabled;
|
lock.config.builtin_anims_enabled = enabled;
|
||||||
lock.config.write();
|
lock.config.write();
|
||||||
if enabled {
|
if enabled {
|
||||||
@@ -271,12 +270,13 @@ impl crate::CtrlTask for CtrlAnimeZbus {
|
|||||||
}
|
}
|
||||||
if !lock.config.builtin_anims_enabled {
|
if !lock.config.builtin_anims_enabled {
|
||||||
if sleeping {
|
if sleeping {
|
||||||
CtrlAnime::run_thread(
|
lock.thread_exit.store(true, Ordering::Release);
|
||||||
inner.clone(),
|
lock.node
|
||||||
lock.cache.sleep.clone(),
|
.write_bytes(&pkt_set_enable_display(!sleeping))
|
||||||
true,
|
.map_err(|err| {
|
||||||
)
|
warn!("create_sys_event_tasks::off_when_suspended {}", err);
|
||||||
.await;
|
})
|
||||||
|
.ok();
|
||||||
} else {
|
} else {
|
||||||
CtrlAnime::run_thread(inner.clone(), lock.cache.wake.clone(), true)
|
CtrlAnime::run_thread(inner.clone(), lock.cache.wake.clone(), true)
|
||||||
.await;
|
.await;
|
||||||
|
|||||||
Reference in New Issue
Block a user