From 1283e5be14694d2ee661f9f360b24e419deee63f Mon Sep 17 00:00:00 2001 From: RGBCube Date: Wed, 4 Jun 2025 18:59:04 +0300 Subject: [PATCH] delete core.rs --- src/core.rs | 51 --------------------------------------------------- src/daemon.rs | 4 +++- 2 files changed, 3 insertions(+), 52 deletions(-) delete mode 100644 src/core.rs diff --git a/src/core.rs b/src/core.rs deleted file mode 100644 index 2e32854..0000000 --- a/src/core.rs +++ /dev/null @@ -1,51 +0,0 @@ -pub struct SystemInfo { - // Overall system details - pub cpu_model: String, -} - -pub struct CpuCoreInfo { - // Per-core data - pub core_id: u32, - pub temperature_celsius: Option, -} - -pub struct CpuGlobalInfo { - // System-wide CPU settings - pub epp: Option, // Energy Performance Preference - pub epb: Option, // Energy Performance Bias - pub average_temperature_celsius: Option, // Average temperature across all cores -} - -pub struct BatteryInfo { - // Battery status (AC connected, charging state, capacity, power rate, charge start/stop thresholds if available). - pub name: String, - pub ac_connected: bool, - pub charging_state: Option, // e.g., "Charging", "Discharging", "Full" - pub capacity_percent: Option, - pub power_rate_watts: Option, // positive for charging, negative for discharging - pub charge_start_threshold: Option, - pub charge_stop_threshold: Option, -} - -pub struct SystemLoad { - // System load averages. - pub load_avg_1min: f32, - pub load_avg_5min: f32, - pub load_avg_15min: f32, -} - -pub struct SystemReport { - // Now combine all the above for a snapshot of the system state. - pub system_info: SystemInfo, - pub cpu_cores: Vec, - pub cpu_global: CpuGlobalInfo, - pub batteries: Vec, - pub system_load: SystemLoad, - pub timestamp: std::time::SystemTime, // so we know when the report was generated -} - -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum OperationalMode { - Powersave, - Performance, -} diff --git a/src/daemon.rs b/src/daemon.rs index f2d2e3a..f5bbbdc 100644 --- a/src/daemon.rs +++ b/src/daemon.rs @@ -10,7 +10,7 @@ use std::{ use anyhow::Context; -use crate::config; +use crate::{config, system}; /// Calculate the idle time multiplier based on system idle time. /// @@ -254,6 +254,8 @@ pub fn run(config: config::DaemonConfig) -> anyhow::Result<()> { }) .context("failed to set Ctrl-C handler")?; + let mut system = system::System::new()?; + while !cancelled.load(Ordering::SeqCst) {} log::info!("exiting...");