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

@@ -8,6 +8,7 @@ pub trait OrgAsuslinuxDaemon {
fn set_led_mode(&self, data: &str) -> Result<(), dbus::Error>;
fn led_mode(&self) -> Result<String, dbus::Error>;
fn led_modes(&self) -> Result<String, dbus::Error>;
fn led_bright(&self) -> Result<i16, dbus::Error>;
}
impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> OrgAsuslinuxDaemon for blocking::Proxy<'a, C> {
@@ -25,6 +26,11 @@ impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> OrgAsuslin
self.method_call("org.asuslinux.Daemon", "LedModes", ())
.and_then(|r: (String, )| Ok(r.0, ))
}
fn led_bright(&self) -> Result<i16, dbus::Error> {
self.method_call("org.asuslinux.Daemon", "LedBright", ())
.and_then(|r: (i16, )| Ok(r.0, ))
}
}
#[derive(Debug)]