From fb92d65fa03e2a3736c6f72c1416420d8d6f9035 Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Wed, 17 Aug 2022 10:32:24 +1200 Subject: [PATCH] Prep for new release --- CHANGELOG.md | 2 +- Cargo.lock | 10 +++--- README.md | 2 ++ daemon/Cargo.toml | 2 +- daemon/src/lib.rs | 2 +- rog-anime/src/lib.rs | 2 +- rog-aura/Cargo.toml | 2 +- rog-aura/src/lib.rs | 2 +- rog-control-center/Cargo.toml | 4 ++- rog-control-center/src/lib.rs | 14 ++++++++ rog-control-center/src/main.rs | 6 ++-- rog-control-center/src/pages/system_page.rs | 19 +++++++++-- rog-control-center/src/widgets/mod.rs | 2 ++ rog-control-center/src/widgets/top_bar.rs | 38 ++------------------- rog-dbus/Cargo.toml | 2 +- rog-dbus/src/lib.rs | 3 +- rog-platform/src/lib.rs | 2 +- rog-profiles/src/lib.rs | 6 ++-- 18 files changed, 64 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1af03a8..c37e83ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased ] -### Changed +### Changed (v4.4.0) - Create new rog-platform crate to manage all i/o in a universal way + kbd-led handling (requires kernel patches, TUF specific) + platform handling (asus-nb-wmi) diff --git a/Cargo.lock b/Cargo.lock index 4b210b36..6c65c5ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -542,7 +542,7 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "daemon" -version = "4.3.4" +version = "4.4.0-rc1" dependencies = [ "async-trait", "env_logger", @@ -1952,13 +1952,15 @@ dependencies = [ [[package]] name = "rog-control-center" -version = "1.0.1" +version = "1.1.0-rc1" dependencies = [ + "daemon", "dirs 3.0.2", "eframe", "egui", "nix 0.20.2", "notify-rust", + "rog_anime", "rog_aura", "rog_dbus", "rog_platform", @@ -1990,7 +1992,7 @@ dependencies = [ [[package]] name = "rog_aura" -version = "1.2.2" +version = "1.3.0" dependencies = [ "serde", "serde_derive", @@ -2000,7 +2002,7 @@ dependencies = [ [[package]] name = "rog_dbus" -version = "4.2.1" +version = "4.4.0" dependencies = [ "rog_anime", "rog_aura", diff --git a/README.md b/README.md index f8a930ed..0ae57c90 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/donate/?hosted_button_id=4V2DEPS7K6APC) - [Asus Linux Website](https://asus-linux.org/) +**WARNING:** Do not run the main branch of this repo unless you have all the asus-wmi kernel patches. You should use stable kernels + tagged releases. + `asusd` is a utility for Linux to control many aspects of various ASUS laptops but can also be used with non-asus laptops with reduced features. diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index 04cbfc60..0a1c96bc 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "daemon" -version = "4.3.4" +version = "4.4.0-rc1" license = "MPL-2.0" readme = "README.md" authors = ["Luke "] diff --git a/daemon/src/lib.rs b/daemon/src/lib.rs index 546c6533..7d52a021 100644 --- a/daemon/src/lib.rs +++ b/daemon/src/lib.rs @@ -39,7 +39,7 @@ use smol::{stream::StreamExt, Executor, Timer}; use zbus::Connection; use zvariant::ObjectPath; -pub static VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); pub trait Reloadable { fn reload(&mut self) -> Result<(), RogError>; diff --git a/rog-anime/src/lib.rs b/rog-anime/src/lib.rs index a38c9b21..8fcc034c 100644 --- a/rog-anime/src/lib.rs +++ b/rog-anime/src/lib.rs @@ -32,4 +32,4 @@ pub mod error; /// Provides const methods to create the USB HID control packets pub mod usb; -pub static VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); diff --git a/rog-aura/Cargo.toml b/rog-aura/Cargo.toml index fa78ad84..a9bf8c77 100644 --- a/rog-aura/Cargo.toml +++ b/rog-aura/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rog_aura" -version = "1.2.2" +version = "1.3.0" license = "MPL-2.0" readme = "README.md" authors = ["Luke "] diff --git a/rog-aura/src/lib.rs b/rog-aura/src/lib.rs index 3e0de5dd..de01735e 100644 --- a/rog-aura/src/lib.rs +++ b/rog-aura/src/lib.rs @@ -16,7 +16,7 @@ pub mod layouts; pub mod usb; pub const LED_MSG_LEN: usize = 17; -pub static VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); pub const RED: Colour = Colour(0xff, 0x00, 0x00); pub const GREEN: Colour = Colour(0x00, 0xff, 0x00); diff --git a/rog-control-center/Cargo.toml b/rog-control-center/Cargo.toml index 29c9e479..62e5c1c7 100644 --- a/rog-control-center/Cargo.toml +++ b/rog-control-center/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rog-control-center" -version = "1.0.1" +version = "1.1.0-rc1" authors = ["Luke D. Jones "] edition = "2021" @@ -12,6 +12,8 @@ egui = { git = "https://github.com/emilk/egui" } eframe= { git = "https://github.com/emilk/egui" } #eframe= { git = "https://github.com/emilk/egui", default-features = false, features = ["dark-light", "default_fonts", "wgpu"] } +daemon = { path = "../daemon" } +rog_anime = { path = "../rog-anime" } rog_dbus = { path = "../rog-dbus" } rog_aura = { path = "../rog-aura" } rog_profiles = { path = "../rog-profiles" } diff --git a/rog-control-center/src/lib.rs b/rog-control-center/src/lib.rs index dc57453a..b1208fbf 100644 --- a/rog-control-center/src/lib.rs +++ b/rog-control-center/src/lib.rs @@ -28,6 +28,20 @@ use nix::{sys::stat, unistd}; use tempfile::TempDir; //use log::{error, info, warn}; +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); + +pub fn print_versions() { + println!("App and daemon versions:"); + println!(" rog-gui v{}", VERSION); + println!(" asusd v{}", daemon::VERSION); + println!("\nComponent crate versions:"); + println!(" rog-anime v{}", rog_anime::VERSION); + println!(" rog-aura v{}", rog_aura::VERSION); + println!(" rog-dbus v{}", rog_dbus::VERSION); + println!(" rog-profiles v{}", rog_profiles::VERSION); + println!("rog-platform v{}", rog_platform::VERSION); +} + pub const SHOWING_GUI: u8 = 1; pub const SHOW_GUI: u8 = 2; diff --git a/rog-control-center/src/main.rs b/rog-control-center/src/main.rs index 7f5028ad..ddca1909 100644 --- a/rog-control-center/src/main.rs +++ b/rog-control-center/src/main.rs @@ -1,8 +1,8 @@ use rog_aura::layouts::KeyLayout; use rog_control_center::{ config::Config, get_ipc_file, notify::start_notifications, on_tmp_dir_exists, - page_states::PageDataStates, startup_error::AppErrorShow, RogApp, RogDbusClientBlocking, - SHOWING_GUI, SHOW_GUI, + page_states::PageDataStates, print_versions, startup_error::AppErrorShow, RogApp, + RogDbusClientBlocking, SHOWING_GUI, SHOW_GUI, }; use std::{ @@ -19,6 +19,8 @@ const DATA_DIR: &str = env!("CARGO_MANIFEST_DIR"); const BOARD_NAME: &str = "/sys/class/dmi/id/board_name"; fn main() -> Result<(), Box> { + print_versions(); + let native_options = eframe::NativeOptions { decorated: false, transparent: false, diff --git a/rog-control-center/src/pages/system_page.rs b/rog-control-center/src/pages/system_page.rs index 4f7f4893..d4be1c88 100644 --- a/rog-control-center/src/pages/system_page.rs +++ b/rog-control-center/src/pages/system_page.rs @@ -1,11 +1,14 @@ use crate::{ - widgets::{anime_power_group, aura_power_group, platform_profile, rog_bios_group}, + widgets::{ + anime_power_group, app_settings, aura_power_group, platform_profile, rog_bios_group, + }, RogApp, }; impl<'a> RogApp<'a> { pub fn system_page(&mut self, ctx: &egui::Context) { let Self { + config, supported, states, asus_dbus: dbus, @@ -21,30 +24,42 @@ impl<'a> RogApp<'a> { egui::Grid::new("grid_of_bits") .min_col_width(rect.width() / 2.0) .show(ui, |ui| { + /******************************************************/ + ui.vertical(|ui| { + ui.separator(); + app_settings(config, states, ui); + }); + ui.vertical(|ui| { ui.separator(); if supported.platform_profile.platform_profile { platform_profile(states, dbus, ui); } }); + ui.end_row(); + /******************************************************/ ui.vertical(|ui| { ui.separator(); aura_power_group(supported, states, dbus, ui); }); - ui.end_row(); ui.vertical(|ui| { ui.separator(); rog_bios_group(supported, states, dbus, ui); }); + ui.end_row(); + /******************************************************/ ui.vertical(|ui| { ui.separator(); if supported.anime_ctrl.0 { anime_power_group(supported, states, dbus, ui); } }); + ui.vertical(|ui| { + ui.separator(); + }); ui.end_row(); }); }); diff --git a/rog-control-center/src/widgets/mod.rs b/rog-control-center/src/widgets/mod.rs index 9bdcaabb..c380131f 100644 --- a/rog-control-center/src/widgets/mod.rs +++ b/rog-control-center/src/widgets/mod.rs @@ -1,4 +1,5 @@ mod anime_power; +mod app_settings; mod aura_modes; mod aura_power; mod fan_graph; @@ -8,6 +9,7 @@ mod side_panel; mod top_bar; pub use anime_power::*; +pub use app_settings::*; pub use aura_modes::*; pub use aura_power::*; pub use fan_graph::*; diff --git a/rog-control-center/src/widgets/top_bar.rs b/rog-control-center/src/widgets/top_bar.rs index 132a1387..f020d902 100644 --- a/rog-control-center/src/widgets/top_bar.rs +++ b/rog-control-center/src/widgets/top_bar.rs @@ -1,46 +1,14 @@ -use std::sync::atomic::Ordering; - use egui::{vec2, Align2, Button, FontId, Id, Rect, RichText, Sense, Vec2}; -use crate::RogApp; +use crate::{RogApp, VERSION}; impl<'a> RogApp<'a> { pub fn top_bar(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) { - let Self { states, config, .. } = self; - egui::TopBottomPanel::top("top_panel").show(ctx, |ui| { // The top panel is often a good place for a menu bar: egui::menu::bar(ui, |ui| { - ui.menu_button("File", |ui| { - if ui.button("Quit").clicked() { - frame.quit(); - } - }); - ui.menu_button("Settings", |ui| { - if ui - .checkbox(&mut config.run_in_background, "Run in Background") - .clicked() - || ui - .checkbox(&mut config.startup_in_background, "Startup Hidden") - .clicked() - || ui - .checkbox(&mut config.enable_notifications, "Enable Notifications") - .clicked() - { - states - .notifs_enabled - .store(config.enable_notifications, Ordering::SeqCst); - config - .save() - .map_err(|err| { - states.error = Some(err.to_string()); - }) - .ok(); - } - }); - ui.horizontal(|ui| { - egui::global_dark_light_mode_switch(ui); + egui::global_dark_light_mode_buttons(ui); egui::warn_if_debug_build(ui); }); @@ -61,7 +29,7 @@ impl<'a> RogApp<'a> { ui.painter().text( titlebar_rect.center_top() + vec2(0.0, height / 2.0), Align2::CENTER_CENTER, - "ROG Control Center", + format!("ROG Control Center v{}", VERSION), FontId::proportional(height - 2.0), text_color, ); diff --git a/rog-dbus/Cargo.toml b/rog-dbus/Cargo.toml index 40bddcd1..78c4981b 100644 --- a/rog-dbus/Cargo.toml +++ b/rog-dbus/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rog_dbus" -version = "4.2.1" +version = "4.4.0" license = "MPL-2.0" readme = "README.md" authors = ["Luke "] diff --git a/rog-dbus/src/lib.rs b/rog-dbus/src/lib.rs index de4abe7a..b44eb28b 100644 --- a/rog-dbus/src/lib.rs +++ b/rog-dbus/src/lib.rs @@ -15,7 +15,8 @@ pub mod zbus_supported; // use std::sync::mpsc::{channel, Receiver}; use zbus::{blocking, Connection, Result}; -pub static VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); + pub struct DbusProxiesBlocking<'a> { anime: zbus_anime::AnimeProxyBlocking<'a>, charge: zbus_charge::ChargeProxyBlocking<'a>, diff --git a/rog-platform/src/lib.rs b/rog-platform/src/lib.rs index db9014a6..1bc6a642 100644 --- a/rog-platform/src/lib.rs +++ b/rog-platform/src/lib.rs @@ -13,7 +13,7 @@ use std::path::Path; use error::{PlatformError, Result}; use udev::Device; -pub static VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); #[macro_export] macro_rules! attr_bool { diff --git a/rog-profiles/src/lib.rs b/rog-profiles/src/lib.rs index 8080afd7..b3b462d4 100644 --- a/rog-profiles/src/lib.rs +++ b/rog-profiles/src/lib.rs @@ -15,10 +15,10 @@ use udev::Device; #[cfg(feature = "dbus")] use zvariant_derive::Type; -pub static PLATFORM_PROFILE: &str = "/sys/firmware/acpi/platform_profile"; -pub static PLATFORM_PROFILES: &str = "/sys/firmware/acpi/platform_profile_choices"; +pub const PLATFORM_PROFILE: &str = "/sys/firmware/acpi/platform_profile"; +pub const PLATFORM_PROFILES: &str = "/sys/firmware/acpi/platform_profile_choices"; -pub static VERSION: &str = env!("CARGO_PKG_VERSION"); +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); pub fn find_fan_curve_node() -> Result, ProfileError> { let mut enumerator = udev::Enumerator::new()?;