diff --git a/asusctl/src/main.rs b/asusctl/src/main.rs index 2f06d4ed..4b12adab 100644 --- a/asusctl/src/main.rs +++ b/asusctl/src/main.rs @@ -151,6 +151,7 @@ where } if !paths.is_empty() { let mut ctrl = Vec::new(); + paths.sort_by(|a, b| a.cmp(&b)); for path in paths { ctrl.push( T::builder(&conn) @@ -1089,7 +1090,11 @@ fn handle_platform_new_properties( let attrs = attr.available_attrs()?; // dbg!(&name, &attrs); println!("{name}::"); - if attrs.contains(&"defalt_value".to_string()) { + if attrs.contains(&"current_value".to_string()) { + let v = attr.current_value()?; + println!(" current_value: {v}"); + } + if attrs.contains(&"default_value".to_string()) { let v = attr.default_value()?; println!(" default_value: {v:?}"); } @@ -1101,18 +1106,10 @@ fn handle_platform_new_properties( let v = attr.max_value()?; println!(" max_value: {v}"); } - if attrs.contains(&"scalar_increment".to_string()) { - let v = attr.scalar_increment()?; - println!(" scalar_increment: {v}"); - } if attrs.contains(&"possible_values".to_string()) { let v = attr.possible_values()?; println!(" possible_values: {v:?}"); } - if attrs.contains(&"current_value".to_string()) { - let v = attr.current_value()?; - println!(" current_value: {v}"); - } } } } diff --git a/asusd/src/asus_armoury.rs b/asusd/src/asus_armoury.rs index add0fe71..47bda2e3 100644 --- a/asusd/src/asus_armoury.rs +++ b/asusd/src/asus_armoury.rs @@ -1,11 +1,8 @@ -use rog_platform::firmware_attributes::FirmwareAttributes; -use zbus::Connection; - use log::error; -use rog_platform::firmware_attributes::{AttrValue, Attribute}; +use rog_platform::firmware_attributes::{AttrValue, Attribute, FirmwareAttributes}; use serde::{Deserialize, Serialize}; use zbus::zvariant::{ObjectPath, OwnedObjectPath, OwnedValue, Type, Value}; -use zbus::{fdo, interface}; +use zbus::{fdo, interface, Connection}; use crate::error::RogError; use crate::ASUS_ZBUS_PATH; diff --git a/asusd/src/aura_manager.rs b/asusd/src/aura_manager.rs index 5fc70038..5da1e08a 100644 --- a/asusd/src/aura_manager.rs +++ b/asusd/src/aura_manager.rs @@ -268,7 +268,7 @@ impl DeviceManager { found.push(path); } } else { - warn!("No serial for SCSI device"); + debug!("No serial for SCSI device: {:?}", device.devpath()); } } diff --git a/rog-control-center/src/main.rs b/rog-control-center/src/main.rs index 2ea6d4a6..ecdd2dfc 100644 --- a/rog-control-center/src/main.rs +++ b/rog-control-center/src/main.rs @@ -1,4 +1,3 @@ -use std::borrow::BorrowMut; use std::env::args; use std::path::{Path, PathBuf}; use std::process::exit; @@ -203,16 +202,6 @@ async fn main() -> Result<()> { exit(0); } } - - slint::invoke_from_event_loop(move || { - UI.with(|ui| { - let mut ui = ui.take(); - if let Some(ui) = ui.borrow_mut() { - ui.window().hide().unwrap(); - } - }); - }) - .unwrap(); } sleep(Duration::from_millis(300)); } @@ -223,42 +212,6 @@ async fn main() -> Result<()> { Ok(()) } -// /// Bah.. the icon dosn't work on wayland anyway, but we'll leave it in for -// now. fn load_icon() -> IconData { -// let path = PathBuf::from(APP_ICON_PATH); -// let mut rgba = Vec::new(); -// let mut height = 512; -// let mut width = 512; -// if path.exists() { -// if let Ok(data) = std::fs::read(path) -// .map_err(|e| error!("Error reading app icon: {e:?}")) -// .map_err(|e| error!("Error opening app icon: {e:?}")) -// { -// let data = std::io::Cursor::new(data); -// let decoder = png_pong::Decoder::new(data).unwrap().into_steps(); -// let png_pong::Step { raster, delay: _ } = -// decoder.last().unwrap().unwrap(); - -// if let png_pong::PngRaster::Rgba8(ras) = raster { -// rgba = ras.as_u8_slice().to_vec(); -// width = ras.width(); -// height = ras.height(); -// info!("Loaded app icon. Not actually supported in Wayland -// yet"); } -// } -// } else { -// error!("Missing {APP_ICON_PATH}"); -// } - -// IconData { -// height, -// width, -// rgba -// -// -// / } -// } - fn do_cli_help(parsed: &CliStart) -> bool { if parsed.help { println!("{}", CliStart::usage()); diff --git a/rog-control-center/translations/en/rog-control-center.po b/rog-control-center/translations/en/rog-control-center.po index f691529a..42216787 100644 --- a/rog-control-center/translations/en/rog-control-center.po +++ b/rog-control-center/translations/en/rog-control-center.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2024-12-27 08:21+0000\n" +"POT-Creation-Date: 2024-12-28 09:01+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/rog-dbus/src/asus_armoury.rs b/rog-dbus/src/asus_armoury.rs index aacd5dfb..2ce15a31 100644 --- a/rog-dbus/src/asus_armoury.rs +++ b/rog-dbus/src/asus_armoury.rs @@ -1,24 +1,7 @@ //! # D-Bus interface proxy for: `xyz.ljones.AsusArmoury` //! -//! This code was generated by `zbus-xmlgen` `5.0.1` from D-Bus introspection data. -//! Source: `Interface '/xyz/ljones/asus_armoury/nv_temp_target' from service 'xyz.ljones.Asusd' on system bus`. -//! -//! You may prefer to adapt it, instead of using it verbatim. -//! -//! More information can be found in the [Writing a client proxy] section of the zbus -//! documentation. -//! -//! This type implements the [D-Bus standard interfaces], (`org.freedesktop.DBus.*`) for which the -//! following zbus API can be used: -//! -//! * [`zbus::fdo::IntrospectableProxy`] -//! * [`zbus::fdo::PropertiesProxy`] -//! * [`zbus::fdo::PeerProxy`] -//! -//! Consequently `zbus-xmlgen` did not generate code for the above interfaces. -//! -//! [Writing a client proxy]: https://dbus2.github.io/zbus/client.html -//! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces, +//! `zbus-xmlgen system xyz.ljones.Asusd +//! /xyz/ljones/asus_armoury/nv_temp_target` use zbus::proxy; #[proxy( interface = "xyz.ljones.AsusArmoury", @@ -41,16 +24,18 @@ pub trait AsusArmoury { #[zbus(property)] fn default_value(&self) -> zbus::Result; - /// MaxValue property. Maximum allowed current_value. Returns `-1` if unused or not set. + /// MaxValue property. Maximum allowed current_value. Returns `-1` if unused + /// or not set. #[zbus(property)] fn max_value(&self) -> zbus::Result; - /// MinValue property. Minimum allowed current_value. Returns `-1` if unused or not set. + /// MinValue property. Minimum allowed current_value. Returns `-1` if unused + /// or not set. #[zbus(property)] fn min_value(&self) -> zbus::Result; - /// PossibleValues property. Return the allowed values for `current_value` if used or set, - /// otherwise the array is empty. + /// PossibleValues property. Return the allowed values for `current_value` + /// if used or set, otherwise the array is empty. #[zbus(property)] fn possible_values(&self) -> zbus::Result>; @@ -58,8 +43,8 @@ pub trait AsusArmoury { #[zbus(property)] fn name(&self) -> zbus::Result; - /// ScalarIncrement property. The increment steps that `current_value` may take. Returns - /// `-1` if not used or set. + /// ScalarIncrement property. The increment steps that `current_value` may + /// take. Returns `-1` if not used or set. #[zbus(property)] fn scalar_increment(&self) -> zbus::Result; } diff --git a/rog-platform/src/firmware_attributes.rs b/rog-platform/src/firmware_attributes.rs index 36f80dfa..c0dd621a 100644 --- a/rog-platform/src/firmware_attributes.rs +++ b/rog-platform/src/firmware_attributes.rs @@ -176,6 +176,9 @@ impl FirmwareAttributes { for entry in dir.flatten() { let base_path = entry.path(); let name = base_path.file_name().unwrap().to_string_lossy().to_string(); + if name == "pending_reboot" { + continue; + } let help = read_string(&base_path.join("display_name")).unwrap_or_default(); let (default_value, possible_values, min_value, max_value, scalar_increment) =