Add ActiveProfileName() dbus method returning name of current profile

This commit is contained in:
Andreas Streichardt
2020-09-26 09:05:50 +02:00
parent b80c860b7a
commit bb70fd7b71

View File

@@ -45,6 +45,16 @@ impl DbusFanAndCpu {
}
}
fn active_profile_name(&mut self) -> String {
if let Ok(ctrl) = self.inner.try_lock() {
if let Ok(mut cfg) = ctrl.config.try_lock() {
cfg.read();
return cfg.active_profile.clone();
}
}
"Failed".to_string()
}
fn profile(&mut self) -> String {
if let Ok(ctrl) = self.inner.try_lock() {
if let Ok(mut cfg) = ctrl.config.try_lock() {