Rename dbus. Add asus_armoury client source

This commit is contained in:
Luke D. Jones
2024-12-26 21:36:07 +13:00
parent 62aa1fe04f
commit a1a9c7077a
29 changed files with 203 additions and 131 deletions

View File

@@ -132,8 +132,7 @@ where
T: ProxyImpl<'static> + From<zbus::Proxy<'static>>,
{
let conn = zbus::blocking::Connection::system().unwrap();
let f =
zbus::blocking::fdo::ObjectManagerProxy::new(&conn, "org.asuslinux.Daemon", "/").unwrap();
let f = zbus::blocking::fdo::ObjectManagerProxy::new(&conn, "xyz.ljones.Asusd", "/").unwrap();
let interfaces = f.get_managed_objects().unwrap();
let mut paths = Vec::new();
for v in interfaces.iter() {
@@ -155,7 +154,7 @@ where
ctrl.push(
T::builder(&conn)
.path(path.clone())?
.destination("org.asuslinux.Daemon")?
.destination("xyz.ljones.Asusd")?
.build()?,
);
}
@@ -201,7 +200,7 @@ fn do_parsed(
println!();
if let Some(cmdlist) = CliStart::command_list() {
let dev_type =
if let Ok(proxy) = find_iface::<AuraProxyBlocking>("org.asuslinux.Aura") {
if let Ok(proxy) = find_iface::<AuraProxyBlocking>("xyz.ljones.Aura") {
// TODO: commands on all?
proxy
.first()
@@ -214,32 +213,31 @@ fn do_parsed(
let commands: Vec<String> = cmdlist.lines().map(|s| s.to_owned()).collect();
for command in commands.iter().filter(|command| {
if command.trim().starts_with("fan-curve")
&& !supported_interfaces
.contains(&"org.asuslinux.FanCurves".to_string())
&& !supported_interfaces.contains(&"xyz.ljones.FanCurves".to_string())
{
return false;
}
if command.trim().starts_with("aura")
&& !supported_interfaces.contains(&"org.asuslinux.Aura".to_string())
&& !supported_interfaces.contains(&"xyz.ljones.Aura".to_string())
{
return false;
}
if command.trim().starts_with("anime")
&& !supported_interfaces.contains(&"org.asuslinux.Anime".to_string())
&& !supported_interfaces.contains(&"xyz.ljones.Anime".to_string())
{
return false;
}
if command.trim().starts_with("slash")
&& !supported_interfaces.contains(&"org.asuslinux.Slash".to_string())
&& !supported_interfaces.contains(&"xyz.ljones.Slash".to_string())
{
return false;
}
if command.trim().starts_with("platform")
&& !supported_interfaces.contains(&"org.asuslinux.Platform".to_string())
&& !supported_interfaces.contains(&"xyz.ljones.Platform".to_string())
{
return false;
}
@@ -267,7 +265,7 @@ fn do_parsed(
}
if let Some(brightness) = &parsed.kbd_bright {
if let Ok(aura) = find_iface::<AuraProxyBlocking>("org.asuslinux.Aura") {
if let Ok(aura) = find_iface::<AuraProxyBlocking>("xyz.ljones.Aura") {
for aura in aura.iter() {
match brightness.level() {
None => {
@@ -283,7 +281,7 @@ fn do_parsed(
}
if parsed.next_kbd_bright {
if let Ok(aura) = find_iface::<AuraProxyBlocking>("org.asuslinux.Aura") {
if let Ok(aura) = find_iface::<AuraProxyBlocking>("xyz.ljones.Aura") {
for aura in aura.iter() {
let brightness = aura.brightness()?;
aura.set_brightness(brightness.next())?;
@@ -294,7 +292,7 @@ fn do_parsed(
}
if parsed.prev_kbd_bright {
if let Ok(aura) = find_iface::<AuraProxyBlocking>("org.asuslinux.Aura") {
if let Ok(aura) = find_iface::<AuraProxyBlocking>("xyz.ljones.Aura") {
for aura in aura.iter() {
let brightness = aura.brightness()?;
aura.set_brightness(brightness.prev())?;
@@ -310,7 +308,7 @@ fn do_parsed(
"Supported Platform Properties:\n{:#?}",
supported_properties
);
if let Ok(aura) = find_iface::<AuraProxyBlocking>("org.asuslinux.Aura") {
if let Ok(aura) = find_iface::<AuraProxyBlocking>("xyz.ljones.Aura") {
// TODO: multiple RGB check
let bright = aura.first().unwrap().supported_brightness()?;
let modes = aura.first().unwrap().supported_basic_modes()?;
@@ -363,7 +361,7 @@ fn handle_anime(cmd: &AnimeCommand) -> Result<(), Box<dyn std::error::Error>> {
println!("\n{}", lst);
}
}
let animes = find_iface::<AnimeProxyBlocking>("org.asuslinux.Anime")?;
let animes = find_iface::<AnimeProxyBlocking>("xyz.ljones.Anime")?;
for proxy in animes {
if let Some(enable) = cmd.enable_display {
proxy.set_enable_display(enable)?;
@@ -556,7 +554,7 @@ fn handle_slash(cmd: &SlashCommand) -> Result<(), Box<dyn std::error::Error>> {
}
}
let slashes = find_iface::<SlashProxyBlocking>("org.asuslinux.Slash")?;
let slashes = find_iface::<SlashProxyBlocking>("xyz.ljones.Slash")?;
for proxy in slashes {
if cmd.enable {
proxy.set_enabled(true)?;
@@ -594,7 +592,7 @@ fn handle_scsi(cmd: &ScsiCommand) -> Result<(), Box<dyn std::error::Error>> {
}
}
let scsis = find_iface::<ScsiAuraProxyBlocking>("org.asuslinux.ScsiAura")?;
let scsis = find_iface::<ScsiAuraProxyBlocking>("xyz.ljones.ScsiAura")?;
for scsi in scsis {
if let Some(enable) = cmd.enable {
@@ -668,7 +666,7 @@ fn handle_led_mode(mode: &LedModeCommand) -> Result<(), Box<dyn std::error::Erro
if let Some(cmdlist) = LedModeCommand::command_list() {
let commands: Vec<String> = cmdlist.lines().map(|s| s.to_owned()).collect();
// TODO: multiple rgb check
let aura = find_iface::<AuraProxyBlocking>("org.asuslinux.Aura")?;
let aura = find_iface::<AuraProxyBlocking>("xyz.ljones.Aura")?;
let modes = aura.first().unwrap().supported_basic_modes()?;
for command in commands.iter().filter(|command| {
for mode in &modes {
@@ -698,7 +696,7 @@ fn handle_led_mode(mode: &LedModeCommand) -> Result<(), Box<dyn std::error::Erro
println!("Please specify either next or previous");
return Ok(());
}
let aura = find_iface::<AuraProxyBlocking>("org.asuslinux.Aura")?;
let aura = find_iface::<AuraProxyBlocking>("xyz.ljones.Aura")?;
if mode.next_mode {
for aura in aura {
let mode = aura.led_mode()?;
@@ -735,7 +733,7 @@ fn handle_led_mode(mode: &LedModeCommand) -> Result<(), Box<dyn std::error::Erro
}
fn handle_led_power1(power: &LedPowerCommand1) -> Result<(), Box<dyn std::error::Error>> {
let aura = find_iface::<AuraProxyBlocking>("org.asuslinux.Aura")?;
let aura = find_iface::<AuraProxyBlocking>("xyz.ljones.Aura")?;
for aura in aura {
let dev_type = aura.device_type()?;
if !dev_type.is_old_laptop() && !dev_type.is_tuf_laptop() {
@@ -795,7 +793,7 @@ fn handle_led_power_1_do_1866(
}
fn handle_led_power2(power: &LedPowerCommand2) -> Result<(), Box<dyn std::error::Error>> {
let aura = find_iface::<AuraProxyBlocking>("org.asuslinux.Aura")?;
let aura = find_iface::<AuraProxyBlocking>("xyz.ljones.Aura")?;
for aura in aura {
let dev_type = aura.device_type()?;
if !dev_type.is_new_laptop() {

View File

@@ -151,10 +151,7 @@ impl CtrlAnime<'static> {
pub async fn add_to_server(self, server: &mut zbus::Connection) {
server
.object_server()
.at(
&ObjectPath::from_str_unchecked("/org/asuslinux/Anime"),
self,
)
.at(&ObjectPath::from_str_unchecked("/xyz/ljones/Anime"), self)
.await
.map_err(|err| {
println!("CtrlAnime: add_to_server {}", err);
@@ -170,7 +167,7 @@ impl CtrlAnime<'static> {
// - Do actions
// - Write config if required
// - Unset inner_early_return
#[interface(name = "org.asuslinux.Daemon")]
#[interface(name = "xyz.ljones.Asusd")]
impl CtrlAnime<'static> {
pub fn insert_asus_gif(
&mut self,

View File

@@ -42,7 +42,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let early_return = Arc::new(AtomicBool::new(false));
// Set up the anime data and run loop/thread
if supported.contains(&"org.asuslinux.Anime".to_string()) {
if supported.contains(&"xyz.ljones.Anime".to_string()) {
if let Some(cfg) = config.active_anime {
let anime_type = get_anime_type();
let anime_config = ConfigAnime::new().set_name(cfg).load();

View File

@@ -1,8 +1,8 @@
//! # `DBus` interface proxy for: `org.asuslinux.Daemon`
//! # `DBus` interface proxy for: `xyz.ljones.Asusd`
//!
//! This code was generated by `zbus-xmlgen` `1.0.0` from `DBus` introspection
//! data. Source: `Interface '/org/asuslinux/Anime' from service
//! 'org.asuslinux.Daemon' on session bus`.
//! data. Source: `Interface '/xyz/ljones/Anime' from service
//! 'xyz.ljones.Asusd' on session bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!
@@ -23,10 +23,7 @@
use zbus::proxy;
#[proxy(
interface = "org.asuslinux.Daemon",
default_path = "/org/asuslinux/Anime"
)]
#[proxy(interface = "xyz.ljones.Asusd", default_path = "/xyz/ljones/Anime")]
trait Daemon {
/// InsertAsusGif method
fn insert_asus_gif(

View File

@@ -1,12 +1,11 @@
use crate::{error::RogError, ASUS_ZBUS_PATH};
use log::error;
use rog_platform::firmware_attributes::{AttrValue, Attribute};
use serde::{Deserialize, Serialize};
use zbus::{
fdo, interface,
zvariant::{ObjectPath, OwnedObjectPath, OwnedValue, Type, Value},
Connection,
};
use zbus::zvariant::{ObjectPath, OwnedObjectPath, OwnedValue, Type, Value};
use zbus::{fdo, interface, Connection};
use crate::error::RogError;
use crate::ASUS_ZBUS_PATH;
const MOD_NAME: &str = "asus_armoury";

View File

@@ -1,12 +1,11 @@
use crate::{error::RogError, ASUS_ZBUS_PATH};
use log::error;
use rog_platform::firmware_attributes::{AttrType, AttrValue, Attribute};
use serde::{Deserialize, Serialize};
use zbus::{
fdo, interface,
zvariant::{ObjectPath, OwnedObjectPath, OwnedValue, Type, Value},
Connection,
};
use zbus::zvariant::{ObjectPath, OwnedObjectPath, OwnedValue, Type, Value};
use zbus::{fdo, interface, Connection};
use crate::error::RogError;
use crate::ASUS_ZBUS_PATH;
const MOD_NAME: &str = "asus_armoury";
@@ -50,15 +49,10 @@ impl AsusArmouryAttribute {
}
#[zbus(property)]
fn attribute_type(&self) -> AttrType {
self.0.attribute_type()
}
#[zbus(property)]
async fn default_value(&self) -> i32 {
async fn default_value(&self) -> String {
match self.0.default_value() {
AttrValue::Integer(i) => *i,
_ => -1,
AttrValue::String(s) => *s,
_ => String::default(),
}
}

View File

@@ -1,12 +1,11 @@
use crate::{error::RogError, ASUS_ZBUS_PATH};
use log::error;
use rog_platform::firmware_attributes::{AttrValue, Attribute};
use serde::{Deserialize, Serialize};
use zbus::{
fdo, interface,
zvariant::{ObjectPath, OwnedObjectPath, OwnedValue, Type, Value},
Connection,
};
use zbus::zvariant::{ObjectPath, OwnedObjectPath, OwnedValue, Type, Value};
use zbus::{fdo, interface, Connection};
use crate::error::RogError;
use crate::ASUS_ZBUS_PATH;
const MOD_NAME: &str = "asus_armoury";
@@ -42,7 +41,8 @@ impl AsusArmouryAttribute {
}
}
/// If return is `-1` on a property then there is avilable value for that property
/// If return is `-1` on a property then there is avilable value for that
/// property
#[interface(name = "org.asuslinux.AsusArmoury")]
impl AsusArmouryAttribute {
#[zbus(property)]

View File

@@ -60,7 +60,7 @@ impl AniMeZbus {
// None of these calls can be guarnateed to succeed unless we loop until okay
// If the try_lock *does* succeed then any other thread trying to lock will not
// grab it until we finish.
#[interface(name = "org.asuslinux.Anime")]
#[interface(name = "xyz.ljones.Anime")]
impl AniMeZbus {
/// Writes a data stream of length. Will force system thread to exit until
/// it is restarted

View File

@@ -14,7 +14,7 @@ use crate::error::RogError;
use crate::{CtrlTask, Reloadable};
pub const AURA_ZBUS_NAME: &str = "Aura";
pub const AURA_ZBUS_PATH: &str = "/org/asuslinux";
pub const AURA_ZBUS_PATH: &str = "/xyz/ljones";
#[derive(Clone)]
pub struct AuraZbus(Aura);
@@ -50,7 +50,7 @@ impl AuraZbus {
/// The main interface for changing, reading, or notfying
///
/// LED commands are split between Brightness, Modes, Per-Key
#[interface(name = "org.asuslinux.Aura")]
#[interface(name = "xyz.ljones.Aura")]
impl AuraZbus {
/// Return the device type for this Aura keyboard
#[zbus(property)]
@@ -227,7 +227,7 @@ impl AuraZbus {
impl CtrlTask for AuraZbus {
fn zbus_path() -> &'static str {
"/org/asuslinux"
"/xyz/ljones"
}
async fn create_tasks(&self, _: SignalEmitter<'static>) -> Result<(), RogError> {

View File

@@ -34,7 +34,7 @@ impl ScsiZbus {
}
}
#[interface(name = "org.asuslinux.ScsiAura")]
#[interface(name = "xyz.ljones.ScsiAura")]
impl ScsiZbus {
/// Return the device type for this Aura keyboard
#[zbus(property)]

View File

@@ -36,7 +36,7 @@ impl SlashZbus {
}
}
#[interface(name = "org.asuslinux.Slash")]
#[interface(name = "xyz.ljones.Slash")]
impl SlashZbus {
/// Get enabled or not
#[zbus(property)]

View File

@@ -17,7 +17,7 @@ use crate::error::RogError;
use crate::{CtrlTask, CONFIG_PATH_BASE};
pub const FAN_CURVE_ZBUS_NAME: &str = "FanCurves";
pub const FAN_CURVE_ZBUS_PATH: &str = "/org/asuslinux";
pub const FAN_CURVE_ZBUS_PATH: &str = "/xyz/ljones";
#[derive(Deserialize, Serialize, Debug, Default)]
pub struct FanCurveConfig {
@@ -101,7 +101,7 @@ impl CtrlFanCurveZbus {
}
}
#[interface(name = "org.asuslinux.FanCurves")]
#[interface(name = "xyz.ljones.FanCurves")]
impl CtrlFanCurveZbus {
/// Set all fan curves for a profile to enabled status. Will also activate a
/// fan curve if in the same profile mode

View File

@@ -17,7 +17,7 @@ use crate::config::Config;
use crate::error::RogError;
use crate::{task_watch_item, task_watch_item_notify, CtrlTask, ReloadAndNotify};
const PLATFORM_ZBUS_PATH: &str = "/org/asuslinux";
const PLATFORM_ZBUS_PATH: &str = "/xyz/ljones";
macro_rules! platform_get_value {
($self:ident, $property:tt, $prop_name:literal) => {
@@ -302,7 +302,7 @@ impl CtrlPlatform {
}
}
#[interface(name = "org.asuslinux.Platform")]
#[interface(name = "xyz.ljones.Platform")]
impl CtrlPlatform {
#[zbus(property)]
async fn version(&self) -> String {

View File

@@ -31,11 +31,11 @@ use zbus::Connection;
use crate::error::RogError;
const CONFIG_PATH_BASE: &str = "/etc/asusd/";
pub const ASUS_ZBUS_PATH: &str = "/org/asuslinux";
pub const ASUS_ZBUS_PATH: &str = "/xyz/ljones";
pub static DBUS_NAME: &str = "org.asuslinux.Daemon";
pub static DBUS_PATH: &str = "/org/asuslinux/Daemon";
pub static DBUS_IFACE: &str = "org.asuslinux.Daemon";
pub static DBUS_NAME: &str = "xyz.ljones.Asusd";
pub static DBUS_PATH: &str = "/xyz/ljones/Daemon";
pub static DBUS_IFACE: &str = "xyz.ljones.Asusd";
/// This macro adds a function which spawns an `inotify` task on the passed in
/// `Executor`.

View File

@@ -3,24 +3,24 @@
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<policy group="adm">
<allow send_destination="org.asuslinux.Daemon"/>
<allow receive_sender="org.asuslinux.Daemon"/>
<allow send_destination="xyz.ljones.Asusd"/>
<allow receive_sender="xyz.ljones.Asusd"/>
</policy>
<policy group="sudo">
<allow send_destination="org.asuslinux.Daemon"/>
<allow receive_sender="org.asuslinux.Daemon"/>
<allow send_destination="xyz.ljones.Asusd"/>
<allow receive_sender="xyz.ljones.Asusd"/>
</policy>
<policy group="users">
<allow send_destination="org.asuslinux.Daemon"/>
<allow receive_sender="org.asuslinux.Daemon"/>
<allow send_destination="xyz.ljones.Asusd"/>
<allow receive_sender="xyz.ljones.Asusd"/>
</policy>
<policy group="wheel">
<allow send_destination="org.asuslinux.Daemon"/>
<allow receive_sender="org.asuslinux.Daemon"/>
<allow send_destination="xyz.ljones.Asusd"/>
<allow receive_sender="xyz.ljones.Asusd"/>
</policy>
<policy user="root">
<allow own="org.asuslinux.Daemon"/>
<allow send_destination="org.asuslinux.Daemon"/>
<allow receive_sender="org.asuslinux.Daemon"/>
<allow own="xyz.ljones.Asusd"/>
<allow send_destination="xyz.ljones.Asusd"/>
<allow receive_sender="xyz.ljones.Asusd"/>
</policy>
</busconfig>

View File

@@ -112,10 +112,10 @@ pub fn setup_window(config: Arc<Mutex<Config>>) -> MainWindow {
ui.set_sidebar_items_avilable(
[
// Needs to match the order of slint sidebar items
available.contains(&"org.asuslinux.Platform".to_string()),
available.contains(&"org.asuslinux.Aura".to_string()),
available.contains(&"org.asuslinux.Anime".to_string()),
available.contains(&"org.asuslinux.FanCurves".to_string()),
available.contains(&"xyz.ljones.Platform".to_string()),
available.contains(&"xyz.ljones.Aura".to_string()),
available.contains(&"xyz.ljones.Anime".to_string()),
available.contains(&"xyz.ljones.FanCurves".to_string()),
true,
true,
]
@@ -127,17 +127,17 @@ pub fn setup_window(config: Arc<Mutex<Config>>) -> MainWindow {
});
setup_app_settings_page(&ui, config.clone());
if available.contains(&"org.asuslinux.Platform".to_string()) {
if available.contains(&"xyz.ljones.Platform".to_string()) {
setup_system_page(&ui, config.clone());
setup_system_page_callbacks(&ui, config.clone());
}
if available.contains(&"org.asuslinux.Aura".to_string()) {
if available.contains(&"xyz.ljones.Aura".to_string()) {
setup_aura_page(&ui, config.clone());
}
if available.contains(&"org.asuslinux.Anime".to_string()) {
if available.contains(&"xyz.ljones.Anime".to_string()) {
setup_anime_page(&ui, config.clone());
}
if available.contains(&"org.asuslinux.FanCurves".to_string()) {
if available.contains(&"xyz.ljones.FanCurves".to_string()) {
setup_fan_curve_page(&ui, config);
}
ui

View File

@@ -38,12 +38,12 @@ fn decode_hex(s: &str) -> RgbaColor<u8> {
// TODO: return all
async fn find_aura_iface() -> Result<AuraProxy<'static>, Box<dyn std::error::Error>> {
let conn = zbus::Connection::system().await?;
let f = zbus::fdo::ObjectManagerProxy::new(&conn, "org.asuslinux.Daemon", "/").await?;
let f = zbus::fdo::ObjectManagerProxy::new(&conn, "xyz.ljones.Asusd", "/").await?;
let interfaces = f.get_managed_objects().await?;
let mut aura_paths = Vec::new();
for v in interfaces.iter() {
for k in v.1.keys() {
if k.as_str() == "org.asuslinux.Aura" {
if k.as_str() == "xyz.ljones.Aura" {
println!("Found aura device at {}, {}", v.0, k);
aura_paths.push(v.0.clone());
}
@@ -56,7 +56,7 @@ async fn find_aura_iface() -> Result<AuraProxy<'static>, Box<dyn std::error::Err
if let Some(path) = aura_paths.first() {
return Ok(AuraProxy::builder(&conn)
.path(path.clone())?
.destination("org.asuslinux.Daemon")?
.destination("xyz.ljones.Asusd")?
.build()
.await?);
}

View File

@@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-12-25 06:28+0000\n"
"POT-Creation-Date: 2024-12-26 08:35+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@@ -0,0 +1,33 @@
//! Path for iface is such as "/xyz/ljones/asus_armoury/boot_sound"
use zbus::proxy;
#[proxy(
interface = "xyz.ljones.AsusArmoury",
default_service = "xyz.ljones.Asusd"
)]
pub trait AsusArmoury {
/// CurrentValue property
#[zbus(property)]
fn current_value(&self) -> zbus::Result<i32>;
#[zbus(property)]
fn set_current_value(&self, value: i32) -> zbus::Result<()>;
/// DefaultValue property
#[zbus(property)]
fn default_value(&self) -> zbus::Result<i32>;
/// MaxValue property
#[zbus(property)]
fn max_value(&self) -> zbus::Result<i32>;
/// MinValue property
#[zbus(property)]
fn min_value(&self) -> zbus::Result<i32>;
/// Name property
#[zbus(property)]
fn name(&self) -> zbus::Result<String>;
/// ScalarIncrement property
#[zbus(property)]
fn scalar_increment(&self) -> zbus::Result<i32>;
}

View File

@@ -0,0 +1,25 @@
//! Path for iface is such as "/xyz/ljones/asus_armoury/boot_sound"
use zbus::proxy;
#[proxy(
interface = "xyz.ljones.AsusArmoury",
default_service = "xyz.ljones.Asusd"
)]
pub trait AsusArmoury {
/// CurrentValue property
#[zbus(property)]
fn current_value(&self) -> zbus::Result<String>;
#[zbus(property)]
fn set_current_value(&self, value: String) -> zbus::Result<()>;
/// DefaultValue property
#[zbus(property)]
fn default_value(&self) -> zbus::Result<String>;
/// Name property
#[zbus(property)]
fn name(&self) -> zbus::Result<String>;
/// PossibleValues property
#[zbus(property)]
fn possible_values(&self) -> zbus::Result<Vec<String>>;
}

View File

@@ -0,0 +1,25 @@
use zbus::proxy;
#[proxy(
interface = "xyz.ljones.AsusArmoury",
default_service = "xyz.ljones.Asusd",
default_path = "/xyz/ljones/asus_armoury/boot_sound"
)]
pub trait AsusArmoury {
/// CurrentValue property
#[zbus(property)]
fn current_value(&self) -> zbus::Result<i32>;
#[zbus(property)]
fn set_current_value(&self, value: i32) -> zbus::Result<()>;
/// DefaultValue property
#[zbus(property)]
fn default_value(&self) -> zbus::Result<i32>;
/// Name property
#[zbus(property)]
fn name(&self) -> zbus::Result<String>;
/// PossibleValues property
#[zbus(property)]
fn possible_values(&self) -> zbus::Result<Vec<i32>>;
}

View File

@@ -0,0 +1,3 @@
pub mod attr_enum_int;
pub mod attr_enum_str;
pub mod attr_int;

View File

@@ -1,5 +1,6 @@
pub use asusd::{DBUS_IFACE, DBUS_NAME, DBUS_PATH};
pub mod asus_armoury;
pub mod scsi_aura;
pub mod zbus_anime;
pub mod zbus_aura;
@@ -11,7 +12,7 @@ pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub fn list_iface_blocking() -> Result<Vec<String>, Box<dyn std::error::Error>> {
let conn = zbus::blocking::Connection::system()?;
let f = zbus::blocking::fdo::ObjectManagerProxy::new(&conn, "org.asuslinux.Daemon", "/")?;
let f = zbus::blocking::fdo::ObjectManagerProxy::new(&conn, "xyz.ljones.Asusd", "/")?;
let interfaces = f.get_managed_objects()?;
let mut ifaces = Vec::new();
for v in interfaces.iter() {
@@ -24,7 +25,7 @@ pub fn list_iface_blocking() -> Result<Vec<String>, Box<dyn std::error::Error>>
pub fn has_iface_blocking(iface: &str) -> Result<bool, Box<dyn std::error::Error>> {
let conn = zbus::blocking::Connection::system()?;
let f = zbus::blocking::fdo::ObjectManagerProxy::new(&conn, "org.asuslinux.Daemon", "/")?;
let f = zbus::blocking::fdo::ObjectManagerProxy::new(&conn, "xyz.ljones.Asusd", "/")?;
let interfaces = f.get_managed_objects()?;
for v in interfaces.iter() {
for k in v.1.keys() {
@@ -38,7 +39,7 @@ pub fn has_iface_blocking(iface: &str) -> Result<bool, Box<dyn std::error::Error
pub async fn has_iface(iface: &str) -> Result<bool, Box<dyn std::error::Error>> {
let conn = zbus::Connection::system().await?;
let f = zbus::fdo::ObjectManagerProxy::new(&conn, "org.asuslinux.Daemon", "/").await?;
let f = zbus::fdo::ObjectManagerProxy::new(&conn, "xyz.ljones.Asusd", "/").await?;
let interfaces = f.get_managed_objects().await?;
for v in interfaces.iter() {
for k in v.1.keys() {

View File

@@ -1,8 +1,8 @@
//! # D-Bus interface proxy for: `org.asuslinux.ScsiAura`
//! # D-Bus interface proxy for: `xyz.ljones.ScsiAura`
//!
//! This code was generated by `zbus-xmlgen` `5.0.1` from D-Bus introspection
//! data. Source: `Interface '/org/asuslinux/M3D0AP048745_scsi' from service
//! 'org.asuslinux.Daemon' on system bus`.
//! data. Source: `Interface '/xyz/ljones/M3D0AP048745_scsi' from service
//! 'xyz.ljones.Asusd' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!
@@ -23,9 +23,9 @@
use rog_scsi::{AuraEffect, AuraMode};
use zbus::proxy;
#[proxy(
interface = "org.asuslinux.ScsiAura",
default_service = "org.asuslinux.Daemon",
default_path = "/org/asuslinux"
interface = "xyz.ljones.ScsiAura",
default_service = "xyz.ljones.Asusd",
default_path = "/xyz/ljones"
)]
pub trait ScsiAura {
/// AllModeData method

View File

@@ -3,9 +3,9 @@ use rog_anime::{Animations, AnimeDataBuffer, DeviceState as AnimeDeviceState};
use zbus::proxy;
#[proxy(
interface = "org.asuslinux.Anime",
default_service = "org.asuslinux.Daemon",
default_path = "/org/asuslinux"
interface = "xyz.ljones.Anime",
default_service = "xyz.ljones.Asusd",
default_path = "/xyz/ljones"
)]
pub trait Anime {
/// DeviceState method

View File

@@ -1,8 +1,8 @@
//! # `DBus` interface proxy for: `org.asuslinux.Daemon`
//! # `DBus` interface proxy for: `xyz.ljones.Asusd`
//!
//! This code was generated by `zbus-xmlgen` `1.0.0` from `DBus` introspection
//! data. Source: `Interface '/org/asuslinux/Aura' from service
//! 'org.asuslinux.Daemon' on system bus`.
//! data. Source: `Interface '/xyz/ljones/Aura' from service
//! 'xyz.ljones.Asusd' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!
@@ -30,9 +30,9 @@ use zbus::{proxy, Result};
const BLOCKING_TIME: u64 = 33; // 100ms = 10 FPS, max 50ms = 20 FPS, 40ms = 25 FPS
#[proxy(
interface = "org.asuslinux.Aura",
default_service = "org.asuslinux.Daemon",
default_path = "/org/asuslinux/Aura"
interface = "xyz.ljones.Aura",
default_service = "xyz.ljones.Asusd",
default_path = "/xyz/ljones/Aura"
)]
pub trait Aura {
/// AllModeData method

View File

@@ -1,8 +1,8 @@
//! # `DBus` interface proxy for: `org.asuslinux.Daemon`
//! # `DBus` interface proxy for: `xyz.ljones.Asusd`
//!
//! This code was generated by `zbus-xmlgen` `1.0.0` from `DBus` introspection
//! data. Source: `Interface '/org/asuslinux/Profile' from service
//! 'org.asuslinux.Daemon' on system bus`.
//! data. Source: `Interface '/xyz/ljones/Profile' from service
//! 'xyz.ljones.Asusd' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!
@@ -26,9 +26,9 @@ use rog_profiles::FanCurvePU;
use zbus::proxy;
#[proxy(
interface = "org.asuslinux.FanCurves",
default_service = "org.asuslinux.Daemon",
default_path = "/org/asuslinux"
interface = "xyz.ljones.FanCurves",
default_service = "xyz.ljones.Asusd",
default_path = "/xyz/ljones"
)]
pub trait FanCurves {
/// Get the fan-curve data for the currently active PlatformProfile

View File

@@ -1,8 +1,8 @@
//! # `DBus` interface proxy for: `org.asuslinux.Daemon`
//! # `DBus` interface proxy for: `xyz.ljones.Asusd`
//!
//! This code was generated by `zbus-xmlgen` `1.0.0` from `DBus` introspection
//! data. Source: `Interface '/org/asuslinux/Platform' from service
//! 'org.asuslinux.Daemon' on system bus`.
//! data. Source: `Interface '/xyz/ljones/Platform' from service
//! 'xyz.ljones.Asusd' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!
@@ -25,9 +25,9 @@ use rog_platform::platform::{GpuMode, Properties, ThrottlePolicy};
use zbus::proxy;
#[proxy(
interface = "org.asuslinux.Platform",
default_service = "org.asuslinux.Daemon",
default_path = "/org/asuslinux"
interface = "xyz.ljones.Platform",
default_service = "xyz.ljones.Asusd",
default_path = "/xyz/ljones"
)]
pub trait Platform {
#[zbus(property)]

View File

@@ -2,9 +2,9 @@ use rog_slash::SlashMode;
use zbus::proxy;
#[proxy(
interface = "org.asuslinux.Slash",
default_service = "org.asuslinux.Daemon",
default_path = "/org/asuslinux"
interface = "xyz.ljones.Slash",
default_service = "xyz.ljones.Asusd",
default_path = "/xyz/ljones"
)]
pub trait Slash {
/// EnableDisplay property