mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 09:23:19 +01:00
Try to implement slash bar functionality - part 1
This commit is contained in:
@@ -12,6 +12,7 @@ edition = "2021"
|
||||
[dependencies]
|
||||
asusd = { path = "../asusd" }
|
||||
rog_anime = { path = "../rog-anime", features = ["dbus"] }
|
||||
rog_slash = { path = "../rog-slash", features = ["dbus"] }
|
||||
rog_aura = { path = "../rog-aura" }
|
||||
rog_profiles = { path = "../rog-profiles" }
|
||||
rog_platform = { path = "../rog-platform" }
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
pub use asusd::{DBUS_IFACE, DBUS_NAME, DBUS_PATH};
|
||||
|
||||
pub mod zbus_anime;
|
||||
pub mod zbus_aura;
|
||||
pub mod zbus_fan_curves;
|
||||
pub mod zbus_platform;
|
||||
pub mod zbus_slash;
|
||||
|
||||
// use rog_anime::AnimePowerStates;
|
||||
// use rog_aura::{AuraEffect, LedPowerStates};
|
||||
@@ -14,6 +16,7 @@ pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
|
||||
pub struct DbusProxiesBlocking<'a> {
|
||||
anime: zbus_anime::AnimeProxyBlocking<'a>,
|
||||
slash: zbus_slash::SlashProxyBlocking<'a>,
|
||||
led: zbus_aura::AuraProxyBlocking<'a>,
|
||||
profile: zbus_fan_curves::FanCurvesProxyBlocking<'a>,
|
||||
rog_bios: zbus_platform::PlatformProxyBlocking<'a>,
|
||||
@@ -27,6 +30,7 @@ impl<'a> DbusProxiesBlocking<'a> {
|
||||
Ok((
|
||||
DbusProxiesBlocking {
|
||||
anime: zbus_anime::AnimeProxyBlocking::new(&conn)?,
|
||||
slash: zbus_slash::SlashProxyBlocking::new(&conn)?,
|
||||
led: zbus_aura::AuraProxyBlocking::new(&conn)?,
|
||||
profile: zbus_fan_curves::FanCurvesProxyBlocking::new(&conn)?,
|
||||
rog_bios: zbus_platform::PlatformProxyBlocking::new(&conn)?,
|
||||
@@ -38,15 +42,13 @@ impl<'a> DbusProxiesBlocking<'a> {
|
||||
pub fn anime(&self) -> &zbus_anime::AnimeProxyBlocking<'a> {
|
||||
&self.anime
|
||||
}
|
||||
|
||||
pub fn slash(&self) -> &zbus_slash::SlashProxyBlocking<'a> { &self.slash }
|
||||
pub fn aura(&self) -> &zbus_aura::AuraProxyBlocking<'a> {
|
||||
&self.led
|
||||
}
|
||||
|
||||
pub fn fan_curves(&self) -> &zbus_fan_curves::FanCurvesProxyBlocking<'a> {
|
||||
&self.profile
|
||||
}
|
||||
|
||||
pub fn platform(&self) -> &zbus_platform::PlatformProxyBlocking<'a> {
|
||||
&self.rog_bios
|
||||
}
|
||||
@@ -71,6 +73,7 @@ impl<'a> RogDbusClientBlocking<'a> {
|
||||
|
||||
pub struct DbusProxies<'a> {
|
||||
anime: zbus_anime::AnimeProxy<'a>,
|
||||
slash: zbus_slash::SlashProxy<'a>,
|
||||
led: zbus_aura::AuraProxy<'a>,
|
||||
profile: zbus_fan_curves::FanCurvesProxy<'a>,
|
||||
rog_bios: zbus_platform::PlatformProxy<'a>,
|
||||
@@ -84,6 +87,7 @@ impl<'a> DbusProxies<'a> {
|
||||
Ok((
|
||||
DbusProxies {
|
||||
anime: zbus_anime::AnimeProxy::new(&conn).await?,
|
||||
slash: zbus_slash::SlashProxy::new(&conn).await?,
|
||||
led: zbus_aura::AuraProxy::new(&conn).await?,
|
||||
profile: zbus_fan_curves::FanCurvesProxy::new(&conn).await?,
|
||||
rog_bios: zbus_platform::PlatformProxy::new(&conn).await?,
|
||||
@@ -95,6 +99,7 @@ impl<'a> DbusProxies<'a> {
|
||||
pub fn anime(&self) -> &zbus_anime::AnimeProxy<'a> {
|
||||
&self.anime
|
||||
}
|
||||
pub fn slash(&self) -> &zbus_slash::SlashProxy<'a> { &self.slash }
|
||||
|
||||
pub fn led(&self) -> &zbus_aura::AuraProxy<'a> {
|
||||
&self.led
|
||||
|
||||
35
rog-dbus/src/zbus_slash.rs
Normal file
35
rog-dbus/src/zbus_slash.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
use zbus::proxy;
|
||||
|
||||
#[proxy(
|
||||
interface = "org.asuslinux.Slash",
|
||||
default_service = "org.asuslinux.Daemon",
|
||||
default_path = "/org/asuslinux"
|
||||
)]
|
||||
trait Slash {
|
||||
/// RunMainLoop method
|
||||
fn run_main_loop(&self, start: bool) -> zbus::Result<()>;
|
||||
|
||||
/// Brightness property
|
||||
#[zbus(property)]
|
||||
fn brightness(&self) -> zbus::Result<u8>;
|
||||
#[zbus(property)]
|
||||
fn set_brightness(&self, value: u8) -> zbus::Result<()>;
|
||||
|
||||
/// Interval property
|
||||
#[zbus(property)]
|
||||
fn interval(&self) -> zbus::Result<u8>;
|
||||
#[zbus(property)]
|
||||
fn set_interval(&self, value: u8) -> zbus::Result<()>;
|
||||
|
||||
/// BuiltinAnimations property
|
||||
#[zbus(property)]
|
||||
fn current_mode(&self) -> zbus::Result<u8>;
|
||||
#[zbus(property)]
|
||||
fn set_current_mode(&self, value: u8) -> zbus::Result<()>;
|
||||
|
||||
/// EnableDisplay property
|
||||
#[zbus(property)]
|
||||
fn enable_display(&self) -> zbus::Result<bool>;
|
||||
#[zbus(property)]
|
||||
fn set_enable_display(&self, value: bool) -> zbus::Result<()>;
|
||||
}
|
||||
Reference in New Issue
Block a user