Add suspend timer

This commit is contained in:
Ian Douglas Scott 2024-10-25 11:33:11 -07:00
parent 9907afc859
commit b384ea9fa2
2 changed files with 60 additions and 10 deletions

View file

@ -5,12 +5,18 @@ use serde::{Deserialize, Serialize};
pub struct CosmicIdleConfig {
/// Screen off idle time, in ms
pub screen_off_time: Option<u32>,
/// Suspend idle time when on battery, in ms
pub suspend_on_battery_time: Option<u32>,
/// Suspend idle time when on ac, in ms
pub suspend_on_ac_time: Option<u32>,
}
impl Default for CosmicIdleConfig {
fn default() -> Self {
Self {
screen_off_time: Some(10 * 60 * 1000),
suspend_on_battery_time: Some(20 * 60 * 1000),
suspend_on_ac_time: Some(20 * 60 * 1000),
}
}
}