mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +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
47 lines
1.5 KiB
Rust
47 lines
1.5 KiB
Rust
// This code was autogenerated with `dbus-codegen-rust -s -d org.asuslinux.Daemon -f org.asuslinux.Daemon -c blocking -p /org/asuslinux/Charge -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_limit(&self, limit: u8) -> Result<(), dbus::Error>;
|
|
fn limit(&self) -> Result<i16, dbus::Error>;
|
|
}
|
|
|
|
impl<'a, T: blocking::BlockingSender, C: ::std::ops::Deref<Target=T>> OrgAsuslinuxDaemon for blocking::Proxy<'a, C> {
|
|
|
|
fn set_limit(&self, limit: u8) -> Result<(), dbus::Error> {
|
|
self.method_call("org.asuslinux.Daemon", "SetLimit", (limit, ))
|
|
}
|
|
|
|
fn limit(&self) -> Result<i16, dbus::Error> {
|
|
self.method_call("org.asuslinux.Daemon", "Limit", ())
|
|
.and_then(|r: (i16, )| Ok(r.0, ))
|
|
}
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct OrgAsuslinuxDaemonNotifyCharge {
|
|
pub limit: u8,
|
|
}
|
|
|
|
impl arg::AppendAll for OrgAsuslinuxDaemonNotifyCharge {
|
|
fn append(&self, i: &mut arg::IterAppend) {
|
|
arg::RefArg::append(&self.limit, i);
|
|
}
|
|
}
|
|
|
|
impl arg::ReadAll for OrgAsuslinuxDaemonNotifyCharge {
|
|
fn read(i: &mut arg::Iter) -> Result<Self, arg::TypeMismatchError> {
|
|
Ok(OrgAsuslinuxDaemonNotifyCharge {
|
|
limit: i.read()?,
|
|
})
|
|
}
|
|
}
|
|
|
|
impl dbus::message::SignalArgs for OrgAsuslinuxDaemonNotifyCharge {
|
|
const NAME: &'static str = "NotifyCharge";
|
|
const INTERFACE: &'static str = "org.asuslinux.Daemon";
|
|
}
|