Conversation
Signed-off-by: Peter Jung <admin@ptr1337.dev>
There was a problem hiding this comment.
Pull request overview
Adds an opt-in “GPU Boosters” tweak to the app, intended to improve GPU/VRAM-related behavior by installing booster packages and only surfacing the option on Intel/AMD systems.
Changes:
- Introduces Intel/AMD GPU detection helpers and wires them into tweak visibility.
- Adds a new
GpuBoosterstweak backed by package install/remove (instead of systemd units). - Updates GUI + CLI tweak handling to support “package”-type tweaks; adds tooltip string.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/window.rs | Formatting-only change in locale switching element list. |
| src/utils.rs | Adds GPU vendor/class detection and a helper to detect Intel/AMD GPUs. |
| src/tweak.rs | Adds GpuBoosters tweak, visibility gating, and package-list helpers. |
| src/systemd_units.rs | Minor formatting refactor in enabled-unit query. |
| src/pages/tweaks.rs | GUI tweaks page updated to hide/show GPU tweak and to toggle package-based tweaks. |
| src/logger.rs | Formatting-only change to env filter initialization. |
| src/cli_handler.rs | CLI tweak enable/disable + list updated to support package-based tweaks and visibility filtering. |
| src/actions.rs | Formatting-only change to nmcli invocation args. |
| i18n/en/cachyos_hello.ftl | Adds tooltip text for the new GPU Boosters tweak. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/pages/tweaks.rs
Outdated
| if action_type == "package" { | ||
| let success = if action_enabled { | ||
| utils::run_cmd_terminal( | ||
| crate::gui::run_command, | ||
| format!("pacman -Rns {alpm_package_name}"), | ||
| true, | ||
| ) && !tweak::are_any_packages_installed(&alpm_package_name) | ||
| } else { | ||
| utils::run_cmd_terminal( | ||
| crate::gui::run_command, | ||
| format!("pacman -S {alpm_package_name}"), | ||
| true, | ||
| ) && tweak::are_packages_installed(&alpm_package_name) | ||
| }; | ||
|
|
||
| let result = if success { | ||
| ToggleResult::Success(!action_enabled) | ||
| } else { | ||
| let message = if action_enabled { | ||
| format!("Failed to remove required package(s): {alpm_package_name}") | ||
| } else { | ||
| fl!("package-not-installed", package_name = alpm_package_name) | ||
| }; | ||
| ToggleResult::Failed { restored_state: action_enabled, message } | ||
| }; | ||
| tx.send(result).expect("Couldn't send data to channel"); | ||
| return; |
src/pages/tweaks.rs
Outdated
| } else { | ||
| let message = if action_enabled { | ||
| format!("Failed to remove required package(s): {alpm_package_name}") | ||
| } else { | ||
| fl!("package-not-installed", package_name = alpm_package_name) | ||
| }; | ||
| ToggleResult::Failed { restored_state: action_enabled, message } |
src/tweak.rs
Outdated
| pub fn are_packages_installed(package_names: &str) -> bool { | ||
| package_names.split_whitespace().all(crate::utils::is_alpm_pkg_installed) | ||
| } | ||
|
|
||
| pub fn are_any_packages_installed(package_names: &str) -> bool { | ||
| package_names.split_whitespace().any(crate::utils::is_alpm_pkg_installed) | ||
| } |
src/tweak.rs
Outdated
| @@ -29,9 +32,25 @@ pub fn get_details(tweak: TweakName) -> (&'static str, &'static str, &'static st | |||
| TweakName::CachyUpdate => { | |||
| ("user_service", "arch-update.timer arch-update-tray.service", "cachy-update") | |||
| }, | |||
| TweakName::GpuBoosters => ("package", "", "dmemcg-booster plasma-foreground-booster"), | |||
| } | |||
src/cli_handler.rs
Outdated
| if action_type == "package" { | ||
| if enable { | ||
| if !tweak::are_packages_installed(alpm_package_name) { | ||
| println!( | ||
| "Required package '{}' is not installed. Installing...", | ||
| alpm_package_name.yellow() | ||
| ); | ||
| let status = crate::cli::run_command( | ||
| &format!("pacman -S --noconfirm {alpm_package_name}"), | ||
| true, | ||
| ); | ||
| if !status || !tweak::are_packages_installed(alpm_package_name) { | ||
| anyhow::bail!( | ||
| "Failed to install required package '{alpm_package_name}'. Cannot enable tweak." | ||
| ); | ||
| } | ||
| } |
Signed-off-by: Peter Jung <admin@ptr1337.dev>
There was a problem hiding this comment.
Pull request overview
Adds an opt-in “GPU boosters” install feature (for Intel/AMD) and improves tweak toggle error handling, integrating the new action across GUI, CLI, actions, and i18n.
Changes:
- Add GPU detection helpers and gate the new “Install GPU Boosters” GUI button to Intel/AMD hardware.
- Introduce
InstallGpuBoostersaction/CLI fix command and wire it to installdmemcg-booster+plasma-foreground-booster. - Improve tweak toggling feedback by returning structured success/failure results and showing error dialogs on failure.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils.rs | Adds Intel/AMD GPU detection helpers + unit test. |
| src/pages/mod.rs | Conditionally shows and wires “Install GPU Boosters” button in GUI. |
| src/ui.rs | Adds Action::InstallGpuBoosters for dialog routing. |
| src/actions.rs | Adds install_gpu_boosters() using existing package-install helper. |
| src/cli.rs | Adds FixAction::InstallGpuBoosters to CLI. |
| src/cli_handler.rs | Handles new CLI fix action by calling actions::install_gpu_boosters. |
| src/pages/tweaks.rs | Refactors service toggle flow to report failures with messages. |
| src/tweak.rs | Trailing newline only. |
| i18n/en/cachyos_hello.ftl | Adds English strings for GPU boosters button/tooltip + installed message. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ToggleResult::Failed { | ||
| restored_state: new_state, | ||
| message: format!("Failed to update tweak state for {action_data}"), | ||
| } |
| package-not-installed = Package '{$package_name}' has not been installed! | ||
| gaming-package-installed = Gaming packages already installed! | ||
| winboat-package-installed = Winboat packages already installed! | ||
| gpu-boosters-package-installed = GPU booster packages already installed! | ||
|
|
There was a problem hiding this comment.
Yeah, will do later i18n stuff when more or less approved
| install-gaming-title = Install Gaming packages | ||
| install-winboat-title = Install Winboat | ||
| install-gpu-boosters-title = Install GPU Boosters | ||
| install-gpu-boosters-tooltip = Install dmemcg-booster and plasma-foreground-booster on AMD or Intel GPUs |
| FixAction::InstallGpuBoosters => { | ||
| println!("{}", "Installing GPU booster packages...".bold()); | ||
| actions::install_gpu_boosters(crate::cli::run_command, tx); | ||
| }, |
Adds new feature developed by Pixelclustr to improve the VRAM behaviour. This is optin and should be showed only on Intel and AMD GPUs