diff --git a/data/asusd.rules b/data/asusd.rules index e0f136f4..c28d47b3 100644 --- a/data/asusd.rules +++ b/data/asusd.rules @@ -15,7 +15,7 @@ ENV{DMI_FAMILY}=="*TX Gaming*", GOTO="asusd_start" GOTO="asusd_end" LABEL="asusd_start" -ACTION=="add|change", DRIVER=="asus-nb-wmi", TAG+="systemd", ENV{SYSTEMD_WANTS}="asusd.service" -ACTION=="add|remove", DRIVER=="asus-nb-wmi", TAG+="systemd", RUN+="/usr/bin/systemctl restart asusd.service" +ACTION=="add|change", DRIVER=="asus-nb-wmi", TAG+="systemd", ENV{SYSTEMD_WANTS}+="asusd.service" +ACTION=="add|remove", DRIVER=="asus-nb-wmi", TAG+="systemd", ENV{SYSTEMD_WANTS}+="asusd.service" LABEL="asusd_end" diff --git a/distro-packaging/asusctl.spec b/distro-packaging/asusctl.spec index a1d6524a..c4b851a5 100755 --- a/distro-packaging/asusctl.spec +++ b/distro-packaging/asusctl.spec @@ -92,7 +92,9 @@ EOF %build export RUSTFLAGS="%{rustflags}" %if %{defined fedora} -%cargo_build +%# Use an explicit cargo invocation for Fedora to avoid the macro adding `--locked`. +%# `--locked` breaks Fedora builds because the lockfile may not be appropriate for the distro buildroot. +/usr/bin/cargo auditable build --release %else /usr/bin/cargo auditable build --release %endif diff --git a/rog-control-center/src/notify.rs b/rog-control-center/src/notify.rs index 3302b51e..031607fe 100644 --- a/rog-control-center/src/notify.rs +++ b/rog-control-center/src/notify.rs @@ -203,11 +203,19 @@ pub fn start_notifications( })?; let proxy_copy = proxy.clone(); + let enabled_notifications_copy_action = enabled_notifications_copy.clone(); let mut p = proxy.receive_notify_action().await?; tokio::spawn(async move { info!("Started zbus signal thread: receive_notify_action"); while let Some(e) = p.next().await { if let Ok(out) = e.args() { + // Respect user notification settings for gpu actions + if let Ok(cfg) = enabled_notifications_copy_action.lock() { + if !cfg.notifications.enabled || !cfg.notifications.receive_notify_gfx { + continue; + } + } + let action = out.action(); let mode = convert_gfx_mode(proxy.mode().await.unwrap_or_default()); match action { @@ -309,7 +317,9 @@ fn do_gfx_action_notif(message: &str, action: GfxUserAction, mode: GpuMode) -> R //.hint(Hint::Resident(true)) .hint(Hint::Category("device".into())) .urgency(Urgency::Critical) - .timeout(Timeout::Never) + // For user-action notifications keep them visible if they require interaction + // but for non-interactive actions we prefer they auto-hide like other notifs. + .timeout(Timeout::Milliseconds(6000)) .icon("dialog-warning") .hint(Hint::Transient(true));