mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 11ac46df11 | |||
| 05bec93644 | |||
| c77e7cf1ce | |||
| d30f7dc2ea | |||
| 759606fca3 | |||
| 25ed8bdeed | |||
| de61a15b7a | |||
| 16700e55f4 | |||
| 5833a011ce | |||
| 62577ee0e4 | |||
| dac35996b1 | |||
| 5c2bcad7c6 | |||
| 81f6c18a24 | |||
| bcc3d42789 | |||
| 36c34cb3dd | |||
| 9b82b875f1 |
@@ -2,6 +2,17 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
- Fix aura data matching
|
||||
|
||||
## [v6.1.0]
|
||||
|
||||
### Changed
|
||||
- Update deps
|
||||
- Add support for G513RC RGB modes
|
||||
- Many UI fixes
|
||||
- Fixes to PPT settings in UI
|
||||
|
||||
## [v6.1.0-rc7]
|
||||
|
||||
- Refactor PPT handling more:
|
||||
|
||||
Generated
+805
-203
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,5 +1,5 @@
|
||||
[workspace.package]
|
||||
version = "6.1.0-rc7"
|
||||
version = "6.1.0"
|
||||
rust-version = "1.82"
|
||||
license = "MPL-2.0"
|
||||
readme = "README.md"
|
||||
|
||||
@@ -39,7 +39,7 @@ See the [rog-aura readme](./rog-aura/README.md) for more details.
|
||||
|
||||
## Discord
|
||||
|
||||
[](https://discord.gg/z8y99XqPb7)
|
||||
[](https://discord.gg/B8GftRW2Hd)
|
||||
|
||||
## SUPPORTED LAPTOPS
|
||||
|
||||
|
||||
+2
-2
@@ -281,8 +281,8 @@ fn do_parsed(
|
||||
}
|
||||
|
||||
println!("\nExtra help can be requested on any command or subcommand:");
|
||||
println!(" asusctl led-mode --help");
|
||||
println!(" asusctl led-mode static --help");
|
||||
println!(" asusctl aura --help");
|
||||
println!(" asusctl aura static --help");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ pub struct SlashCommand {
|
||||
pub help: bool,
|
||||
#[options(help = "Enable the Slash Ledbar")]
|
||||
pub enable: bool,
|
||||
#[options(help = "Ddisable the Slash Ledbar")]
|
||||
#[options(help = "Disable the Slash Ledbar")]
|
||||
pub disable: bool,
|
||||
#[options(short = "l", meta = "", help = "Set brightness value <0-255>")]
|
||||
pub brightness: Option<u8>,
|
||||
|
||||
+33
-22
@@ -68,30 +68,41 @@ impl AsusArmouryAttribute {
|
||||
) -> Result<(), RogError> {
|
||||
use zbus::export::futures_util::StreamExt;
|
||||
|
||||
let ctrl = self.clone();
|
||||
let name = self.name();
|
||||
match self.attr.get_watcher() {
|
||||
Ok(watch) => {
|
||||
let name = <&str>::from(name);
|
||||
tokio::spawn(async move {
|
||||
let mut buffer = [0; 32];
|
||||
watch
|
||||
.into_event_stream(&mut buffer)
|
||||
.unwrap()
|
||||
.for_each(|_| async {
|
||||
debug!("{} changed", name);
|
||||
ctrl.current_value_changed(&signal_ctxt).await.ok();
|
||||
})
|
||||
.await;
|
||||
});
|
||||
}
|
||||
Err(e) => info!(
|
||||
"inotify watch failed: {}. You can ignore this if your device does not support \
|
||||
the feature",
|
||||
e
|
||||
)
|
||||
macro_rules! watch_value_notify {
|
||||
($attr_str:expr, $fn_prop_changed:ident) => {
|
||||
match self.attr.get_watcher($attr_str) {
|
||||
Ok(watch) => {
|
||||
let name = <&str>::from(name);
|
||||
let ctrl = self.clone();
|
||||
let sig = signal_ctxt.clone();
|
||||
tokio::spawn(async move {
|
||||
let mut buffer = [0; 32];
|
||||
watch
|
||||
.into_event_stream(&mut buffer)
|
||||
.unwrap()
|
||||
.for_each(|_| async {
|
||||
debug!("{} changed", name);
|
||||
ctrl.$fn_prop_changed(&sig).await.ok();
|
||||
})
|
||||
.await;
|
||||
});
|
||||
}
|
||||
Err(e) => info!(
|
||||
"inotify watch failed: {}. You can ignore this if your device does not \
|
||||
support the feature",
|
||||
e
|
||||
)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// "current_value", "default_value", "min_value", "max_value"
|
||||
watch_value_notify!("current_value", current_value_changed);
|
||||
watch_value_notify!("default_value", default_value_changed);
|
||||
watch_value_notify!("min_value", min_value_changed);
|
||||
watch_value_notify!("max_value", max_value_changed);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -406,7 +417,7 @@ pub async fn set_config_or_default(
|
||||
<&str>::from(name),
|
||||
i
|
||||
);
|
||||
config.write();
|
||||
// config.write();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ impl AniMe {
|
||||
return Ok(true); // Do safe exit
|
||||
}
|
||||
let inner = inner.clone();
|
||||
tokio::task::spawn_local(async move {
|
||||
tokio::task::spawn(async move {
|
||||
inner
|
||||
.write_data_buffer(frame)
|
||||
.await
|
||||
|
||||
+54
-54
@@ -350,34 +350,27 @@ impl CtrlPlatform {
|
||||
}
|
||||
|
||||
#[zbus(property)]
|
||||
async fn set_platform_profile(&mut self, policy: PlatformProfile) -> Result<(), FdoErr> {
|
||||
async fn set_platform_profile(
|
||||
&mut self,
|
||||
#[zbus(signal_context)] ctxt: SignalEmitter<'_>,
|
||||
policy: PlatformProfile
|
||||
) -> Result<(), FdoErr> {
|
||||
// TODO: watch for external changes
|
||||
if self.platform.has_platform_profile() {
|
||||
let change_epp = self.config.lock().await.platform_profile_linked_epp;
|
||||
let epp = self.get_config_epp_for_throttle(policy).await;
|
||||
self.check_and_set_epp(epp, change_epp);
|
||||
|
||||
let power_plugged = self
|
||||
.power
|
||||
.get_online()
|
||||
.map_err(|e| {
|
||||
error!("Could not get power status: {e:?}");
|
||||
e
|
||||
})
|
||||
.unwrap_or_default();
|
||||
self.config
|
||||
.lock()
|
||||
.await
|
||||
.select_tunings(power_plugged == 1, policy)
|
||||
.enabled = false;
|
||||
|
||||
self.config.lock().await.write();
|
||||
// TODO: Need to get supported profiles here and ensure we translate to one
|
||||
self.platform
|
||||
.set_platform_profile(policy.into())
|
||||
.map_err(|err| {
|
||||
warn!("platform_profile {}", err);
|
||||
FdoErr::Failed(format!("RogPlatform: platform_profile: {err}"))
|
||||
})
|
||||
})?;
|
||||
self.enable_ppt_group_changed(&ctxt).await?;
|
||||
Ok(())
|
||||
} else {
|
||||
Err(FdoErr::NotSupported(
|
||||
"RogPlatform: platform_profile not supported".to_owned()
|
||||
@@ -405,10 +398,11 @@ impl CtrlPlatform {
|
||||
#[zbus(property)]
|
||||
async fn set_platform_profile_on_battery(
|
||||
&mut self,
|
||||
#[zbus(signal_context)] ctxt: SignalEmitter<'_>,
|
||||
policy: PlatformProfile
|
||||
) -> Result<(), FdoErr> {
|
||||
self.config.lock().await.platform_profile_on_battery = policy;
|
||||
self.set_platform_profile(policy).await?;
|
||||
self.set_platform_profile(ctxt, policy).await?;
|
||||
self.config.lock().await.write();
|
||||
Ok(())
|
||||
}
|
||||
@@ -431,9 +425,13 @@ impl CtrlPlatform {
|
||||
}
|
||||
|
||||
#[zbus(property)]
|
||||
async fn set_platform_profile_on_ac(&mut self, policy: PlatformProfile) -> Result<(), FdoErr> {
|
||||
async fn set_platform_profile_on_ac(
|
||||
&mut self,
|
||||
#[zbus(signal_context)] ctxt: SignalEmitter<'_>,
|
||||
policy: PlatformProfile
|
||||
) -> Result<(), FdoErr> {
|
||||
self.config.lock().await.platform_profile_on_ac = policy;
|
||||
self.set_platform_profile(policy).await?;
|
||||
self.set_platform_profile(ctxt, policy).await?;
|
||||
self.config.lock().await.write();
|
||||
Ok(())
|
||||
}
|
||||
@@ -532,45 +530,41 @@ impl CtrlPlatform {
|
||||
.unwrap_or_default();
|
||||
let profile: PlatformProfile = self.platform.get_platform_profile()?.into();
|
||||
|
||||
// Clone to reduce blocking
|
||||
let tuning = self
|
||||
.config
|
||||
.lock()
|
||||
.await
|
||||
.select_tunings(power_plugged == 1, profile)
|
||||
.clone();
|
||||
if enable {
|
||||
// Clone to reduce blocking
|
||||
let tuning = self
|
||||
.config
|
||||
.lock()
|
||||
.await
|
||||
.select_tunings(power_plugged == 1, profile)
|
||||
.clone();
|
||||
|
||||
for attr in self.attributes.attributes() {
|
||||
let name: FirmwareAttribute = attr.name().into();
|
||||
if name.is_ppt() {
|
||||
// reset stored value
|
||||
if let Some(tune) = self
|
||||
.config
|
||||
.lock()
|
||||
.await
|
||||
.select_tunings(power_plugged == 1, profile)
|
||||
.group
|
||||
.get_mut(&name)
|
||||
{
|
||||
let value = if !enable {
|
||||
attr.default_value().clone()
|
||||
} else {
|
||||
tuning
|
||||
for attr in self.attributes.attributes() {
|
||||
let name: FirmwareAttribute = attr.name().into();
|
||||
if name.is_ppt() {
|
||||
// reset stored value
|
||||
if let Some(tune) = self
|
||||
.config
|
||||
.lock()
|
||||
.await
|
||||
.select_tunings(power_plugged == 1, profile)
|
||||
.group
|
||||
.get_mut(&name)
|
||||
{
|
||||
let value = tuning
|
||||
.group
|
||||
.get(&name)
|
||||
.map(|v| AttrValue::Integer(*v))
|
||||
.unwrap_or_else(|| attr.default_value().clone())
|
||||
};
|
||||
// restore default
|
||||
attr.set_current_value(&value)?;
|
||||
if let AttrValue::Integer(i) = value {
|
||||
*tune = i
|
||||
.unwrap_or_else(|| attr.default_value().clone());
|
||||
// restore default
|
||||
attr.set_current_value(&value)?;
|
||||
if let AttrValue::Integer(i) = value {
|
||||
*tune = i
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if !enable {
|
||||
} else {
|
||||
// finally, reapply the profile to ensure acpi does the thingy
|
||||
self.platform.set_platform_profile(profile.into())?;
|
||||
}
|
||||
@@ -682,6 +676,7 @@ impl CtrlTask for CtrlPlatform {
|
||||
let platform1 = self.clone();
|
||||
let platform2 = self.clone();
|
||||
let platform3 = self.clone();
|
||||
let signal_ctxt_copy = signal_ctxt.clone();
|
||||
self.create_sys_event_tasks(
|
||||
move |sleeping| {
|
||||
let platform1 = platform1.clone();
|
||||
@@ -749,6 +744,7 @@ impl CtrlTask for CtrlPlatform {
|
||||
},
|
||||
move |power_plugged| {
|
||||
let platform3 = platform3.clone();
|
||||
let signal_ctxt_copy = signal_ctxt.clone();
|
||||
// power change
|
||||
async move {
|
||||
if platform3.platform.has_platform_profile() {
|
||||
@@ -780,6 +776,10 @@ impl CtrlTask for CtrlPlatform {
|
||||
profile
|
||||
)
|
||||
.await;
|
||||
platform3
|
||||
.enable_ppt_group_changed(&signal_ctxt_copy)
|
||||
.await
|
||||
.ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -788,7 +788,7 @@ impl CtrlTask for CtrlPlatform {
|
||||
|
||||
// This spawns a new task for every item.
|
||||
// TODO: find a better way to manage this
|
||||
self.watch_charge_control_end_threshold(signal_ctxt.clone())
|
||||
self.watch_charge_control_end_threshold(signal_ctxt_copy.clone())
|
||||
.await?;
|
||||
|
||||
let watch_platform_profile = self.platform.monitor_platform_profile()?;
|
||||
@@ -815,8 +815,8 @@ impl CtrlTask for CtrlPlatform {
|
||||
let change_epp = ctrl.config.lock().await.platform_profile_linked_epp;
|
||||
let epp = ctrl.get_config_epp_for_throttle(profile).await;
|
||||
ctrl.check_and_set_epp(epp, change_epp);
|
||||
ctrl.platform_profile_changed(&signal_ctxt).await.ok();
|
||||
ctrl.enable_ppt_group_changed(&signal_ctxt).await.ok();
|
||||
ctrl.platform_profile_changed(&signal_ctxt_copy).await.ok();
|
||||
ctrl.enable_ppt_group_changed(&signal_ctxt_copy).await.ok();
|
||||
let power_plugged = ctrl
|
||||
.power
|
||||
.get_online()
|
||||
|
||||
@@ -35,6 +35,15 @@
|
||||
advanced_type: None,
|
||||
power_zones: [Keyboard],
|
||||
),
|
||||
(
|
||||
device_name: "FA617NS",
|
||||
product_id: "",
|
||||
layout_name: "fa617ns",
|
||||
basic_modes: [Static, Breathe, Pulse],
|
||||
basic_zones: [],
|
||||
advanced_type: None,
|
||||
power_zones: [Keyboard],
|
||||
),
|
||||
(
|
||||
device_name: "FX505",
|
||||
product_id: "",
|
||||
@@ -80,6 +89,15 @@
|
||||
advanced_type: None,
|
||||
power_zones: [Keyboard],
|
||||
),
|
||||
(
|
||||
device_name: "FX617X",
|
||||
product_id: "",
|
||||
layout_name: "fa506i",
|
||||
basic_modes: [Static, Breathe, Pulse],
|
||||
basic_zones: [],
|
||||
advanced_type: None,
|
||||
power_zones: [Keyboard],
|
||||
),
|
||||
(
|
||||
device_name: "FX705D",
|
||||
product_id: "",
|
||||
@@ -139,7 +157,7 @@
|
||||
product_id: "",
|
||||
layout_name: "g513i",
|
||||
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||
basic_zones: [],
|
||||
basic_zones: [Key1, Key2, Key3, Key4],
|
||||
advanced_type: Zoned([ZonedKbLeft, ZonedKbLeftMid, ZonedKbRightMid, ZonedKbRight, LightbarRight, LightbarRightCorner, LightbarRightBottom, LightbarLeftBottom, LightbarLeftCorner, LightbarLeft]),
|
||||
power_zones: [Keyboard, Lightbar],
|
||||
),
|
||||
@@ -548,15 +566,6 @@
|
||||
advanced_type: Zoned([SingleZone]),
|
||||
power_zones: [Keyboard],
|
||||
),
|
||||
(
|
||||
device_name: "GA605W",
|
||||
product_id: "",
|
||||
layout_name: "ga401q",
|
||||
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||
basic_zones: [],
|
||||
advanced_type: Zoned([SingleZone]),
|
||||
power_zones: [Keyboard],
|
||||
),
|
||||
(
|
||||
device_name: "GL503",
|
||||
product_id: "",
|
||||
@@ -854,4 +863,4 @@
|
||||
advanced_type: None,
|
||||
power_zones: [Ally],
|
||||
),
|
||||
])
|
||||
])
|
||||
|
||||
@@ -5,7 +5,6 @@ use slint_build::CompilerConfiguration;
|
||||
|
||||
fn main() {
|
||||
// write_locales();
|
||||
|
||||
let root = env!("CARGO_MANIFEST_DIR");
|
||||
let mut main = PathBuf::from_str(root).unwrap();
|
||||
main.push("ui/main_window.slint");
|
||||
@@ -14,7 +13,6 @@ fn main() {
|
||||
include.push("ui");
|
||||
|
||||
slint_build::print_rustc_flags().unwrap();
|
||||
// slint_build::compile("ui/main_window.slint").unwrap();
|
||||
slint_build::compile_with_config(
|
||||
main,
|
||||
CompilerConfiguration::new()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use std::env::args;
|
||||
use std::env::{self, args};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::exit;
|
||||
use std::sync::{Arc, Mutex};
|
||||
@@ -32,6 +32,12 @@ async fn main() -> Result<()> {
|
||||
.format_timestamp(None)
|
||||
.init();
|
||||
|
||||
// If we're running under gamescope we have to set WAYLAND_DISPLAY for winit to
|
||||
// use
|
||||
if let Ok(gamescope) = env::var("GAMESCOPE_WAYLAND_DISPLAY") {
|
||||
env::set_var("WAYLAND_DISPLAY", gamescope);
|
||||
}
|
||||
|
||||
// Try to open a proxy and check for app state first
|
||||
{
|
||||
let user_con = zbus::blocking::Connection::session()?;
|
||||
@@ -84,7 +90,7 @@ async fn main() -> Result<()> {
|
||||
let board_name = dmi.board_name;
|
||||
let prod_family = dmi.product_family;
|
||||
info!("Running on {board_name}, product: {prod_family}");
|
||||
let is_rog_ally = prod_family == "RC71L";
|
||||
let is_rog_ally = prod_family == "RC71L" || prod_family == "RC72L";
|
||||
|
||||
let args: Vec<String> = args().skip(1).collect();
|
||||
|
||||
@@ -120,7 +126,9 @@ async fn main() -> Result<()> {
|
||||
config.enable_tray_icon = false;
|
||||
config.run_in_background = false;
|
||||
config.startup_in_background = false;
|
||||
config.start_fullscreen = true;
|
||||
}
|
||||
config.write();
|
||||
|
||||
let enable_tray_icon = config.enable_tray_icon;
|
||||
let startup_in_background = config.startup_in_background;
|
||||
@@ -136,8 +144,8 @@ async fn main() -> Result<()> {
|
||||
// i_slint_backend_selector::with_platform(|_| Ok(())).unwrap();
|
||||
|
||||
if !startup_in_background {
|
||||
if let Ok(mut lock) = app_state.lock() {
|
||||
*lock = AppState::MainWindowShouldOpen;
|
||||
if let Ok(mut app_state) = app_state.lock() {
|
||||
*app_state = AppState::MainWindowShouldOpen;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,15 +162,15 @@ async fn main() -> Result<()> {
|
||||
let mut state = AppState::StartingUp;
|
||||
loop {
|
||||
// save as a var, don't hold the lock the entire time or deadlocks happen
|
||||
if let Ok(lock) = app_state.lock() {
|
||||
state = *lock;
|
||||
if let Ok(app_state) = app_state.lock() {
|
||||
state = *app_state;
|
||||
}
|
||||
|
||||
// This sleep is required to give the event loop time to react
|
||||
sleep(Duration::from_millis(300));
|
||||
if state == AppState::MainWindowShouldOpen {
|
||||
if let Ok(mut lock) = app_state.lock() {
|
||||
*lock = AppState::MainWindowOpen;
|
||||
if let Ok(mut app_state) = app_state.lock() {
|
||||
*app_state = AppState::MainWindowOpen;
|
||||
}
|
||||
|
||||
let config_copy = config.clone();
|
||||
@@ -174,20 +182,39 @@ async fn main() -> Result<()> {
|
||||
if let Some(ui) = ui.as_mut() {
|
||||
ui.window().show().unwrap();
|
||||
ui.window().on_close_requested(move || {
|
||||
if let Ok(mut lock) = app_state_copy.lock() {
|
||||
*lock = AppState::MainWindowClosed;
|
||||
if let Ok(mut app_state) = app_state_copy.lock() {
|
||||
*app_state = AppState::MainWindowClosed;
|
||||
}
|
||||
slint::CloseRequestResponse::HideWindow
|
||||
});
|
||||
} else {
|
||||
let config_copy_2 = config_copy.clone();
|
||||
let newui = setup_window(config_copy);
|
||||
newui.window().show().unwrap();
|
||||
newui.window().on_close_requested(move || {
|
||||
if let Ok(mut lock) = app_state_copy.lock() {
|
||||
*lock = AppState::MainWindowClosed;
|
||||
if let Ok(mut app_state) = app_state_copy.lock() {
|
||||
*app_state = AppState::MainWindowClosed;
|
||||
}
|
||||
slint::CloseRequestResponse::HideWindow
|
||||
});
|
||||
|
||||
let ui_copy = newui.as_weak();
|
||||
newui
|
||||
.window()
|
||||
.set_rendering_notifier(move |s, _| {
|
||||
if let slint::RenderingState::RenderingSetup = s {
|
||||
let config = config_copy_2.clone();
|
||||
ui_copy
|
||||
.upgrade_in_event_loop(move |w| {
|
||||
let fullscreen =
|
||||
config.lock().is_ok_and(|c| c.start_fullscreen);
|
||||
if fullscreen && !w.window().is_fullscreen() {
|
||||
w.window().set_fullscreen(fullscreen);
|
||||
}
|
||||
})
|
||||
.ok();
|
||||
}
|
||||
})
|
||||
.ok();
|
||||
ui.replace(newui);
|
||||
}
|
||||
});
|
||||
@@ -197,8 +224,8 @@ async fn main() -> Result<()> {
|
||||
slint::quit_event_loop().unwrap();
|
||||
exit(0);
|
||||
} else if state != AppState::MainWindowOpen {
|
||||
if let Ok(lock) = config.lock() {
|
||||
if !lock.run_in_background {
|
||||
if let Ok(config) = config.lock() {
|
||||
if !config.run_in_background {
|
||||
slint::quit_event_loop().unwrap();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ use std::sync::{Arc, Mutex};
|
||||
use config_traits::StdConfig;
|
||||
use log::warn;
|
||||
use rog_dbus::list_iface_blocking;
|
||||
use slint::{ComponentHandle, PhysicalSize, SharedString, Weak};
|
||||
use slint::{ComponentHandle, SharedString, Weak};
|
||||
|
||||
use crate::config::Config;
|
||||
use crate::ui::setup_anime::setup_anime_page;
|
||||
@@ -87,15 +87,7 @@ pub fn setup_window(config: Arc<Mutex<Config>>) -> MainWindow {
|
||||
.map_err(|e| warn!("Couldn't set application ID: {e:?}"))
|
||||
.ok();
|
||||
let ui = MainWindow::new().unwrap();
|
||||
if let Ok(lock) = config.try_lock() {
|
||||
let fullscreen = lock.start_fullscreen;
|
||||
let width = lock.fullscreen_width;
|
||||
let height = lock.fullscreen_height;
|
||||
if fullscreen {
|
||||
ui.window().set_fullscreen(fullscreen);
|
||||
ui.window().set_size(PhysicalSize { width, height });
|
||||
}
|
||||
};
|
||||
ui.window().show().unwrap();
|
||||
|
||||
let available = list_iface_blocking().unwrap_or_default();
|
||||
ui.set_sidebar_items_avilable(
|
||||
@@ -129,6 +121,7 @@ pub fn setup_window(config: Arc<Mutex<Config>>) -> MainWindow {
|
||||
if available.contains(&"xyz.ljones.FanCurves".to_string()) {
|
||||
setup_fan_curve_page(&ui, config);
|
||||
}
|
||||
|
||||
ui
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@ use crate::{set_ui_callbacks, set_ui_props_async, AttrMinMax, MainWindow, System
|
||||
const MINMAX: AttrMinMax = AttrMinMax {
|
||||
min: 0,
|
||||
max: 0,
|
||||
val: -1.0
|
||||
current: -1.0
|
||||
};
|
||||
|
||||
pub fn setup_system_page(ui: &MainWindow, _config: Arc<Mutex<Config>>) {
|
||||
let conn = zbus::blocking::Connection::system().unwrap();
|
||||
let platform = PlatformProxyBlocking::new(&conn).unwrap();
|
||||
let platform = PlatformProxyBlocking::builder(&conn).build().unwrap();
|
||||
// let armoury_attrs =
|
||||
// find_iface::<AsusArmouryProxyBlocking>("xyz.ljones.AsusArmoury").unwrap();
|
||||
|
||||
@@ -93,13 +93,13 @@ macro_rules! init_minmax_property {
|
||||
tokio::spawn(async move {
|
||||
let min = proxy_copy.min_value().await.unwrap();
|
||||
let max = proxy_copy.max_value().await.unwrap();
|
||||
let val = proxy_copy.current_value().await.unwrap() as f32;
|
||||
let current = proxy_copy.current_value().await.unwrap() as f32;
|
||||
handle_copy
|
||||
.upgrade_in_event_loop(move |handle| {
|
||||
concat_idents!(setter = set_, $property {
|
||||
handle
|
||||
.global::<SystemPageData>()
|
||||
.setter(AttrMinMax { min, max, val });
|
||||
.setter(AttrMinMax { min, max, current });
|
||||
});
|
||||
})
|
||||
.ok();
|
||||
@@ -174,30 +174,40 @@ macro_rules! setup_external {
|
||||
}
|
||||
|
||||
// For handling external value changes
|
||||
macro_rules! setup_minmax_external {
|
||||
($property:ident, $handle:expr, $attr:expr, $platform:expr) => {
|
||||
macro_rules! setup_value_watch {
|
||||
($property:ident, $handle:expr, $proxy:expr, $value_type:ident $($conv: tt)*) => {
|
||||
let handle_copy = $handle.as_weak();
|
||||
let proxy_copy = $attr.clone();
|
||||
let proxy_copy = $proxy.clone();
|
||||
tokio::spawn(async move {
|
||||
let mut x = proxy_copy.receive_current_value_changed().await;
|
||||
let mut x = concat_idents!(recv = receive_, $value_type, _value_changed {
|
||||
proxy_copy.recv().await
|
||||
});
|
||||
use zbus::export::futures_util::StreamExt;
|
||||
while let Some(e) = x.next().await {
|
||||
if let Ok(out) = e.get().await {
|
||||
concat_idents!(getter = get_, $property {
|
||||
handle_copy
|
||||
.upgrade_in_event_loop(move |handle| {
|
||||
let mut tmp: AttrMinMax =
|
||||
handle.global::<SystemPageData>().getter();
|
||||
tmp.val = out as f32;
|
||||
concat_idents!(setter = set_, $property {
|
||||
handle.global::<SystemPageData>().setter(tmp);
|
||||
});
|
||||
})
|
||||
.ok();
|
||||
handle_copy
|
||||
.upgrade_in_event_loop(move |handle| {
|
||||
let mut tmp: AttrMinMax =
|
||||
handle.global::<SystemPageData>().getter();
|
||||
tmp.$value_type = out $($conv)*;
|
||||
concat_idents!(setter = set_, $property {
|
||||
handle.global::<SystemPageData>().setter(tmp);
|
||||
});
|
||||
})
|
||||
.ok();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
macro_rules! setup_minmax_external {
|
||||
($property:ident, $handle:expr, $attr:expr, $platform:expr) => {
|
||||
setup_value_watch!($property, $handle, $attr, current as f32);
|
||||
setup_value_watch!($property, $handle, $attr, min);
|
||||
setup_value_watch!($property, $handle, $attr, max);
|
||||
|
||||
let handle_copy = $handle.as_weak();
|
||||
let proxy_copy = $attr.clone();
|
||||
@@ -210,13 +220,13 @@ macro_rules! setup_minmax_external {
|
||||
debug!("receive_platform_profile_changed, getting new {}", stringify!(attr));
|
||||
let min = proxy_copy.min_value().await.unwrap();
|
||||
let max = proxy_copy.max_value().await.unwrap();
|
||||
let val = proxy_copy.current_value().await.unwrap() as f32;
|
||||
let current = proxy_copy.current_value().await.unwrap() as f32;
|
||||
handle_copy
|
||||
.upgrade_in_event_loop(move |handle| {
|
||||
concat_idents!(setter = set_, $property {
|
||||
handle
|
||||
.global::<SystemPageData>()
|
||||
.setter(AttrMinMax { min, max, val });
|
||||
.setter(AttrMinMax { min, max, current });
|
||||
});
|
||||
})
|
||||
.ok();
|
||||
@@ -249,7 +259,7 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
|
||||
tokio::spawn(async move {
|
||||
// Create the connections/proxies here to prevent future delays in process
|
||||
let conn = zbus::Connection::system().await.unwrap();
|
||||
let platform = PlatformProxy::new(&conn).await.unwrap();
|
||||
let platform = PlatformProxy::builder(&conn).build().await.unwrap();
|
||||
|
||||
set_ui_props_async!(
|
||||
handle,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2025-01-21 06:49+0000\n"
|
||||
"POT-Creation-Date: 2025-02-06 20:42+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"
|
||||
@@ -119,131 +119,131 @@ msgid ""
|
||||
"Higher values may increase heat and power consumption."
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:279 rog-control-center/ui/pages/system.slint:280
|
||||
#: rog-control-center/ui/pages/system.slint:280 rog-control-center/ui/pages/system.slint:281
|
||||
msgctxt "ppt_pl2_sppt"
|
||||
msgid "CPU Turbo Power Limit"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:281
|
||||
#: rog-control-center/ui/pages/system.slint:282
|
||||
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:296 rog-control-center/ui/pages/system.slint:297
|
||||
#: rog-control-center/ui/pages/system.slint:298 rog-control-center/ui/pages/system.slint:299
|
||||
msgctxt "ppt_pl3_fppt"
|
||||
msgid "CPU Fast Burst Power Limit"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:298
|
||||
#: rog-control-center/ui/pages/system.slint:300
|
||||
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:312 rog-control-center/ui/pages/system.slint:313
|
||||
#: rog-control-center/ui/pages/system.slint:315 rog-control-center/ui/pages/system.slint:316
|
||||
msgctxt "ppt_fppt"
|
||||
msgid "Fast Package Power Limit"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:314
|
||||
#: rog-control-center/ui/pages/system.slint:317
|
||||
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:329 rog-control-center/ui/pages/system.slint:330
|
||||
#: rog-control-center/ui/pages/system.slint:333 rog-control-center/ui/pages/system.slint:334
|
||||
msgctxt "ppt_apu_sppt"
|
||||
msgid "APU Sustained Power Limit"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:331
|
||||
#: rog-control-center/ui/pages/system.slint:335
|
||||
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:346 rog-control-center/ui/pages/system.slint:347
|
||||
#: rog-control-center/ui/pages/system.slint:351 rog-control-center/ui/pages/system.slint:352
|
||||
msgctxt "ppt_platform_sppt"
|
||||
msgid "Platform Sustained Power Limit"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:348
|
||||
#: rog-control-center/ui/pages/system.slint:353
|
||||
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:363 rog-control-center/ui/pages/system.slint:364
|
||||
#: rog-control-center/ui/pages/system.slint:369 rog-control-center/ui/pages/system.slint:370
|
||||
msgctxt "nv_dynamic_boost"
|
||||
msgid "GPU Power Boost"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:365
|
||||
#: rog-control-center/ui/pages/system.slint:371
|
||||
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:380 rog-control-center/ui/pages/system.slint:381
|
||||
#: rog-control-center/ui/pages/system.slint:387 rog-control-center/ui/pages/system.slint:388
|
||||
msgctxt "nv_temp_target"
|
||||
msgid "GPU Temperature Limit"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:382
|
||||
#: rog-control-center/ui/pages/system.slint:389
|
||||
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:433
|
||||
#: rog-control-center/ui/pages/system.slint:441
|
||||
msgctxt "PageSystem"
|
||||
msgid "Energy Performance Preference linked to Throttle Policy"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:437
|
||||
#: rog-control-center/ui/pages/system.slint:445
|
||||
msgctxt "PageSystem"
|
||||
msgid "Change EPP based on Throttle Policy"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:445
|
||||
#: rog-control-center/ui/pages/system.slint:453
|
||||
msgctxt "PageSystem"
|
||||
msgid "EPP for Balanced Policy"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:455
|
||||
#: rog-control-center/ui/pages/system.slint:463
|
||||
msgctxt "PageSystem"
|
||||
msgid "EPP for Performance Policy"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:465
|
||||
#: rog-control-center/ui/pages/system.slint:473
|
||||
msgctxt "PageSystem"
|
||||
msgid "EPP for Quiet Policy"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:483
|
||||
#: rog-control-center/ui/pages/system.slint:491
|
||||
msgctxt "PageSystem"
|
||||
msgid "Throttle Policy for power state"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:489
|
||||
#: rog-control-center/ui/pages/system.slint:497
|
||||
msgctxt "PageSystem"
|
||||
msgid "Throttle Policy on Battery"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:499 rog-control-center/ui/pages/system.slint:520
|
||||
#: rog-control-center/ui/pages/system.slint:507 rog-control-center/ui/pages/system.slint:528
|
||||
msgctxt "PageSystem"
|
||||
msgid "Enabled"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/pages/system.slint:510
|
||||
#: rog-control-center/ui/pages/system.slint:518
|
||||
msgctxt "PageSystem"
|
||||
msgid "Throttle Policy on AC"
|
||||
msgstr ""
|
||||
@@ -728,47 +728,47 @@ msgctxt "AuraPowerGroupOld"
|
||||
msgid "Sleep"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/widgets/common.slint:133
|
||||
#: rog-control-center/ui/widgets/common.slint:136
|
||||
msgctxt "confirm_reset"
|
||||
msgid "Are you sure you want to reset this?"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/main_window.slint:54
|
||||
#: rog-control-center/ui/main_window.slint:55
|
||||
msgctxt "MainWindow"
|
||||
msgid "ROG"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/main_window.slint:56
|
||||
#: rog-control-center/ui/main_window.slint:57
|
||||
msgctxt "Menu1"
|
||||
msgid "System Control"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/main_window.slint:57
|
||||
#: rog-control-center/ui/main_window.slint:58
|
||||
msgctxt "Menu2"
|
||||
msgid "Keyboard Aura"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/main_window.slint:58
|
||||
#: rog-control-center/ui/main_window.slint:59
|
||||
msgctxt "Menu3"
|
||||
msgid "AniMe Matrix"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/main_window.slint:59
|
||||
#: rog-control-center/ui/main_window.slint:60
|
||||
msgctxt "Menu4"
|
||||
msgid "Fan Curves"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/main_window.slint:60
|
||||
#: rog-control-center/ui/main_window.slint:61
|
||||
msgctxt "Menu5"
|
||||
msgid "App Settings"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/main_window.slint:61
|
||||
#: rog-control-center/ui/main_window.slint:62
|
||||
msgctxt "Menu6"
|
||||
msgid "About"
|
||||
msgstr ""
|
||||
|
||||
#: rog-control-center/ui/main_window.slint:73
|
||||
#: rog-control-center/ui/main_window.slint:74
|
||||
msgctxt "MainWindow"
|
||||
msgid "Quit App"
|
||||
msgstr ""
|
||||
|
||||
@@ -19,6 +19,7 @@ export { AppSize, AttrMinMax, SystemPageData, AnimePageData, AppSettingsPageData
|
||||
|
||||
export component MainWindow inherits Window {
|
||||
title: "ROG Control";
|
||||
always-on-top: true;
|
||||
default-font-family: "Noto Sans";
|
||||
default-font-size: 14px;
|
||||
default-font-weight: 400;
|
||||
|
||||
@@ -4,12 +4,12 @@ import { Palette, HorizontalBox , VerticalBox, ScrollView, Slider, Button, Switc
|
||||
export struct AttrMinMax {
|
||||
min: int,
|
||||
max: int,
|
||||
val: float,
|
||||
current: float,
|
||||
}
|
||||
|
||||
export struct AttrPossible {
|
||||
range: [int],
|
||||
val: int,
|
||||
current: int,
|
||||
}
|
||||
|
||||
export global SystemPageData {
|
||||
@@ -54,7 +54,7 @@ export global SystemPageData {
|
||||
in-out property <AttrMinMax> ppt_pl1_spl: {
|
||||
min: 0,
|
||||
max: 100,
|
||||
val: 20,
|
||||
current: 20,
|
||||
};
|
||||
callback cb_ppt_pl1_spl(int);
|
||||
callback cb_default_ppt_pl1_spl();
|
||||
@@ -62,7 +62,7 @@ export global SystemPageData {
|
||||
in-out property <AttrMinMax> ppt_pl2_sppt: {
|
||||
min: 0,
|
||||
max: 100,
|
||||
val: 20,
|
||||
current: 20,
|
||||
};
|
||||
callback cb_ppt_pl2_sppt(int);
|
||||
callback cb_default_ppt_pl2_sppt();
|
||||
@@ -70,7 +70,7 @@ export global SystemPageData {
|
||||
in-out property <AttrMinMax> ppt_pl3_fppt: {
|
||||
min: 0,
|
||||
max: 100,
|
||||
val: 20,
|
||||
current: 20,
|
||||
};
|
||||
callback cb_ppt_pl3_fppt(int);
|
||||
callback cb_default_ppt_pl3_fppt();
|
||||
@@ -78,7 +78,7 @@ export global SystemPageData {
|
||||
in-out property <AttrMinMax> ppt_fppt: {
|
||||
min: 0,
|
||||
max: 100,
|
||||
val: 20,
|
||||
current: 20,
|
||||
};
|
||||
callback cb_ppt_fppt(int);
|
||||
callback cb_default_ppt_fppt();
|
||||
@@ -86,7 +86,7 @@ export global SystemPageData {
|
||||
in-out property <AttrMinMax> ppt_apu_sppt: {
|
||||
min: 0,
|
||||
max: 100,
|
||||
val: 20,
|
||||
current: 20,
|
||||
};
|
||||
callback cb_ppt_apu_sppt(int);
|
||||
callback cb_default_ppt_apu_sppt();
|
||||
@@ -94,7 +94,7 @@ export global SystemPageData {
|
||||
in-out property <AttrMinMax> ppt_platform_sppt: {
|
||||
min: 0,
|
||||
max: 100,
|
||||
val: 20,
|
||||
current: 20,
|
||||
};
|
||||
callback cb_ppt_platform_sppt(int);
|
||||
callback cb_default_ppt_platform_sppt();
|
||||
@@ -102,7 +102,7 @@ export global SystemPageData {
|
||||
in-out property <AttrMinMax> nv_dynamic_boost: {
|
||||
min: 0,
|
||||
max: 30,
|
||||
val: 5,
|
||||
current: 5,
|
||||
};
|
||||
callback cb_nv_dynamic_boost(int);
|
||||
callback cb_default_nv_dynamic_boost();
|
||||
@@ -110,7 +110,7 @@ export global SystemPageData {
|
||||
in-out property <AttrMinMax> nv_temp_target: {
|
||||
min: 0,
|
||||
max: 80,
|
||||
val: 75,
|
||||
current: 75,
|
||||
};
|
||||
callback cb_nv_temp_target(int);
|
||||
callback cb_default_nv_temp_target();
|
||||
@@ -237,7 +237,7 @@ export component PageSystem inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
if SystemPageData.ppt_pl1_spl.val != -1 || SystemPageData.ppt_pl2_sppt.val != -1 || SystemPageData.nv_dynamic_boost.val != -1: HorizontalLayout {
|
||||
if SystemPageData.ppt_pl1_spl.current != -1 || SystemPageData.ppt_pl2_sppt.current != -1 || SystemPageData.nv_dynamic_boost.current != -1: HorizontalLayout {
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
alignment: LayoutAlignment.space-between;
|
||||
@@ -258,137 +258,145 @@ export component PageSystem inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
if SystemPageData.ppt_pl1_spl.val != -1: SystemSlider {
|
||||
if SystemPageData.ppt_pl1_spl.current != -1: SystemSlider {
|
||||
text: @tr("ppt_pl1_spl" => "CPU Sustained Power Limit");
|
||||
title: @tr("ppt_pl1_spl" => "CPU Sustained Power Limit");
|
||||
help_text: @tr("ppt_pl1_spl_help" => "Long-term CPU power limit that affects sustained workload performance. Higher values may increase heat and power consumption.");
|
||||
minimum: SystemPageData.ppt_pl1_spl.min;
|
||||
maximum: SystemPageData.ppt_pl1_spl.max;
|
||||
value: SystemPageData.ppt_pl1_spl.val;
|
||||
value: SystemPageData.ppt_pl1_spl.current;
|
||||
enabled <=> SystemPageData.enable_ppt_group;
|
||||
has_reset: true;
|
||||
cb_do_reset => {
|
||||
SystemPageData.cb_default_ppt_pl1_spl();
|
||||
}
|
||||
released => {
|
||||
SystemPageData.ppt_pl1_spl.val = self.value;
|
||||
SystemPageData.ppt_pl1_spl.current = self.value;
|
||||
SystemPageData.cb_ppt_pl1_spl(Math.round(self.value));
|
||||
}
|
||||
}
|
||||
|
||||
if SystemPageData.ppt_pl2_sppt.val != -1: SystemSlider {
|
||||
if SystemPageData.ppt_pl2_sppt.current != -1: SystemSlider {
|
||||
text: @tr("ppt_pl2_sppt" => "CPU Turbo Power Limit");
|
||||
title: @tr("ppt_pl2_sppt" => "CPU Turbo Power Limit");
|
||||
help_text: @tr("ppt_pl2_sppt_help" => "Short-term CPU power limit for boost periods. Controls maximum power during brief high-performance bursts.");
|
||||
minimum: SystemPageData.ppt_pl2_sppt.min;
|
||||
maximum: SystemPageData.ppt_pl2_sppt.max;
|
||||
value: SystemPageData.ppt_pl2_sppt.val;
|
||||
value: SystemPageData.ppt_pl2_sppt.current;
|
||||
enabled <=> SystemPageData.enable_ppt_group;
|
||||
has_reset: true;
|
||||
cb_do_reset => {
|
||||
SystemPageData.cb_default_ppt_pl2_sppt();
|
||||
}
|
||||
released => {
|
||||
SystemPageData.ppt_pl2_sppt.val = self.value;
|
||||
SystemPageData.ppt_pl2_sppt.current = self.value;
|
||||
SystemPageData.cb_ppt_pl2_sppt(Math.round(self.value))
|
||||
}
|
||||
}
|
||||
|
||||
if SystemPageData.ppt_pl3_fppt.val != -1: SystemSlider {
|
||||
if SystemPageData.ppt_pl3_fppt.current != -1: SystemSlider {
|
||||
text: @tr("ppt_pl3_fppt" => "CPU Fast Burst Power Limit");
|
||||
title: @tr("ppt_pl3_fppt" => "CPU Fast Burst Power Limit");
|
||||
help_text: @tr("ppt_pl3_fppt_help" => "Ultra-short duration power limit for instantaneous CPU bursts. Affects responsiveness during sudden workload spikes.");
|
||||
minimum: SystemPageData.ppt_pl3_fppt.min;
|
||||
maximum: SystemPageData.ppt_pl3_fppt.max;
|
||||
value: SystemPageData.ppt_pl3_fppt.val;
|
||||
value: SystemPageData.ppt_pl3_fppt.current;
|
||||
enabled <=> SystemPageData.enable_ppt_group;
|
||||
has_reset: true;
|
||||
cb_do_reset => {
|
||||
SystemPageData.cb_default_ppt_pl3_fppt();
|
||||
}
|
||||
released => {
|
||||
SystemPageData.ppt_pl3_fppt.val = self.value;
|
||||
SystemPageData.ppt_pl3_fppt.current = self.value;
|
||||
SystemPageData.cb_ppt_pl3_fppt(Math.round(self.value))
|
||||
}
|
||||
}
|
||||
if SystemPageData.ppt_fppt.val != -1: SystemSlider {
|
||||
if SystemPageData.ppt_fppt.current != -1: SystemSlider {
|
||||
text: @tr("ppt_fppt" => "Fast Package Power Limit");
|
||||
title: @tr("ppt_fppt" => "Fast Package Power Limit");
|
||||
help_text: @tr("ppt_fppt_help" => "Ultra-short duration power limit for system package. Controls maximum power during millisecond-scale load spikes.");
|
||||
minimum: SystemPageData.ppt_fppt.min;
|
||||
maximum: SystemPageData.ppt_fppt.max;
|
||||
value: SystemPageData.ppt_fppt.val;
|
||||
value: SystemPageData.ppt_fppt.current;
|
||||
enabled <=> SystemPageData.enable_ppt_group;
|
||||
has_reset: true;
|
||||
cb_do_reset => {
|
||||
SystemPageData.cb_default_ppt_fppt();
|
||||
}
|
||||
released => {
|
||||
SystemPageData.ppt_fppt.val = self.value;
|
||||
SystemPageData.ppt_fppt.current = self.value;
|
||||
SystemPageData.cb_ppt_fppt(Math.round(self.value))
|
||||
}
|
||||
}
|
||||
|
||||
if SystemPageData.ppt_apu_sppt.val != -1: SystemSlider {
|
||||
if SystemPageData.ppt_apu_sppt.current != -1: SystemSlider {
|
||||
text: @tr("ppt_apu_sppt" => "APU Sustained Power Limit");
|
||||
title: @tr("ppt_apu_sppt" => "APU Sustained Power Limit");
|
||||
help_text: @tr("ppt_apu_sppt_help" => "Long-term power limit for integrated graphics and CPU combined. Affects sustained performance of APU-based workloads.");
|
||||
minimum: SystemPageData.ppt_apu_sppt.min;
|
||||
maximum: SystemPageData.ppt_apu_sppt.max;
|
||||
value: SystemPageData.ppt_apu_sppt.val;
|
||||
value: SystemPageData.ppt_apu_sppt.current;
|
||||
enabled <=> SystemPageData.enable_ppt_group;
|
||||
has_reset: true;
|
||||
cb_do_reset => {
|
||||
SystemPageData.cb_default_ppt_apu_sppt();
|
||||
}
|
||||
released => {
|
||||
SystemPageData.ppt_apu_sppt.val = self.value;
|
||||
SystemPageData.ppt_apu_sppt.current = self.value;
|
||||
SystemPageData.cb_ppt_apu_sppt(Math.round(self.value))
|
||||
}
|
||||
}
|
||||
|
||||
if SystemPageData.ppt_platform_sppt.val != -1: SystemSlider {
|
||||
if SystemPageData.ppt_platform_sppt.current != -1: SystemSlider {
|
||||
text: @tr("ppt_platform_sppt" => "Platform Sustained Power Limit");
|
||||
title: @tr("ppt_platform_sppt" => "Platform Sustained Power Limit");
|
||||
help_text: @tr("ppt_platform_sppt_help" => "Overall system power limit for sustained operations. Controls total platform power consumption over extended periods.");
|
||||
minimum: SystemPageData.ppt_platform_sppt.min;
|
||||
maximum: SystemPageData.ppt_platform_sppt.max;
|
||||
value: SystemPageData.ppt_platform_sppt.val;
|
||||
value: SystemPageData.ppt_platform_sppt.current;
|
||||
enabled <=> SystemPageData.enable_ppt_group;
|
||||
has_reset: true;
|
||||
cb_do_reset => {
|
||||
SystemPageData.cb_default_ppt_platform_sppt();
|
||||
}
|
||||
released => {
|
||||
SystemPageData.ppt_platform_sppt.val = self.value;
|
||||
SystemPageData.ppt_platform_sppt.current = self.value;
|
||||
SystemPageData.cb_ppt_platform_sppt(Math.round(self.value))
|
||||
}
|
||||
}
|
||||
|
||||
if SystemPageData.nv_dynamic_boost.val != -1: SystemSlider {
|
||||
if SystemPageData.nv_dynamic_boost.current != -1: SystemSlider {
|
||||
text: @tr("nv_dynamic_boost" => "GPU Power Boost");
|
||||
title: @tr("nv_dynamic_boost" => "GPU Power Boost");
|
||||
help_text: @tr("nv_dynamic_boost_help" => "Additional power allocation for GPU dynamic boost. Higher values increase GPU performance but generate more heat.");
|
||||
minimum: SystemPageData.nv_dynamic_boost.min;
|
||||
maximum: SystemPageData.nv_dynamic_boost.max;
|
||||
value: SystemPageData.nv_dynamic_boost.val;
|
||||
value: SystemPageData.nv_dynamic_boost.current;
|
||||
enabled <=> SystemPageData.enable_ppt_group;
|
||||
has_reset: true;
|
||||
cb_do_reset => {
|
||||
SystemPageData.cb_default_nv_dynamic_boost();
|
||||
}
|
||||
released => {
|
||||
SystemPageData.nv_dynamic_boost.val = self.value;
|
||||
SystemPageData.nv_dynamic_boost.current = self.value;
|
||||
SystemPageData.cb_nv_dynamic_boost(Math.round(self.value))
|
||||
}
|
||||
}
|
||||
|
||||
if SystemPageData.nv_temp_target.val != -1: SystemSlider {
|
||||
if SystemPageData.nv_temp_target.current != -1: SystemSlider {
|
||||
text: @tr("nv_temp_target" => "GPU Temperature Limit");
|
||||
title: @tr("nv_temp_target" => "GPU Temperature Limit");
|
||||
help_text: @tr("nv_temp_target_help" => "Maximum GPU temperature threshold in Celsius. GPU will throttle to maintain temperature below this limit.");
|
||||
minimum: SystemPageData.nv_temp_target.min;
|
||||
maximum: SystemPageData.nv_temp_target.max;
|
||||
value: SystemPageData.nv_temp_target.val;
|
||||
value: SystemPageData.nv_temp_target.current;
|
||||
enabled <=> SystemPageData.enable_ppt_group;
|
||||
has_reset: true;
|
||||
cb_do_reset => {
|
||||
SystemPageData.cb_default_nv_temp_target();
|
||||
}
|
||||
released => {
|
||||
SystemPageData.nv_temp_target.val = self.value;
|
||||
SystemPageData.nv_temp_target.current = self.value;
|
||||
SystemPageData.cb_nv_temp_target(Math.round(self.value))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +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 <float> value;
|
||||
in-out property <float> minimum;
|
||||
in-out property <float> maximum;
|
||||
@@ -27,6 +28,7 @@ export component SystemSlider inherits RogItem {
|
||||
alignment: LayoutAlignment.stretch;
|
||||
padding-left: 10px;
|
||||
TouchArea {
|
||||
enabled <=> root.enabled;
|
||||
clicked => {
|
||||
slider.value += 1;
|
||||
if slider.value > slider.maximum {
|
||||
@@ -57,6 +59,7 @@ export component SystemSlider inherits RogItem {
|
||||
// alignment: LayoutAlignment.end;
|
||||
padding-right: 20px;
|
||||
slider := Slider {
|
||||
enabled <=> root.enabled;
|
||||
maximum: root.maximum;
|
||||
minimum: root.minimum;
|
||||
value <=> root.value;
|
||||
@@ -150,6 +153,7 @@ export component SystemSlider inherits RogItem {
|
||||
reset := HorizontalBox {
|
||||
if (has_reset): StandardButton {
|
||||
kind: StandardButtonKind.reset;
|
||||
enabled <=> root.enabled;
|
||||
clicked => {
|
||||
reset_popup.show();
|
||||
}
|
||||
|
||||
@@ -172,8 +172,8 @@ impl Attribute {
|
||||
)
|
||||
}
|
||||
|
||||
pub fn get_watcher(&self) -> Result<inotify::Inotify, PlatformError> {
|
||||
let path = self.base_path.join("current_value");
|
||||
pub fn get_watcher(&self, attr: &str) -> Result<inotify::Inotify, PlatformError> {
|
||||
let path = self.base_path.join(attr);
|
||||
if let Some(path) = path.to_str() {
|
||||
let inotify = inotify::Inotify::init()?;
|
||||
inotify
|
||||
@@ -317,7 +317,13 @@ impl FirmwareAttribute {
|
||||
| FirmwareAttribute::PptFppt
|
||||
| FirmwareAttribute::PptApuSppt
|
||||
| FirmwareAttribute::PptPlatformSppt
|
||||
| FirmwareAttribute::NvDynamicBoost
|
||||
)
|
||||
}
|
||||
|
||||
pub fn is_dgpu(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
FirmwareAttribute::NvDynamicBoost
|
||||
| FirmwareAttribute::NvTempTarget
|
||||
| FirmwareAttribute::DgpuTgp
|
||||
)
|
||||
@@ -338,7 +344,7 @@ impl From<&str> for FirmwareAttribute {
|
||||
"ppt_platform_sppt" => Self::PptPlatformSppt,
|
||||
"nv_dynamic_boost" => Self::NvDynamicBoost,
|
||||
"nv_temp_target" => Self::NvTempTarget,
|
||||
"dgpu_base_tgp" => Self::DgpuBaseTgp,
|
||||
"nv_base_tgp" => Self::DgpuBaseTgp,
|
||||
"dgpu_tgp" => Self::DgpuTgp,
|
||||
"charge_mode" => Self::ChargeMode,
|
||||
"boot_sound" => Self::BootSound,
|
||||
|
||||
Reference in New Issue
Block a user