updating option "-k" to show current brightness: asusctl -k

This commit is contained in:
Asere
2020-10-13 17:31:30 +02:00
parent a23c51e5db
commit d36ac44603
5 changed files with 102 additions and 16 deletions

View File

@@ -98,6 +98,16 @@ impl DbusKbdBacklight {
"SetKeyBacklight could not deserialise".to_string()
}
fn led_bright(&self) -> i8 {
if let Ok(ctrl) = self.inner.try_lock() {
if let Ok(cfg) = ctrl.config.clone().try_lock() {
return cfg.kbd_led_brightness as i8;
}
}
warn!("SetKeyBacklight could not deserialise");
-1
}
#[dbus_interface(signal)]
fn notify_led(&self, data: &str) -> zbus::Result<()>;
}