From bc92fa11f9a7c5bfa336095c9329b601a882b4dc Mon Sep 17 00:00:00 2001 From: "Luke D. Jones" Date: Mon, 6 May 2024 09:45:35 +1200 Subject: [PATCH] Update all cargo.toml. Support G713P --- CHANGELOG.md | 8 ++++++++ Cargo.toml | 13 +++++++++++-- asusctl/Cargo.toml | 11 +++++++---- asusctl/src/aura_cli.rs | 1 + asusd-user/Cargo.toml | 12 +++++++----- asusd/Cargo.toml | 14 +++++++------- asusd/src/config.rs | 7 +++++++ asusd/src/ctrl_aura/config.rs | 1 + config-traits/Cargo.toml | 11 +++++++---- cpuctl/Cargo.toml | 8 ++++++-- dmi-id/Cargo.toml | 9 +++++++-- rog-anime/Cargo.toml | 14 +++++++------- rog-aura/data/aura_support.ron | 9 +++++++++ rog-control-center/Cargo.toml | 9 ++++++--- rog-control-center/src/notify.rs | 4 ++-- .../translations/en/rog-control-center.po | 2 +- rog-dbus/Cargo.toml | 14 +++++++------- rog-platform/Cargo.toml | 10 +++++++--- rog-platform/src/usb_raw.rs | 2 +- rog-profiles/Cargo.toml | 11 +++++++---- rog-slash/Cargo.toml | 13 +++++++------ simulators/Cargo.toml | 14 ++++++-------- 22 files changed, 129 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ffa0ed0..be116564 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Support the G713P keyboard + +### Changed + +- Update all `Cargo.toml` + ## [v6.0.0] ### Important note diff --git a/Cargo.toml b/Cargo.toml index 08727910..a994e810 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,13 @@ resolver = "2" [workspace.package] version = "6.0.0" rust-version = "1.77" +license = "MPL-2.0" +readme = "README.md" +authors = ["Luke "] +repository = "https://gitlab.com/asus-linux/asusctl" +homepage = "https://gitlab.com/asus-linux/asusctl" +description = "Laptop feature control for ASUS ROG laptops and others" +edition = "2021" [workspace.dependencies] tokio = { version = "^1.36.0", default-features = false, features = [ @@ -77,11 +84,13 @@ lto = "fat" debug = false opt-level = 3 panic = "abort" -codegen-units = 1 +#codegen-units = 1 [profile.dev] opt-level = 1 -codegen-units = 16 + +[profile.dev.package."*"] +opt-level = 1 [profile.bench] debug = false diff --git a/asusctl/Cargo.toml b/asusctl/Cargo.toml index d905f92f..24601f20 100644 --- a/asusctl/Cargo.toml +++ b/asusctl/Cargo.toml @@ -1,9 +1,12 @@ [package] name = "asusctl" -license = "MPL-2.0" -authors = ["Luke D Jones "] -edition = "2021" +license.workspace = true version.workspace = true +readme.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +edition.workspace = true [dependencies] rog_anime = { path = "../rog-anime" } @@ -27,4 +30,4 @@ glam.workspace = true rog_dbus = { path = "../rog-dbus" } tokio.workspace = true -cargo-husky.workspace = true \ No newline at end of file +cargo-husky.workspace = true diff --git a/asusctl/src/aura_cli.rs b/asusctl/src/aura_cli.rs index 9ca64202..29f3d2f1 100644 --- a/asusctl/src/aura_cli.rs +++ b/asusctl/src/aura_cli.rs @@ -87,6 +87,7 @@ impl FromStr for LedBrightness { } } } +#[allow(clippy::to_string_trait_impl)] impl ToString for LedBrightness { fn to_string(&self) -> String { let s = match self.level { diff --git a/asusd-user/Cargo.toml b/asusd-user/Cargo.toml index 84c69255..c760a441 100644 --- a/asusd-user/Cargo.toml +++ b/asusd-user/Cargo.toml @@ -1,10 +1,12 @@ [package] name = "asusd-user" -license = "MPL-2.0" +license.workspace = true version.workspace = true -authors = ["Luke D Jones "] -edition = "2021" -description = "Usermode daemon for user settings, anime, per-key lighting" +readme.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +edition.workspace = true [[bin]] name = "asusd-user" @@ -32,4 +34,4 @@ log.workspace = true env_logger.workspace = true [dev-dependencies] -cargo-husky.workspace = true \ No newline at end of file +cargo-husky.workspace = true diff --git a/asusd/Cargo.toml b/asusd/Cargo.toml index 3257afc3..1c0d25ae 100644 --- a/asusd/Cargo.toml +++ b/asusd/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "asusd" -license = "MPL-2.0" +license.workspace = true version.workspace = true -readme = "README.md" -authors = ["Luke "] -repository = "https://gitlab.com/asus-linux/asus-nb-ctrl" -homepage = "https://gitlab.com/asus-linux/asus-nb-ctrl" -description = "A daemon app for ASUS GX502 and similar laptops to control missing features" -edition = "2021" +readme.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +description.workspace = true +edition.workspace = true [[bin]] name = "asusd" diff --git a/asusd/src/config.rs b/asusd/src/config.rs index b42aa83c..d5d98748 100644 --- a/asusd/src/config.rs +++ b/asusd/src/config.rs @@ -31,18 +31,25 @@ pub struct Config { /// The energy_performance_preference for this throttle/platform profile pub throttle_performance_epp: CPUEPP, /// Defaults to `None` if not supported + #[serde(skip_serializing_if = "Option::is_none", default)] pub ppt_pl1_spl: Option, /// Defaults to `None` if not supported + #[serde(skip_serializing_if = "Option::is_none", default)] pub ppt_pl2_sppt: Option, /// Defaults to `None` if not supported + #[serde(skip_serializing_if = "Option::is_none", default)] pub ppt_fppt: Option, /// Defaults to `None` if not supported + #[serde(skip_serializing_if = "Option::is_none", default)] pub ppt_apu_sppt: Option, /// Defaults to `None` if not supported + #[serde(skip_serializing_if = "Option::is_none", default)] pub ppt_platform_sppt: Option, /// Defaults to `None` if not supported + #[serde(skip_serializing_if = "Option::is_none", default)] pub nv_dynamic_boost: Option, /// Defaults to `None` if not supported + #[serde(skip_serializing_if = "Option::is_none", default)] pub nv_temp_target: Option, /// Temporary state for AC/Batt #[serde(skip)] diff --git a/asusd/src/ctrl_aura/config.rs b/asusd/src/ctrl_aura/config.rs index 4de61425..de05efdc 100644 --- a/asusd/src/ctrl_aura/config.rs +++ b/asusd/src/ctrl_aura/config.rs @@ -16,6 +16,7 @@ pub struct AuraConfig { pub brightness: LedBrightness, pub current_mode: AuraModeNum, pub builtins: BTreeMap, + #[serde(skip_serializing_if = "Option::is_none", default)] pub multizone: Option>>, pub multizone_on: bool, pub enabled: LaptopAuraPower, diff --git a/config-traits/Cargo.toml b/config-traits/Cargo.toml index 74a504d2..39285464 100644 --- a/config-traits/Cargo.toml +++ b/config-traits/Cargo.toml @@ -1,9 +1,12 @@ [package] name = "config-traits" -license = "MPL-2.0" -authors = ["Luke D Jones "] -edition = "2021" +license.workspace = true version.workspace = true +readme.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +edition.workspace = true [dependencies] serde.workspace = true @@ -15,4 +18,4 @@ ron.workspace = true log.workspace = true [dev-dependencies] -cargo-husky.workspace = true \ No newline at end of file +cargo-husky.workspace = true diff --git a/cpuctl/Cargo.toml b/cpuctl/Cargo.toml index efb33458..2d00fb79 100644 --- a/cpuctl/Cargo.toml +++ b/cpuctl/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "cpuctl" -license = "MPL-2.0" -edition = "2021" +license.workspace = true version.workspace = true +readme.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +edition.workspace = true [dependencies] diff --git a/dmi-id/Cargo.toml b/dmi-id/Cargo.toml index bdeaff79..9da16746 100644 --- a/dmi-id/Cargo.toml +++ b/dmi-id/Cargo.toml @@ -1,8 +1,13 @@ [package] name = "dmi_id" -edition = "2021" +license.workspace = true version.workspace = true +readme.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +edition.workspace = true [dependencies] log.workspace = true -udev.workspace = true \ No newline at end of file +udev.workspace = true diff --git a/rog-anime/Cargo.toml b/rog-anime/Cargo.toml index 36de2783..150bc356 100644 --- a/rog-anime/Cargo.toml +++ b/rog-anime/Cargo.toml @@ -1,15 +1,15 @@ [package] name = "rog_anime" -license = "MPL-2.0" +license.workspace = true version.workspace = true -readme = "README.md" -authors = ["Luke "] -repository = "https://gitlab.com/asus-linux/asus-nb-ctrl" -homepage = "https://gitlab.com/asus-linux/asus-nb-ctrl" +readme.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +edition.workspace = true documentation = "https://docs.rs/rog-anime" description = "Types useful for translating images and other data for display on the ASUS AniMe Matrix display" keywords = ["ROG", "ASUS", "AniMe"] -edition = "2021" exclude = ["data"] [features] @@ -38,4 +38,4 @@ zbus = { workspace = true, optional = true } dmi_id = { path = "../dmi-id", optional = true } [dev-dependencies] -cargo-husky.workspace = true \ No newline at end of file +cargo-husky.workspace = true diff --git a/rog-aura/data/aura_support.ron b/rog-aura/data/aura_support.ron index 45a413f1..3e16be64 100644 --- a/rog-aura/data/aura_support.ron +++ b/rog-aura/data/aura_support.ron @@ -323,6 +323,15 @@ advanced_type: PerKey, power_zones: [Keyboard], ), + ( + device_name: "G713P", + product_id: "", + layout_name: "ga401q", + basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse], + basic_zones: [Key1, Key2, Key3, Key4], + advanced_type: None, + power_zones: [Keyboard], + ), ( device_name: "G713QM", product_id: "", diff --git a/rog-control-center/Cargo.toml b/rog-control-center/Cargo.toml index 761aaf6f..57cad2ae 100644 --- a/rog-control-center/Cargo.toml +++ b/rog-control-center/Cargo.toml @@ -1,9 +1,12 @@ [package] name = "rog-control-center" -license = "MPL-2.0" +license.workspace = true version.workspace = true -authors = ["Luke D. Jones "] -edition = "2021" +readme.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +edition.workspace = true [features] #default = ["mocking"] diff --git a/rog-control-center/src/notify.rs b/rog-control-center/src/notify.rs index 0b3a8210..73ad584c 100644 --- a/rog-control-center/src/notify.rs +++ b/rog-control-center/src/notify.rs @@ -61,8 +61,8 @@ pub fn start_notifications(config: Arc>) -> Result<()> { let mut ac = String::new(); let mut bat = String::new(); if let Ok(config) = config_copy.lock() { - ac = config.ac_command.clone(); - bat = config.bat_command.clone(); + ac.clone_from(&config.ac_command); + bat.clone_from(&config.bat_command); } if p == 0 && p != last_state { diff --git a/rog-control-center/translations/en/rog-control-center.po b/rog-control-center/translations/en/rog-control-center.po index 1be84269..9833258d 100644 --- a/rog-control-center/translations/en/rog-control-center.po +++ b/rog-control-center/translations/en/rog-control-center.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2024-05-05 08:22+0000\n" +"POT-Creation-Date: 2024-05-05 21:32+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/rog-dbus/Cargo.toml b/rog-dbus/Cargo.toml index d6f74c7f..aa56525b 100644 --- a/rog-dbus/Cargo.toml +++ b/rog-dbus/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "rog_dbus" +license.workspace = true version.workspace = true -license = "MPL-2.0" -readme = "README.md" -authors = ["Luke "] -repository = "https://gitlab.com/asus-linux/asus-nb-ctrl" -homepage = "https://gitlab.com/asus-linux/asus-nb-ctrl" +readme.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +edition.workspace = true description = "dbus interface methods for asusctl" -edition = "2021" [dependencies] asusd = { path = "../asusd" } @@ -19,4 +19,4 @@ rog_platform = { path = "../rog-platform" } zbus.workspace = true [dev-dependencies] -cargo-husky.workspace = true \ No newline at end of file +cargo-husky.workspace = true diff --git a/rog-platform/Cargo.toml b/rog-platform/Cargo.toml index b4fce100..b332e717 100644 --- a/rog-platform/Cargo.toml +++ b/rog-platform/Cargo.toml @@ -1,8 +1,12 @@ [package] name = "rog_platform" -license = "MPL-2.0" +license.workspace = true version.workspace = true -edition = "2021" +readme.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +edition.workspace = true [dependencies] log.workspace = true @@ -18,4 +22,4 @@ rusb.workspace = true [dev-dependencies] cargo-husky.workspace = true -rog_aura = { path = "../rog-aura" } \ No newline at end of file +rog_aura = { path = "../rog-aura" } diff --git a/rog-platform/src/usb_raw.rs b/rog-platform/src/usb_raw.rs index 9670959d..33e2ae29 100644 --- a/rog-platform/src/usb_raw.rs +++ b/rog-platform/src/usb_raw.rs @@ -27,7 +27,7 @@ impl USBRaw { device: &Device, ) -> Result> { // We don't expect this ID to ever change - let mut device = device.open()?; + let device = device.open()?; device.reset()?; device.set_auto_detach_kernel_driver(true)?; device.claim_interface(0)?; diff --git a/rog-profiles/Cargo.toml b/rog-profiles/Cargo.toml index b53b14ed..7fb5d492 100644 --- a/rog-profiles/Cargo.toml +++ b/rog-profiles/Cargo.toml @@ -1,9 +1,12 @@ [package] name = "rog_profiles" -license = "MPL-2.0" +license.workspace = true version.workspace = true -authors = ["Luke D. Jones "] -edition = "2021" +readme.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +edition.workspace = true [features] default = ["dbus"] @@ -20,4 +23,4 @@ rog_platform = { path = "../rog-platform" } zbus = { workspace = true, optional = true } [dev-dependencies] -cargo-husky.workspace = true \ No newline at end of file +cargo-husky.workspace = true diff --git a/rog-slash/Cargo.toml b/rog-slash/Cargo.toml index 4c2a21b8..5a67a44b 100644 --- a/rog-slash/Cargo.toml +++ b/rog-slash/Cargo.toml @@ -1,14 +1,15 @@ [package] name = "rog_slash" -license = "MPL-2.0" +license.workspace = true version.workspace = true -authors = ["Luke "] -repository = "https://gitlab.com/asus-linux/asus-nb-ctrl" -homepage = "https://gitlab.com/asus-linux/asus-nb-ctrl" +readme.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +edition.workspace = true documentation = "https://docs.rs/rog-slash" description = "ASUS Slash display" keywords = ["ROG", "ASUS", "AniMe", "Slash"] -edition = "2021" exclude = ["data"] [features] @@ -37,4 +38,4 @@ zbus = { workspace = true, optional = true } dmi_id = { path = "../dmi-id", optional = true } [dev-dependencies] -cargo-husky.workspace = true \ No newline at end of file +cargo-husky.workspace = true diff --git a/simulators/Cargo.toml b/simulators/Cargo.toml index 8d651e03..982d3c51 100644 --- a/simulators/Cargo.toml +++ b/simulators/Cargo.toml @@ -1,14 +1,12 @@ [package] name = "rog_simulators" -license = "MPL-2.0" +license.workspace = true version.workspace = true -readme = "README.md" -authors = ["Luke "] -repository = "https://gitlab.com/asus-linux/asus-nb-ctrl" -homepage = "https://gitlab.com/asus-linux/asus-nb-ctrl" -documentation = "https://docs.rs/rog-anime" -edition = "2021" -exclude = ["data"] +readme.workspace = true +authors.workspace = true +repository.workspace = true +homepage.workspace = true +edition.workspace = true [[bin]] name = "anime_sim"