diff --git a/daemon/src/gpu_controller.rs b/daemon/src/gpu_controller.rs index 05ed369..69c7de0 100644 --- a/daemon/src/gpu_controller.rs +++ b/daemon/src/gpu_controller.rs @@ -50,6 +50,7 @@ pub struct GpuInfo { pub link_speed: String, pub link_width: u8, pub vulkan_info: VulkanInfo, + pub max_fan_speed: i32, } impl GpuController { @@ -150,6 +151,7 @@ impl GpuController { let vulkan_info = GpuController::get_vulkan_info(&model_id); + let max_fan_speed = self.hw_mon.fan_max_speed; GpuInfo { gpu_vendor: vendor, @@ -164,6 +166,7 @@ impl GpuController { link_speed, link_width, vulkan_info, + max_fan_speed, } } diff --git a/daemon/src/hw_mon.rs b/daemon/src/hw_mon.rs index 82027bd..10cded2 100644 --- a/daemon/src/hw_mon.rs +++ b/daemon/src/hw_mon.rs @@ -10,7 +10,7 @@ pub enum HWMonError { #[derive(Debug, Clone)] pub struct HWMon { hwmon_path: PathBuf, - fan_max_speed: i32, + pub fan_max_speed: i32, fan_control: Arc, fan_curve: Arc>>, } diff --git a/gui/src/main.rs b/gui/src/main.rs index 08b466a..242808f 100644 --- a/gui/src/main.rs +++ b/gui/src/main.rs @@ -163,7 +163,7 @@ fn build_ui(application: >k::Application) { gpu_power_text_buffer.set_text(&format!("{}/{}W", gpu_stats.power_avg, gpu_stats.power_max)); - fan_speed_text_buffer.set_text(&format!("{}RPM", gpu_stats.fan_speed)); + fan_speed_text_buffer.set_text(&format!("{}RPM({}%)", gpu_stats.fan_speed, (gpu_stats.fan_speed as f64 / gpu_info.max_fan_speed as f64 * 100 as f64) as i32)); glib::Continue(true) });