Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion rog-control-center/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ futures-util.workspace = true
thiserror.workspace = true
udev.workspace = true
serde_json.workspace = true
nvml-wrapper.workspace = true

[dependencies.slint]
git = "https://github.com/slint-ui/slint.git"
Expand Down
41 changes: 2 additions & 39 deletions rog-control-center/src/notify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn dgpu_status_for_tick(
}
}

fn start_dpu_status_mon(config: Arc<Mutex<Config>>, gpu_status_tx: watch::Sender<GfxPower>) {
fn start_dgpu_status_mon(config: Arc<Mutex<Config>>, gpu_status_tx: watch::Sender<GfxPower>) {
use rog_platform::gpu_pci::{asus_dgpu_disabled, asus_gpu_mux_discreet, Device};

let find_dgpu = || {
Expand Down Expand Up @@ -197,44 +197,7 @@ pub fn start_notifications(
});

info!("Attempting to start plain dgpu status monitor");
start_dpu_status_mon(config.clone(), gpu_status_tx);

// GPU MUX Mode notif
// TODO: need to get armoury attrs and iter to find
// let enabled_notifications_copy = config.clone();
// tokio::spawn(async move {
// let conn = zbus::Connection::system().await.map_err(|e| {
// error!("zbus signal: receive_notify_gpu_mux_mode: {e}");
// e
// })?;
// let proxy = PlatformProxy::new(&conn).await.map_err(|e| {
// error!("zbus signal: receive_notify_gpu_mux_mode: {e}");
// e
// })?;

// let mut actual_mux_mode = GpuMode::Error;
// if let Ok(mode) = proxy.gpu_mux_mode().await {
// actual_mux_mode = GpuMode::from(mode);
// }

// info!("Started zbus signal thread: receive_notify_gpu_mux_mode");
// while let Some(e) =
// proxy.receive_gpu_mux_mode_changed().await.next().await { if let
// Ok(config) = enabled_notifications_copy.lock() { if
// !config.notifications.enabled || !config.notifications.receive_notify_gfx {
// continue;
// }
// }
// if let Ok(out) = e.get().await {
// let mode = GpuMode::from(out);
// if mode == actual_mux_mode {
// continue;
// }
// do_mux_notification("Reboot required. BIOS GPU MUX mode set to",
// &mode).ok(); }
// }
// Ok::<(), zbus::Error>(())
// });
start_dgpu_status_mon(config.clone(), gpu_status_tx);

Ok(vec![blocking])
}
Expand Down
11 changes: 7 additions & 4 deletions rog-control-center/src/ui/setup_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,15 @@ pub fn setup_system_page(
};

let cpu_temp = rog_platform::cpu::get_cpu_temp();
let gpu_temp = rog_platform::gpu_pci::get_gpu_temp();
let igpu_temp = rog_platform::gpu_pci::get_igpu_temp();
let gpu_telemetry = rog_platform::gpu_pci::get_gpu_telemetry();
let gpu_temp = gpu_telemetry.dgpu_temp;
let igpu_temp = gpu_telemetry.igpu_temp;
let dgpu_suspended = gpu_telemetry.dgpu_suspended;
let (cpu_fan, gpu_fan, mid_fan) = rog_platform::platform::get_fan_rpms();
let cpu_freq = rog_platform::cpu::get_cpu_frequency_mhz();
let ram_usage = rog_platform::cpu::get_ram_usage_pct();
let gpu_usage = rog_platform::gpu_pci::get_gpu_usage_pct();
let igpu_usage = rog_platform::gpu_pci::get_igpu_usage_pct();
let gpu_usage = gpu_telemetry.dgpu_usage;
let igpu_usage = gpu_telemetry.igpu_usage;

let curr_ticks = rog_platform::cpu::read_cpu_ticks();
let cpu_usage = if let (Some(p), Some(c)) = (&prev_ticks, &curr_ticks) {
Expand Down Expand Up @@ -178,6 +180,7 @@ pub fn setup_system_page(
data.set_cpu_temp_val(cpu_temp);
data.set_gpu_temp_val(gpu_temp);
data.set_igpu_temp_val(igpu_temp);
data.set_dgpu_suspended(dgpu_suspended);
data.set_cpu_usage_val(cpu_usage);
data.set_gpu_usage_val(gpu_usage);
data.set_igpu_usage_val(igpu_usage);
Expand Down
6 changes: 6 additions & 0 deletions rog-control-center/translations/az/rog-control-center.po
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,12 @@ msgctxt "PageSystem"
msgid "N/A"
msgstr "Mövcud deyil"

#: rog-control-center/ui/pages/system.slint:373
#: rog-control-center/ui/pages/system.slint:386
msgctxt "PageSystem"
msgid "Suspended"
msgstr "Dayandırılıb"

#: rog-control-center/ui/pages/system.slint:351
#, fuzzy
msgctxt "PageSystem"
Expand Down
6 changes: 6 additions & 0 deletions rog-control-center/translations/en/rog-control-center.po
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,12 @@ msgctxt "PageSystem"
msgid "dGPU Status"
msgstr ""

#: rog-control-center/ui/pages/system.slint:373
#: rog-control-center/ui/pages/system.slint:386
msgctxt "PageSystem"
msgid "Suspended"
msgstr ""

#: rog-control-center/ui/pages/system.slint:394
msgctxt "PageSystem"
msgid "Fan Speeds"
Expand Down
6 changes: 6 additions & 0 deletions rog-control-center/translations/fr/rog-control-center.po
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,12 @@ msgctxt "PageSystem"
msgid "N/A"
msgstr "N/A"

#: rog-control-center/ui/pages/system.slint:373
#: rog-control-center/ui/pages/system.slint:386
msgctxt "PageSystem"
msgid "Suspended"
msgstr "Suspendue"

#: rog-control-center/ui/pages/system.slint:351
#, fuzzy
msgctxt "PageSystem"
Expand Down
6 changes: 6 additions & 0 deletions rog-control-center/translations/it/rog-control-center.po
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,12 @@ msgctxt "PageSystem"
msgid "N/A"
msgstr "N/D"

#: rog-control-center/ui/pages/system.slint:373
#: rog-control-center/ui/pages/system.slint:386
msgctxt "PageSystem"
msgid "Suspended"
msgstr "Sospesa"

#: rog-control-center/ui/pages/system.slint:351
msgctxt "PageSystem"
msgid "Fan Speeds"
Expand Down
6 changes: 6 additions & 0 deletions rog-control-center/translations/pt_BR/rog-control-center.po
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,12 @@ msgctxt "PageSystem"
msgid "N/A"
msgstr "N/A"

#: rog-control-center/ui/pages/system.slint:373
#: rog-control-center/ui/pages/system.slint:386
msgctxt "PageSystem"
msgid "Suspended"
msgstr "Suspensa"

#: rog-control-center/ui/pages/system.slint:351
#, fuzzy
msgctxt "PageSystem"
Expand Down
6 changes: 6 additions & 0 deletions rog-control-center/translations/ru/rog-control-center.po
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,12 @@ msgctxt "PageSystem"
msgid "N/A"
msgstr "Н/Д"

#: rog-control-center/ui/pages/system.slint:373
#: rog-control-center/ui/pages/system.slint:386
msgctxt "PageSystem"
msgid "Suspended"
msgstr "Приостановлено"

#: rog-control-center/ui/pages/system.slint:351
#, fuzzy
msgctxt "PageSystem"
Expand Down
6 changes: 6 additions & 0 deletions rog-control-center/translations/tr/rog-control-center.po
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,12 @@ msgctxt "PageSystem"
msgid "N/A"
msgstr "N/A"

#: rog-control-center/ui/pages/system.slint:373
#: rog-control-center/ui/pages/system.slint:386
msgctxt "PageSystem"
msgid "Suspended"
msgstr "Askıda"

#: rog-control-center/ui/pages/system.slint:351
#, fuzzy
msgctxt "PageSystem"
Expand Down
6 changes: 6 additions & 0 deletions rog-control-center/translations/uk_UA/rog-control-center.po
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,12 @@ msgctxt "PageSystem"
msgid "N/A"
msgstr "Н/Д"

#: rog-control-center/ui/pages/system.slint:373
#: rog-control-center/ui/pages/system.slint:386
msgctxt "PageSystem"
msgid "Suspended"
msgstr "Призупинено"

#: rog-control-center/ui/pages/system.slint:351
#, fuzzy
msgctxt "PageSystem"
Expand Down
6 changes: 6 additions & 0 deletions rog-control-center/translations/zh_CN/rog-control-center.po
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,12 @@ msgctxt "PageSystem"
msgid "N/A"
msgstr "无"

#: rog-control-center/ui/pages/system.slint:373
#: rog-control-center/ui/pages/system.slint:386
msgctxt "PageSystem"
msgid "Suspended"
msgstr "已挂起"

#: rog-control-center/ui/pages/system.slint:351
#, fuzzy
msgctxt "PageSystem"
Expand Down
7 changes: 4 additions & 3 deletions rog-control-center/ui/pages/system.slint
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export global SystemPageData {
in-out property <float> igpu_temp_val: -1.0;
in-out property <float> igpu_usage_val: -1.0;
in-out property <bool> has_igpu: false;
in-out property <bool> dgpu_suspended: false;
}

export component PageSystem inherits Rectangle {
Expand Down Expand Up @@ -369,9 +370,9 @@ export component PageSystem inherits Rectangle {
color: Palette.control-foreground;
}
Text {
text: SystemPageData.gpu_temp_val > 0.0 ? (Math.round(SystemPageData.gpu_temp_val) + " °C") : @tr("N/A");
text: SystemPageData.dgpu_suspended ? @tr("Suspended") : (SystemPageData.gpu_temp_val >= 0.0 ? (Math.round(SystemPageData.gpu_temp_val) + " °C") : @tr("N/A"));
font-weight: 700;
color: SystemPageData.gpu_temp_val > 80 ? #ef4444 : (SystemPageData.gpu_temp_val > 65 ? #eab308 : (SystemPageData.gpu_temp_val > 0.0 ? #22c55e : Palette.control-foreground));
color: SystemPageData.dgpu_suspended ? Palette.control-foreground : (SystemPageData.gpu_temp_val > 80 ? #ef4444 : (SystemPageData.gpu_temp_val > 65 ? #eab308 : (SystemPageData.gpu_temp_val >= 0.0 ? #22c55e : Palette.control-foreground)));
}
}

Expand All @@ -382,7 +383,7 @@ export component PageSystem inherits Rectangle {
color: Palette.control-foreground;
}
Text {
text: SystemPageData.gpu_usage_val >= 0.0 ? (Math.round(SystemPageData.gpu_usage_val) + "%") : @tr("N/A");
text: SystemPageData.dgpu_suspended ? @tr("Suspended") : (SystemPageData.gpu_usage_val >= 0.0 ? (Math.round(SystemPageData.gpu_usage_val) + "%") : @tr("N/A"));
font-weight: 700;
color: Palette.control-foreground;
}
Expand Down
Loading