From 086bbd090866bdea1707c9b012f3456f61ac3e61 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Fri, 2 Feb 2024 23:26:41 +1300 Subject: [PATCH] Fix the broken pipe error --- CHANGELOG.md | 4 +++ Cargo.lock | 26 ++++++++++---------- Cargo.toml | 2 +- rog-aura/data/aura_support.ron | 8 ++++++ rog-control-center/src/main.rs | 12 +++++++++ rog-control-center/src/widgets/aura_modes.rs | 1 + rog-control-center/src/widgets/aura_power.rs | 3 +++ 7 files changed, 42 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 120b14b0..f5cd198d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Re-implement the `asusctl -s` command (not fully) - Add more docs to some parts of code, and dbus interfaces - Reload asusd.ron if changed. Does not notify any dbus listeners (yet) +- Fix the broken pipe error + +### Added +- Support for G614J LED modes ## [v5.0.7] ### Changed diff --git a/Cargo.lock b/Cargo.lock index 17d9b886..29a0d3f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -199,7 +199,7 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "asusctl" -version = "5.0.8-RC2" +version = "5.0.8-RC3" dependencies = [ "asusd", "cargo-husky", @@ -219,7 +219,7 @@ dependencies = [ [[package]] name = "asusd" -version = "5.0.8-RC2" +version = "5.0.8-RC3" dependencies = [ "cargo-husky", "concat-idents", @@ -244,7 +244,7 @@ dependencies = [ [[package]] name = "asusd-user" -version = "5.0.8-RC2" +version = "5.0.8-RC3" dependencies = [ "cargo-husky", "config-traits", @@ -847,7 +847,7 @@ dependencies = [ [[package]] name = "config-traits" -version = "5.0.8-RC2" +version = "5.0.8-RC3" dependencies = [ "cargo-husky", "log", @@ -900,7 +900,7 @@ dependencies = [ [[package]] name = "cpuctl" -version = "5.0.8-RC2" +version = "5.0.8-RC3" [[package]] name = "cpufeatures" @@ -1024,7 +1024,7 @@ dependencies = [ [[package]] name = "dmi_id" -version = "5.0.8-RC2" +version = "5.0.8-RC3" dependencies = [ "log", "udev", @@ -2834,7 +2834,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rog-control-center" -version = "5.0.8-RC2" +version = "5.0.8-RC3" dependencies = [ "asusd", "cargo-husky", @@ -2867,7 +2867,7 @@ dependencies = [ [[package]] name = "rog_anime" -version = "5.0.8-RC2" +version = "5.0.8-RC3" dependencies = [ "cargo-husky", "dmi_id", @@ -2884,7 +2884,7 @@ dependencies = [ [[package]] name = "rog_aura" -version = "5.0.8-RC2" +version = "5.0.8-RC3" dependencies = [ "cargo-husky", "dmi_id", @@ -2898,7 +2898,7 @@ dependencies = [ [[package]] name = "rog_dbus" -version = "5.0.8-RC2" +version = "5.0.8-RC3" dependencies = [ "asusd", "cargo-husky", @@ -2911,7 +2911,7 @@ dependencies = [ [[package]] name = "rog_platform" -version = "5.0.8-RC2" +version = "5.0.8-RC3" dependencies = [ "cargo-husky", "concat-idents", @@ -2928,7 +2928,7 @@ dependencies = [ [[package]] name = "rog_profiles" -version = "5.0.8-RC2" +version = "5.0.8-RC3" dependencies = [ "cargo-husky", "log", @@ -2942,7 +2942,7 @@ dependencies = [ [[package]] name = "rog_simulators" -version = "5.0.8-RC2" +version = "5.0.8-RC3" dependencies = [ "glam", "log", diff --git a/Cargo.toml b/Cargo.toml index dd3673fa..3cba41b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ default-members = ["asusctl", "asusd", "asusd-user", "cpuctl", "rog-control-cent resolver = "2" [workspace.package] -version = "5.0.8-RC2" +version = "5.0.8-RC3" rust-version = "1.75" [workspace.dependencies] diff --git a/rog-aura/data/aura_support.ron b/rog-aura/data/aura_support.ron index 3d6cdb0d..23447e4d 100644 --- a/rog-aura/data/aura_support.ron +++ b/rog-aura/data/aura_support.ron @@ -239,6 +239,14 @@ advanced_type: PerKey, power_zones: [Keyboard], ), + ( + board_name: "G614J", + layout_name: "g634j-per-key", + basic_modes: [Static, Breathe, Pulse, Strobe, Rainbow], + basic_zones: [], + advanced_type: None, + power_zones: [Keyboard, Lightbar], + ), ( board_name: "G634J", layout_name: "g634j-per-key", diff --git a/rog-control-center/src/main.rs b/rog-control-center/src/main.rs index 447f3edd..fbea5fb7 100644 --- a/rog-control-center/src/main.rs +++ b/rog-control-center/src/main.rs @@ -22,6 +22,8 @@ use rog_control_center::{ get_ipc_file, on_tmp_dir_exists, print_versions, RogApp, RogDbusClientBlocking, SHOWING_GUI, SHOW_GUI, }; +#[cfg(not(feature = "mocking"))] +use supergfxctl::zbus_proxy::DaemonProxyBlocking as GfxProxyBlocking; use tokio::runtime::Runtime; #[cfg(not(feature = "mocking"))] @@ -197,6 +199,16 @@ fn main() -> Result<()> { init_tray(supported_properties, states.clone()); } + if let Ok(mut states) = states.lock() { + // For some reason the gui is causing a broke pipe error on dbus send, so + // replace it. + let (asus_dbus, conn) = + rog_dbus::RogDbusClientBlocking::new().expect("Couldn't connect to asusd"); + states.asus_dbus = asus_dbus; + let gfx_dbus = GfxProxyBlocking::new(&conn).expect("Couldn't connect to supergfxd"); + states.gfx_dbus = gfx_dbus; + } + let mut bg_check_spawned = false; loop { if !running_in_bg.load(Ordering::Relaxed) { diff --git a/rog-control-center/src/widgets/aura_modes.rs b/rog-control-center/src/widgets/aura_modes.rs index fe018bd7..380da31b 100644 --- a/rog-control-center/src/widgets/aura_modes.rs +++ b/rog-control-center/src/widgets/aura_modes.rs @@ -230,6 +230,7 @@ pub fn aura_modes_group(states: &mut SystemState, freq: &mut Arc, ui: .aura() .set_led_mode_data(states.aura.modes.get(&selected).unwrap().clone()) .map_err(|err| { + dbg!(&err); states.error = Some(err.to_string()); }) .ok(); diff --git a/rog-control-center/src/widgets/aura_power.rs b/rog-control-center/src/widgets/aura_power.rs index a2374041..195ed553 100644 --- a/rog-control-center/src/widgets/aura_power.rs +++ b/rog-control-center/src/widgets/aura_power.rs @@ -133,6 +133,7 @@ fn aura_power1(states: &mut SystemState, ui: &mut Ui) { .aura() .set_led_power((options, enable)) .map_err(|err| { + dbg!(&err); states.error = Some(err.to_string()); }) .ok(); @@ -183,6 +184,7 @@ fn aura_power1(states: &mut SystemState, ui: &mut Ui) { .aura() .set_led_power((options, enable)) .map_err(|err| { + dbg!(&err); states.error = Some(err.to_string()); }) .ok(); @@ -248,6 +250,7 @@ fn aura_power2(states: &mut SystemState, ui: &mut Ui) { .aura() .set_led_power((options, enable)) .map_err(|err| { + dbg!(&err); states.error = Some(err.to_string()); }) .ok();