mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 17:33:19 +01:00
Major cleanup of older gui state code
This commit is contained in:
@@ -274,19 +274,13 @@ impl crate::Reloadable for CtrlFanCurveZbus {
|
||||
/// Fetch the active profile and use that to set all related components up
|
||||
async fn reload(&mut self) -> Result<(), RogError> {
|
||||
let active = self.platform.get_throttle_thermal_policy()?.into();
|
||||
let mut config = self.config.lock().await;
|
||||
if let Ok(mut device) = find_fan_curve_node() {
|
||||
// There is a possibility that the curve was default zeroed, so this call
|
||||
// initialises the data from system read and we need to save it
|
||||
// after
|
||||
loop {
|
||||
if let Ok(mut config) = self.config.try_lock() {
|
||||
config
|
||||
.profiles
|
||||
.write_profile_curve_to_platform(active, &mut device)?;
|
||||
break;
|
||||
}
|
||||
}
|
||||
config
|
||||
.profiles
|
||||
.write_profile_curve_to_platform(active, &mut device)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ impl CtrlPlatform {
|
||||
fn set_gfx_mode(&self, mode: GpuMode) -> Result<(), RogError> {
|
||||
self.platform.set_gpu_mux_mode(mode.to_mux_attr())?;
|
||||
// self.update_initramfs(enable)?;
|
||||
if mode == GpuMode::Discrete {
|
||||
if mode == GpuMode::Ultimate {
|
||||
info!("Set system-level graphics mode: Dedicated Nvidia");
|
||||
} else {
|
||||
info!("Set system-level graphics mode: Optimus");
|
||||
@@ -264,6 +264,7 @@ impl CtrlPlatform {
|
||||
|
||||
#[interface(name = "org.asuslinux.Platform")]
|
||||
impl CtrlPlatform {
|
||||
#[zbus(property)]
|
||||
async fn version(&self) -> String {
|
||||
crate::VERSION.to_string()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user