mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 17:33:19 +01:00
- Working gfx modes <iGPU only, dGPU only, or hybrid> - Add signal for gfx vendor change and make CLI wait for signal - Add polling for led brightness to save to config - Move daemon to zbus crate - dbus client refactor - Further dbus methods and updates - Add basic notification user daemon and systemd service
53 lines
1.7 KiB
Rust
53 lines
1.7 KiB
Rust
// This code was autogenerated with `dbus-codegen-rust -s -d org.asuslinux.Daemon -f org.asuslinux.Daemon -c blocking -p /org/asuslinux/Led -m None`, see https://github.com/diwic/dbus-rs
|
|
use dbus as dbus;
|
|
#[allow(unused_imports)]
|
|
use dbus::arg;
|
|
use dbus::blocking;
|
|
|
|
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>;
|
|
}
|
|
|
|
impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> OrgAsuslinuxDaemon for blocking::Proxy<'a, C> {
|
|
|
|
fn set_led_mode(&self, data: &str) -> Result<(), dbus::Error> {
|
|
self.method_call("org.asuslinux.Daemon", "SetLedMode", (data, ))
|
|
}
|
|
|
|
fn led_mode(&self) -> Result<String, dbus::Error> {
|
|
self.method_call("org.asuslinux.Daemon", "LedMode", ())
|
|
.and_then(|r: (String, )| Ok(r.0, ))
|
|
}
|
|
|
|
fn led_modes(&self) -> Result<String, dbus::Error> {
|
|
self.method_call("org.asuslinux.Daemon", "LedModes", ())
|
|
.and_then(|r: (String, )| Ok(r.0, ))
|
|
}
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct OrgAsuslinuxDaemonNotifyLed {
|
|
pub data: String,
|
|
}
|
|
|
|
impl arg::AppendAll for OrgAsuslinuxDaemonNotifyLed {
|
|
fn append(&self, i: &mut arg::IterAppend) {
|
|
arg::RefArg::append(&self.data, i);
|
|
}
|
|
}
|
|
|
|
impl arg::ReadAll for OrgAsuslinuxDaemonNotifyLed {
|
|
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
|
|
Ok(OrgAsuslinuxDaemonNotifyLed {
|
|
data: i.read()?,
|
|
})
|
|
}
|
|
}
|
|
|
|
impl dbus::message::SignalArgs for OrgAsuslinuxDaemonNotifyLed {
|
|
const NAME: &'static str = "NotifyLed";
|
|
const INTERFACE: &'static str = "org.asuslinux.Daemon";
|
|
}
|