2024-10-15 09:46:03 -07:00
|
|
|
use cosmic_config::{cosmic_config_derive::CosmicConfigEntry, CosmicConfigEntry};
|
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Deserialize, Serialize, Clone, CosmicConfigEntry)]
|
|
|
|
|
pub struct CosmicIdleConfig {
|
2024-10-17 18:51:29 -07:00
|
|
|
/// Screen off idle time, in ms
|
2024-10-22 13:45:41 -07:00
|
|
|
pub screen_off_time: Option<u32>,
|
2024-10-25 11:33:11 -07:00
|
|
|
/// 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>,
|
2024-10-15 09:46:03 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Default for CosmicIdleConfig {
|
|
|
|
|
fn default() -> Self {
|
|
|
|
|
Self {
|
2024-10-30 09:30:42 -07:00
|
|
|
screen_off_time: Some(15 * 60 * 1000),
|
|
|
|
|
suspend_on_battery_time: Some(15 * 60 * 1000),
|
|
|
|
|
suspend_on_ac_time: Some(30 * 60 * 1000),
|
2024-10-15 09:46:03 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|