mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 17:33:19 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2726f3a67 | ||
|
|
663f87d5e2 | ||
|
|
377bb4d6ad | ||
|
|
98e60db2da |
@@ -2,8 +2,16 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [v6.1.2]
|
||||
|
||||
### Changed
|
||||
- Try a slightly different tact to fix charge control slider
|
||||
|
||||
## [v6.1.1]
|
||||
|
||||
### Changed
|
||||
- Fix aura data matching
|
||||
- Fix charge control slider
|
||||
|
||||
## [v6.1.0]
|
||||
|
||||
|
||||
30
Cargo.lock
generated
30
Cargo.lock
generated
@@ -158,7 +158,7 @@ checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b"
|
||||
|
||||
[[package]]
|
||||
name = "asusctl"
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
dependencies = [
|
||||
"dmi_id",
|
||||
"env_logger",
|
||||
@@ -177,7 +177,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "asusd"
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
dependencies = [
|
||||
"cargo-husky",
|
||||
"concat-idents",
|
||||
@@ -185,6 +185,7 @@ dependencies = [
|
||||
"dmi_id",
|
||||
"env_logger",
|
||||
"futures-lite",
|
||||
"futures-util",
|
||||
"inotify",
|
||||
"log",
|
||||
"logind-zbus",
|
||||
@@ -203,7 +204,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "asusd-user"
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
dependencies = [
|
||||
"config-traits",
|
||||
"dirs",
|
||||
@@ -940,7 +941,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "config-traits"
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"ron",
|
||||
@@ -1332,7 +1333,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dmi_id"
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"udev 0.8.0",
|
||||
@@ -4570,7 +4571,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog-control-center"
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
dependencies = [
|
||||
"asusd",
|
||||
"concat-idents",
|
||||
@@ -4579,6 +4580,7 @@ dependencies = [
|
||||
"dirs",
|
||||
"dmi_id",
|
||||
"env_logger",
|
||||
"futures-util",
|
||||
"gumdrop",
|
||||
"image",
|
||||
"ksni",
|
||||
@@ -4600,7 +4602,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_anime"
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
dependencies = [
|
||||
"dmi_id",
|
||||
"gif 0.12.0",
|
||||
@@ -4614,7 +4616,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_aura"
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
dependencies = [
|
||||
"dmi_id",
|
||||
"log",
|
||||
@@ -4625,7 +4627,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_dbus"
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
dependencies = [
|
||||
"asusd",
|
||||
"rog_anime",
|
||||
@@ -4639,7 +4641,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_platform"
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
dependencies = [
|
||||
"concat-idents",
|
||||
"inotify",
|
||||
@@ -4652,7 +4654,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_profiles"
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"rog_platform",
|
||||
@@ -4663,7 +4665,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_scsi"
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
dependencies = [
|
||||
"ron",
|
||||
"serde",
|
||||
@@ -4673,7 +4675,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_simulators"
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
dependencies = [
|
||||
"log",
|
||||
"rog_anime",
|
||||
@@ -4683,7 +4685,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rog_slash"
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
dependencies = [
|
||||
"dmi_id",
|
||||
"serde",
|
||||
|
||||
15
Cargo.toml
15
Cargo.toml
@@ -1,5 +1,5 @@
|
||||
[workspace.package]
|
||||
version = "6.1.0"
|
||||
version = "6.1.2"
|
||||
rust-version = "1.82"
|
||||
license = "MPL-2.0"
|
||||
readme = "README.md"
|
||||
@@ -43,7 +43,8 @@ dirs = "^4.0"
|
||||
smol = "^2.0"
|
||||
mio = "0.8.11"
|
||||
|
||||
zbus = "5.1"
|
||||
futures-util = "0.3.31"
|
||||
zbus = "5.1.1"
|
||||
logind-zbus = { version = "5.0.0" } #, default-features = false, features = ["non_blocking"] }
|
||||
|
||||
serde = { version = "^1.0", features = ["serde_derive"] }
|
||||
@@ -65,26 +66,26 @@ gif = "^0.12.0"
|
||||
|
||||
versions = "6.2"
|
||||
|
||||
notify-rust = { version = "4.11.0", features = ["z", "async"] }
|
||||
notify-rust = { version = "4.11.4", features = ["z", "async"] }
|
||||
|
||||
sg = { git = "https://github.com/flukejones/sg-rs.git" }
|
||||
|
||||
[profile.release]
|
||||
# thin = 57s, asusd = 9.0M
|
||||
# fat = 72s, asusd = 6.4M
|
||||
lto = "fat"
|
||||
lto = "thin"
|
||||
debug = false
|
||||
opt-level = 3
|
||||
panic = "abort"
|
||||
codegen-units = 1
|
||||
# codegen-units = 1
|
||||
|
||||
[profile.dev]
|
||||
opt-level = 1
|
||||
codegen-units = 16
|
||||
# codegen-units = 1
|
||||
|
||||
[profile.dev.package."*"]
|
||||
opt-level = 1
|
||||
codegen-units = 16
|
||||
# codegen-units = 1
|
||||
|
||||
[profile.bench]
|
||||
debug = false
|
||||
|
||||
@@ -34,6 +34,7 @@ tokio.workspace = true
|
||||
log.workspace = true
|
||||
env_logger.workspace = true
|
||||
|
||||
futures-util.workspace = true
|
||||
zbus.workspace = true
|
||||
logind-zbus.workspace = true
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use ::zbus::export::futures_util::lock::Mutex;
|
||||
use config_traits::StdConfig;
|
||||
use futures_util::lock::Mutex;
|
||||
use log::{debug, error, info};
|
||||
use rog_platform::asus_armoury::{AttrValue, Attribute, FirmwareAttribute, FirmwareAttributes};
|
||||
use rog_platform::platform::{PlatformProfile, RogPlatform};
|
||||
@@ -66,7 +66,7 @@ impl AsusArmouryAttribute {
|
||||
&mut self,
|
||||
signal_ctxt: SignalEmitter<'static>
|
||||
) -> Result<(), RogError> {
|
||||
use zbus::export::futures_util::StreamExt;
|
||||
use futures_util::StreamExt;
|
||||
|
||||
let name = self.name();
|
||||
macro_rules! watch_value_notify {
|
||||
|
||||
@@ -8,6 +8,7 @@ use std::sync::Arc;
|
||||
use std::thread::sleep;
|
||||
|
||||
use config_traits::StdConfig;
|
||||
use futures_util::lock::Mutex;
|
||||
use log::{debug, error, info, warn};
|
||||
use rog_anime::usb::{
|
||||
pkt_flush, pkt_set_brightness, pkt_set_enable_display, pkt_set_enable_powersave_anim,
|
||||
@@ -16,7 +17,6 @@ use rog_anime::usb::{
|
||||
use rog_anime::{ActionData, AnimeDataBuffer, AnimePacketType};
|
||||
use rog_platform::hid_raw::HidRaw;
|
||||
use rog_platform::usb_raw::USBRaw;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use self::config::{AniMeConfig, AniMeConfigCached};
|
||||
use crate::error::RogError;
|
||||
@@ -51,7 +51,7 @@ impl AniMe {
|
||||
|
||||
/// Will fail if something is already holding the config lock
|
||||
async fn do_init_cache(&mut self) {
|
||||
if let Ok(mut config) = self.config.try_lock() {
|
||||
if let Some(mut config) = self.config.try_lock() {
|
||||
if let Err(e) = self.cache.init_from_config(&config, config.anime_type) {
|
||||
error!(
|
||||
"Trying to cache the Anime Config failed, will reset to default config: {e:?}"
|
||||
|
||||
@@ -81,7 +81,7 @@ impl AniMeZbus {
|
||||
/// Set base brightness level
|
||||
#[zbus(property)]
|
||||
async fn brightness(&self) -> Brightness {
|
||||
if let Ok(config) = self.0.config.try_lock() {
|
||||
if let Some(config) = self.0.config.try_lock() {
|
||||
return config.display_brightness;
|
||||
}
|
||||
Brightness::Off
|
||||
@@ -113,7 +113,7 @@ impl AniMeZbus {
|
||||
|
||||
#[zbus(property)]
|
||||
async fn builtins_enabled(&self) -> bool {
|
||||
if let Ok(config) = self.0.config.try_lock() {
|
||||
if let Some(config) = self.0.config.try_lock() {
|
||||
return config.builtin_anims_enabled;
|
||||
}
|
||||
false
|
||||
@@ -158,7 +158,7 @@ impl AniMeZbus {
|
||||
|
||||
#[zbus(property)]
|
||||
async fn builtin_animations(&self) -> Animations {
|
||||
if let Ok(config) = self.0.config.try_lock() {
|
||||
if let Some(config) = self.0.config.try_lock() {
|
||||
return config.builtin_anims;
|
||||
}
|
||||
Animations::default()
|
||||
@@ -191,7 +191,7 @@ impl AniMeZbus {
|
||||
|
||||
#[zbus(property)]
|
||||
async fn enable_display(&self) -> bool {
|
||||
if let Ok(config) = self.0.config.try_lock() {
|
||||
if let Some(config) = self.0.config.try_lock() {
|
||||
return config.display_enabled;
|
||||
}
|
||||
false
|
||||
@@ -214,7 +214,7 @@ impl AniMeZbus {
|
||||
|
||||
#[zbus(property)]
|
||||
async fn off_when_unplugged(&self) -> bool {
|
||||
if let Ok(config) = self.0.config.try_lock() {
|
||||
if let Some(config) = self.0.config.try_lock() {
|
||||
return config.off_when_unplugged;
|
||||
}
|
||||
false
|
||||
@@ -241,7 +241,7 @@ impl AniMeZbus {
|
||||
|
||||
#[zbus(property)]
|
||||
async fn off_when_suspended(&self) -> bool {
|
||||
if let Ok(config) = self.0.config.try_lock() {
|
||||
if let Some(config) = self.0.config.try_lock() {
|
||||
return config.off_when_suspended;
|
||||
}
|
||||
false
|
||||
@@ -257,7 +257,7 @@ impl AniMeZbus {
|
||||
|
||||
#[zbus(property)]
|
||||
async fn off_when_lid_closed(&self) -> bool {
|
||||
if let Ok(config) = self.0.config.try_lock() {
|
||||
if let Some(config) = self.0.config.try_lock() {
|
||||
return config.off_when_lid_closed;
|
||||
}
|
||||
false
|
||||
|
||||
@@ -2,13 +2,13 @@ use std::sync::Arc;
|
||||
|
||||
use config::AuraConfig;
|
||||
use config_traits::StdConfig;
|
||||
use futures_util::lock::{Mutex, MutexGuard};
|
||||
use log::info;
|
||||
use rog_aura::keyboard::{AuraLaptopUsbPackets, LedUsbPackets};
|
||||
use rog_aura::usb::{AURA_LAPTOP_LED_APPLY, AURA_LAPTOP_LED_SET};
|
||||
use rog_aura::{AuraDeviceType, AuraEffect, LedBrightness, PowerZones, AURA_LAPTOP_LED_MSG_LEN};
|
||||
use rog_platform::hid_raw::HidRaw;
|
||||
use rog_platform::keyboard_led::KeyboardBacklight;
|
||||
use tokio::sync::{Mutex, MutexGuard};
|
||||
|
||||
use crate::error::RogError;
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ impl AuraZbus {
|
||||
// entirely possible to deadlock here, so use try instead of lock()
|
||||
// let ctrl = self.0.lock().await;
|
||||
// Ok(config.current_mode)
|
||||
if let Ok(config) = self.0.config.try_lock() {
|
||||
if let Some(config) = self.0.config.try_lock() {
|
||||
Ok(config.current_mode)
|
||||
} else {
|
||||
Err(ZbErr::Failed("Aura control couldn't lock self".to_string()))
|
||||
@@ -140,7 +140,7 @@ impl AuraZbus {
|
||||
#[zbus(property)]
|
||||
async fn led_mode_data(&self) -> Result<AuraEffect, ZbErr> {
|
||||
// entirely possible to deadlock here, so use try instead of lock()
|
||||
if let Ok(config) = self.0.config.try_lock() {
|
||||
if let Some(config) = self.0.config.try_lock() {
|
||||
let mode = config.current_mode;
|
||||
match config.builtins.get(&mode) {
|
||||
Some(effect) => Ok(effect.clone()),
|
||||
|
||||
@@ -8,11 +8,11 @@ use std::sync::Arc;
|
||||
|
||||
use dmi_id::DMIID;
|
||||
use futures_lite::future::block_on;
|
||||
use futures_util::lock::Mutex;
|
||||
use log::{debug, error, info, warn};
|
||||
use mio::{Events, Interest, Poll, Token};
|
||||
use rog_platform::error::PlatformError;
|
||||
use rog_platform::hid_raw::HidRaw;
|
||||
use tokio::sync::Mutex;
|
||||
use udev::{Device, MonitorBuilder};
|
||||
use zbus::zvariant::{ObjectPath, OwnedObjectPath};
|
||||
use zbus::Connection;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use config::ScsiConfig;
|
||||
use futures_util::lock::{Mutex, MutexGuard};
|
||||
use rog_scsi::{AuraEffect, Device, Task};
|
||||
use tokio::sync::{Mutex, MutexGuard};
|
||||
|
||||
use crate::error::RogError;
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ impl ScsiZbus {
|
||||
#[zbus(property)]
|
||||
async fn led_mode_data(&self) -> Result<AuraEffect, ZbErr> {
|
||||
// entirely possible to deadlock here, so use try instead of lock()
|
||||
if let Ok(config) = self.0.config.try_lock() {
|
||||
if let Some(config) = self.0.config.try_lock() {
|
||||
let mode = config.current_mode;
|
||||
match config.modes.get(&mode) {
|
||||
Some(effect) => Ok(effect.clone()),
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use config::SlashConfig;
|
||||
use futures_util::lock::{Mutex, MutexGuard};
|
||||
use rog_platform::hid_raw::HidRaw;
|
||||
use rog_platform::usb_raw::USBRaw;
|
||||
use rog_slash::usb::{get_options_packet, pkt_set_mode, pkts_for_init};
|
||||
use rog_slash::SlashType;
|
||||
use tokio::sync::{Mutex, MutexGuard};
|
||||
|
||||
use crate::error::RogError;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use config_traits::{StdConfig, StdConfigLoad};
|
||||
use futures_util::lock::Mutex;
|
||||
use log::{debug, error, info};
|
||||
use rog_anime::error::AnimeError;
|
||||
use rog_anime::usb::get_anime_type;
|
||||
@@ -12,7 +13,6 @@ use rog_platform::usb_raw::USBRaw;
|
||||
use rog_scsi::{open_device, ScsiType};
|
||||
use rog_slash::error::SlashError;
|
||||
use rog_slash::SlashType;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use crate::aura_anime::config::AniMeConfig;
|
||||
use crate::aura_anime::AniMe;
|
||||
|
||||
@@ -3,13 +3,13 @@ use std::sync::Arc;
|
||||
|
||||
use config_traits::{StdConfig, StdConfigLoad};
|
||||
use futures_lite::StreamExt;
|
||||
use futures_util::lock::Mutex;
|
||||
use log::{debug, error, info, warn};
|
||||
use rog_platform::platform::{PlatformProfile, RogPlatform};
|
||||
use rog_profiles::error::ProfileError;
|
||||
use rog_profiles::fan_curve_set::CurveData;
|
||||
use rog_profiles::{find_fan_curve_node, FanCurvePU, FanCurveProfiles};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tokio::sync::Mutex;
|
||||
use zbus::object_server::SignalEmitter;
|
||||
use zbus::{interface, Connection};
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@ use std::process::Command;
|
||||
use std::sync::Arc;
|
||||
|
||||
use config_traits::StdConfig;
|
||||
use futures_util::lock::Mutex;
|
||||
use log::{debug, error, info, warn};
|
||||
use rog_platform::asus_armoury::{AttrValue, FirmwareAttribute, FirmwareAttributes};
|
||||
use rog_platform::cpu::{CPUControl, CPUGovernor, CPUEPP};
|
||||
use rog_platform::platform::{PlatformProfile, Properties, RogPlatform};
|
||||
use rog_platform::power::AsusPower;
|
||||
use zbus::export::futures_util::lock::Mutex;
|
||||
use zbus::fdo::Error as FdoErr;
|
||||
use zbus::object_server::SignalEmitter;
|
||||
use zbus::{interface, Connection};
|
||||
@@ -72,7 +72,7 @@ impl CtrlPlatform {
|
||||
let mut inotify_self = ret_self.clone();
|
||||
|
||||
tokio::spawn(async move {
|
||||
use zbus::export::futures_util::StreamExt;
|
||||
use futures_util::StreamExt;
|
||||
info!("Starting inotify watch for asusd config file");
|
||||
|
||||
let mut buffer = [0; 32];
|
||||
|
||||
@@ -2,7 +2,6 @@ use std::env;
|
||||
use std::error::Error;
|
||||
use std::sync::Arc;
|
||||
|
||||
use ::zbus::export::futures_util::lock::Mutex;
|
||||
use ::zbus::Connection;
|
||||
use asusd::asus_armoury::start_attributes_zbus;
|
||||
use asusd::aura_manager::DeviceManager;
|
||||
@@ -11,6 +10,7 @@ use asusd::ctrl_fancurves::CtrlFanCurveZbus;
|
||||
use asusd::ctrl_platform::CtrlPlatform;
|
||||
use asusd::{print_board_info, start_tasks, CtrlTask, DBUS_NAME};
|
||||
use config_traits::{StdConfig, StdConfigLoad1};
|
||||
use futures_util::lock::Mutex;
|
||||
use log::{error, info};
|
||||
use rog_platform::asus_armoury::FirmwareAttributes;
|
||||
use rog_platform::platform::RogPlatform;
|
||||
|
||||
@@ -67,7 +67,7 @@ macro_rules! task_watch_item {
|
||||
&self,
|
||||
signal_ctxt: SignalEmitter<'static>,
|
||||
) -> Result<(), RogError> {
|
||||
use zbus::export::futures_util::StreamExt;
|
||||
use futures_util::StreamExt;
|
||||
|
||||
let ctrl = self.clone();
|
||||
concat_idents::concat_idents!(watch_fn = monitor_, $name {
|
||||
|
||||
@@ -152,6 +152,15 @@
|
||||
advanced_type: PerKey,
|
||||
power_zones: [Keyboard, Lightbar],
|
||||
),
|
||||
(
|
||||
device_name: "G513RW",
|
||||
product_id: "",
|
||||
layout_name: "g513i-per-key",
|
||||
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||
basic_zones: [],
|
||||
advanced_type: PerKey,
|
||||
power_zones: [Keyboard, Lightbar],
|
||||
),
|
||||
(
|
||||
device_name: "G513RC",
|
||||
product_id: "",
|
||||
|
||||
@@ -41,6 +41,7 @@ zbus.workspace = true
|
||||
dirs.workspace = true
|
||||
notify-rust.workspace = true
|
||||
concat-idents.workspace = true
|
||||
futures-util.workspace = true
|
||||
|
||||
versions.workspace = true
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ pub fn setup_system_page(ui: &MainWindow, _config: Arc<Mutex<Config>>) {
|
||||
// Null everything before the setup step
|
||||
ui.global::<SystemPageData>()
|
||||
.set_charge_control_end_threshold(-1.0);
|
||||
ui.global::<SystemPageData>()
|
||||
.set_charge_control_enabled(false);
|
||||
ui.global::<SystemPageData>().set_platform_profile(-1);
|
||||
ui.global::<SystemPageData>().set_panel_overdrive(-1);
|
||||
ui.global::<SystemPageData>().set_boot_sound(-1);
|
||||
@@ -40,12 +42,17 @@ pub fn setup_system_page(ui: &MainWindow, _config: Arc<Mutex<Config>>) {
|
||||
ui.global::<SystemPageData>().set_ppt_platform_sppt(MINMAX);
|
||||
ui.global::<SystemPageData>().set_nv_dynamic_boost(MINMAX);
|
||||
ui.global::<SystemPageData>().set_nv_temp_target(MINMAX);
|
||||
ui.global::<SystemPageData>().set_ppt_enabled(false);
|
||||
ui.global::<SystemPageData>()
|
||||
.set_ppt_enabled_available(false);
|
||||
|
||||
let sys_props = platform.supported_properties().unwrap();
|
||||
log::debug!("Available system properties: {sys_props:?}");
|
||||
log::debug!("Available system properties: {:?}", &sys_props);
|
||||
if sys_props.contains(&Properties::ChargeControlEndThreshold) {
|
||||
ui.global::<SystemPageData>()
|
||||
.set_charge_control_end_threshold(60.0);
|
||||
ui.global::<SystemPageData>()
|
||||
.set_charge_control_enabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +163,7 @@ macro_rules! setup_external {
|
||||
concat_idents!(setter = set_, $property {
|
||||
tokio::spawn(async move {
|
||||
let mut x = proxy_copy.receive_current_value_changed().await;
|
||||
use zbus::export::futures_util::StreamExt;
|
||||
use futures_util::StreamExt;
|
||||
while let Some(e) = x.next().await {
|
||||
if let Ok(out) = e.get().await {
|
||||
handle_copy
|
||||
@@ -182,7 +189,7 @@ macro_rules! setup_value_watch {
|
||||
let mut x = concat_idents!(recv = receive_, $value_type, _value_changed {
|
||||
proxy_copy.recv().await
|
||||
});
|
||||
use zbus::export::futures_util::StreamExt;
|
||||
use futures_util::StreamExt;
|
||||
while let Some(e) = x.next().await {
|
||||
if let Ok(out) = e.get().await {
|
||||
concat_idents!(getter = get_, $property {
|
||||
@@ -214,7 +221,7 @@ macro_rules! setup_minmax_external {
|
||||
let platform_proxy_copy = $platform.clone();
|
||||
tokio::spawn(async move {
|
||||
let mut x = platform_proxy_copy.receive_platform_profile_changed().await;
|
||||
use zbus::export::futures_util::StreamExt;
|
||||
use futures_util::StreamExt;
|
||||
while let Some(e) = x.next().await {
|
||||
if let Ok(_) = e.get().await {
|
||||
debug!("receive_platform_profile_changed, getting new {}", stringify!(attr));
|
||||
@@ -400,6 +407,36 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
|
||||
FirmwareAttribute::ApuMem => {}
|
||||
FirmwareAttribute::CoresPerformance => {}
|
||||
FirmwareAttribute::CoresEfficiency => {}
|
||||
FirmwareAttribute::PptEnabled => {
|
||||
init_property!(ppt_enabled, handle, value, bool);
|
||||
setup_callback!(ppt_enabled, handle, attr, bool);
|
||||
let handle_copy = handle.as_weak();
|
||||
let proxy_copy = attr.clone();
|
||||
tokio::spawn(async move {
|
||||
let mut x = proxy_copy.receive_current_value_changed().await;
|
||||
use futures_util::StreamExt;
|
||||
while let Some(e) = x.next().await {
|
||||
if let Ok(out) = e.get().await {
|
||||
handle_copy
|
||||
.upgrade_in_event_loop(move |handle| {
|
||||
handle
|
||||
.global::<SystemPageData>()
|
||||
.set_enable_ppt_group(out == 1);
|
||||
handle
|
||||
.global::<SystemPageData>()
|
||||
.set_ppt_enabled(out == 1);
|
||||
})
|
||||
.ok();
|
||||
}
|
||||
}
|
||||
});
|
||||
handle
|
||||
.global::<SystemPageData>()
|
||||
.set_ppt_enabled_available(true);
|
||||
handle
|
||||
.global::<SystemPageData>()
|
||||
.set_enable_ppt_group(value == 1);
|
||||
}
|
||||
FirmwareAttribute::PptPl1Spl => {
|
||||
init_minmax_property!(ppt_pl1_spl, handle, attr);
|
||||
setup_callback!(ppt_pl1_spl, handle, attr, i32);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2025-02-06 20:42+0000\n"
|
||||
"POT-Creation-Date: 2025-02-10 09:04+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"
|
||||
@@ -12,238 +12,238 @@ msgstr ""
|
||||
"Language: \n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:19
|
||||
#: rog-control-center/ui/pages/system.slint:20
|
||||
msgctxt "SystemPageData"
|
||||
msgid "Balanced"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:19 rog-control-center/ui/pages/system.slint:23
|
||||
#: rog-control-center/ui/pages/system.slint:20 rog-control-center/ui/pages/system.slint:24
|
||||
msgctxt "SystemPageData"
|
||||
msgid "Performance"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:19
|
||||
#: rog-control-center/ui/pages/system.slint:20
|
||||
msgctxt "SystemPageData"
|
||||
msgid "Quiet"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:22
|
||||
#: rog-control-center/ui/pages/system.slint:23
|
||||
msgctxt "SystemPageData"
|
||||
msgid "Default"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:24
|
||||
#: rog-control-center/ui/pages/system.slint:25
|
||||
msgctxt "SystemPageData"
|
||||
msgid "BalancePerformance"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:25
|
||||
#: rog-control-center/ui/pages/system.slint:26
|
||||
msgctxt "SystemPageData"
|
||||
msgid "BalancePower"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:26
|
||||
#: rog-control-center/ui/pages/system.slint:27
|
||||
msgctxt "SystemPageData"
|
||||
msgid "Power"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:142
|
||||
#: rog-control-center/ui/pages/system.slint:147
|
||||
msgctxt "PageSystem"
|
||||
msgid "Power settings"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:147
|
||||
#: rog-control-center/ui/pages/system.slint:152
|
||||
msgctxt "PageSystem"
|
||||
msgid "Charge limit"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:161
|
||||
#: rog-control-center/ui/pages/system.slint:167
|
||||
msgctxt "PageSystem"
|
||||
msgid "Platform Profile"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:171
|
||||
#: rog-control-center/ui/pages/system.slint:177
|
||||
msgctxt "PageSystem"
|
||||
msgid "Advanced"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:189
|
||||
#: rog-control-center/ui/pages/system.slint:195
|
||||
msgctxt "PageSystem"
|
||||
msgid "Armoury settings"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:199
|
||||
#: rog-control-center/ui/pages/system.slint:205
|
||||
msgctxt "no_asus_armoury_driver_1"
|
||||
msgid "The asus-armoury driver is not loaded"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:205
|
||||
#: rog-control-center/ui/pages/system.slint:211
|
||||
msgctxt "no_asus_armoury_driver_2"
|
||||
msgid "For advanced features you will require a kernel with this driver added."
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:216
|
||||
#: rog-control-center/ui/pages/system.slint:222
|
||||
msgctxt "PageSystem"
|
||||
msgid "Panel Overdrive"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:224
|
||||
#: rog-control-center/ui/pages/system.slint:230
|
||||
msgctxt "PageSystem"
|
||||
msgid "MiniLED Mode"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:232
|
||||
#: rog-control-center/ui/pages/system.slint:238
|
||||
msgctxt "PageSystem"
|
||||
msgid "POST boot sound"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:248
|
||||
#: rog-control-center/ui/pages/system.slint:254
|
||||
msgctxt "ppt_warning"
|
||||
msgid "The following settings are not applied until the toggle is enabled."
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:253
|
||||
#: rog-control-center/ui/pages/system.slint:259 rog-control-center/ui/pages/system.slint:266
|
||||
msgctxt "ppt_group_enabled"
|
||||
msgid "Enable Tuning"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:262 rog-control-center/ui/pages/system.slint:263
|
||||
#: rog-control-center/ui/pages/system.slint:277 rog-control-center/ui/pages/system.slint:278
|
||||
msgctxt "ppt_pl1_spl"
|
||||
msgid "CPU Sustained Power Limit"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:264
|
||||
#: rog-control-center/ui/pages/system.slint:279
|
||||
msgctxt "ppt_pl1_spl_help"
|
||||
msgid ""
|
||||
"Long-term CPU power limit that affects sustained workload performance. "
|
||||
"Higher values may increase heat and power consumption."
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:280 rog-control-center/ui/pages/system.slint:281
|
||||
#: rog-control-center/ui/pages/system.slint:295 rog-control-center/ui/pages/system.slint:296
|
||||
msgctxt "ppt_pl2_sppt"
|
||||
msgid "CPU Turbo Power Limit"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:282
|
||||
#: rog-control-center/ui/pages/system.slint:297
|
||||
msgctxt "ppt_pl2_sppt_help"
|
||||
msgid ""
|
||||
"Short-term CPU power limit for boost periods. Controls maximum power during "
|
||||
"brief high-performance bursts."
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:298 rog-control-center/ui/pages/system.slint:299
|
||||
#: rog-control-center/ui/pages/system.slint:313 rog-control-center/ui/pages/system.slint:314
|
||||
msgctxt "ppt_pl3_fppt"
|
||||
msgid "CPU Fast Burst Power Limit"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:300
|
||||
#: rog-control-center/ui/pages/system.slint:315
|
||||
msgctxt "ppt_pl3_fppt_help"
|
||||
msgid ""
|
||||
"Ultra-short duration power limit for instantaneous CPU bursts. Affects "
|
||||
"responsiveness during sudden workload spikes."
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:315 rog-control-center/ui/pages/system.slint:316
|
||||
#: rog-control-center/ui/pages/system.slint:330 rog-control-center/ui/pages/system.slint:331
|
||||
msgctxt "ppt_fppt"
|
||||
msgid "Fast Package Power Limit"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:317
|
||||
#: rog-control-center/ui/pages/system.slint:332
|
||||
msgctxt "ppt_fppt_help"
|
||||
msgid ""
|
||||
"Ultra-short duration power limit for system package. Controls maximum power "
|
||||
"during millisecond-scale load spikes."
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:333 rog-control-center/ui/pages/system.slint:334
|
||||
#: rog-control-center/ui/pages/system.slint:348 rog-control-center/ui/pages/system.slint:349
|
||||
msgctxt "ppt_apu_sppt"
|
||||
msgid "APU Sustained Power Limit"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:335
|
||||
#: rog-control-center/ui/pages/system.slint:350
|
||||
msgctxt "ppt_apu_sppt_help"
|
||||
msgid ""
|
||||
"Long-term power limit for integrated graphics and CPU combined. Affects "
|
||||
"sustained performance of APU-based workloads."
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:351 rog-control-center/ui/pages/system.slint:352
|
||||
#: rog-control-center/ui/pages/system.slint:366 rog-control-center/ui/pages/system.slint:367
|
||||
msgctxt "ppt_platform_sppt"
|
||||
msgid "Platform Sustained Power Limit"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:353
|
||||
#: rog-control-center/ui/pages/system.slint:368
|
||||
msgctxt "ppt_platform_sppt_help"
|
||||
msgid ""
|
||||
"Overall system power limit for sustained operations. Controls total platform "
|
||||
"power consumption over extended periods."
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:369 rog-control-center/ui/pages/system.slint:370
|
||||
#: rog-control-center/ui/pages/system.slint:384 rog-control-center/ui/pages/system.slint:385
|
||||
msgctxt "nv_dynamic_boost"
|
||||
msgid "GPU Power Boost"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:371
|
||||
#: rog-control-center/ui/pages/system.slint:386
|
||||
msgctxt "nv_dynamic_boost_help"
|
||||
msgid ""
|
||||
"Additional power allocation for GPU dynamic boost. Higher values increase "
|
||||
"GPU performance but generate more heat."
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:387 rog-control-center/ui/pages/system.slint:388
|
||||
#: rog-control-center/ui/pages/system.slint:402 rog-control-center/ui/pages/system.slint:403
|
||||
msgctxt "nv_temp_target"
|
||||
msgid "GPU Temperature Limit"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:389
|
||||
#: rog-control-center/ui/pages/system.slint:404
|
||||
msgctxt "nv_temp_target_help"
|
||||
msgid ""
|
||||
"Maximum GPU temperature threshold in Celsius. GPU will throttle to maintain "
|
||||
"temperature below this limit."
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:441
|
||||
#: rog-control-center/ui/pages/system.slint:456
|
||||
msgctxt "PageSystem"
|
||||
msgid "Energy Performance Preference linked to Throttle Policy"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:445
|
||||
#: rog-control-center/ui/pages/system.slint:460
|
||||
msgctxt "PageSystem"
|
||||
msgid "Change EPP based on Throttle Policy"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:453
|
||||
#: rog-control-center/ui/pages/system.slint:468
|
||||
msgctxt "PageSystem"
|
||||
msgid "EPP for Balanced Policy"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:463
|
||||
#: rog-control-center/ui/pages/system.slint:478
|
||||
msgctxt "PageSystem"
|
||||
msgid "EPP for Performance Policy"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:473
|
||||
#: rog-control-center/ui/pages/system.slint:488
|
||||
msgctxt "PageSystem"
|
||||
msgid "EPP for Quiet Policy"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:491
|
||||
#: rog-control-center/ui/pages/system.slint:506
|
||||
msgctxt "PageSystem"
|
||||
msgid "Throttle Policy for power state"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:497
|
||||
#: rog-control-center/ui/pages/system.slint:512
|
||||
msgctxt "PageSystem"
|
||||
msgid "Throttle Policy on Battery"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:507 rog-control-center/ui/pages/system.slint:528
|
||||
#: rog-control-center/ui/pages/system.slint:522 rog-control-center/ui/pages/system.slint:543
|
||||
msgctxt "PageSystem"
|
||||
msgid "Enabled"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:518
|
||||
#: rog-control-center/ui/pages/system.slint:533
|
||||
msgctxt "PageSystem"
|
||||
msgid "Throttle Policy on AC"
|
||||
msgstr ""
|
||||
|
||||
@@ -13,6 +13,7 @@ export struct AttrPossible {
|
||||
}
|
||||
|
||||
export global SystemPageData {
|
||||
in-out property <bool> charge_control_enabled: true;
|
||||
in-out property <float> charge_control_end_threshold: 30;
|
||||
callback cb_charge_control_end_threshold(/* charge limit */ int);
|
||||
in-out property <int> platform_profile: 0;
|
||||
@@ -115,8 +116,12 @@ export global SystemPageData {
|
||||
callback cb_nv_temp_target(int);
|
||||
callback cb_default_nv_temp_target();
|
||||
|
||||
in-out property <bool> enable_ppt_group;
|
||||
in-out property <bool> enable_ppt_group: false;
|
||||
callback cb_enable_ppt_group(bool);
|
||||
|
||||
in-out property <bool> ppt_enabled_available;
|
||||
in-out property <bool> ppt_enabled;
|
||||
callback cb_ppt_enabled(bool);
|
||||
}
|
||||
|
||||
export component PageSystem inherits Rectangle {
|
||||
@@ -148,6 +153,7 @@ export component PageSystem inherits Rectangle {
|
||||
minimum: 20;
|
||||
maximum: 100;
|
||||
has_reset: false;
|
||||
enabled <=> SystemPageData.charge_control_enabled;
|
||||
value: SystemPageData.charge_control_end_threshold;
|
||||
released => {
|
||||
SystemPageData.charge_control_end_threshold = self.value;
|
||||
@@ -249,13 +255,22 @@ export component PageSystem inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
Switch {
|
||||
text: @tr("ppt_group_enabled" => "Enable Tuning");
|
||||
if !SystemPageData.ppt_enabled_available: Switch {
|
||||
text: @tr("ppt_group_enabled" => "Enable Tuning");
|
||||
checked <=> SystemPageData.enable_ppt_group;
|
||||
toggled => {
|
||||
SystemPageData.cb_enable_ppt_group(SystemPageData.enable_ppt_group)
|
||||
}
|
||||
}
|
||||
if SystemPageData.ppt_enabled_available: Switch {
|
||||
text: @tr("ppt_group_enabled" => "Enable Tuning");
|
||||
checked <=> SystemPageData.ppt_enabled;
|
||||
toggled => {
|
||||
SystemPageData.enable_ppt_group = self.checked;
|
||||
SystemPageData.cb_ppt_enabled(SystemPageData.ppt_enabled)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if SystemPageData.ppt_pl1_spl.current != -1: SystemSlider {
|
||||
|
||||
@@ -12,7 +12,7 @@ export component RogItem inherits Rectangle {
|
||||
export component SystemSlider inherits RogItem {
|
||||
in property <string> title;
|
||||
in property <string> text;
|
||||
in-out property <bool> enabled;
|
||||
in-out property <bool> enabled: true;
|
||||
in-out property <float> value;
|
||||
in-out property <float> minimum;
|
||||
in-out property <float> maximum;
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::fs::{read_dir, File, OpenOptions};
|
||||
use std::io::{Read, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use log::debug;
|
||||
use log::{debug, error};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||
|
||||
@@ -304,7 +304,8 @@ pub enum FirmwareAttribute {
|
||||
GpuMuxMode = 21,
|
||||
MiniLedMode = 22,
|
||||
PendingReboot = 23,
|
||||
None = 24
|
||||
PptEnabled = 24,
|
||||
None = 25
|
||||
}
|
||||
|
||||
impl FirmwareAttribute {
|
||||
@@ -336,6 +337,7 @@ impl From<&str> for FirmwareAttribute {
|
||||
"apu_mem" => Self::ApuMem,
|
||||
"cores_performance" => Self::CoresPerformance,
|
||||
"cores_efficiency" => Self::CoresEfficiency,
|
||||
"ppt_enabled" => Self::PptEnabled,
|
||||
"ppt_pl1_spl" => Self::PptPl1Spl,
|
||||
"ppt_pl2_sppt" => Self::PptPl2Sppt,
|
||||
"ppt_pl3_fppt" => Self::PptPl3Fppt,
|
||||
@@ -357,7 +359,10 @@ impl From<&str> for FirmwareAttribute {
|
||||
"gpu_mux_mode" => Self::GpuMuxMode,
|
||||
"mini_led_mode" => Self::MiniLedMode,
|
||||
"pending_reboot" => Self::PendingReboot,
|
||||
_ => panic!("Invalid firmware attribute: {}", s)
|
||||
_ => {
|
||||
error!("Invalid firmware attribute: {}", s);
|
||||
Self::None
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -368,6 +373,7 @@ impl From<FirmwareAttribute> for &str {
|
||||
FirmwareAttribute::ApuMem => "apu_mem",
|
||||
FirmwareAttribute::CoresPerformance => "cores_performance",
|
||||
FirmwareAttribute::CoresEfficiency => "cores_efficiency",
|
||||
FirmwareAttribute::PptEnabled => "ppt_enabled",
|
||||
FirmwareAttribute::PptPl1Spl => "ppt_pl1_spl",
|
||||
FirmwareAttribute::PptPl2Sppt => "ppt_pl2_sppt",
|
||||
FirmwareAttribute::PptPl3Fppt => "ppt_pl3_fppt",
|
||||
|
||||
Reference in New Issue
Block a user