Compare commits

...

20 Commits

Author SHA1 Message Date
Luke D. Jones 6f4a7e16dc Fixes to RCC 2024-01-05 14:21:31 +13:00
Luke D. Jones f64253d633 Various bugfixes 2024-01-05 13:53:57 +13:00
Luke D. Jones 124c17aadc Add default issue template 2024-01-04 14:30:11 +13:00
Luke D. Jones ab40f9fcbf Add FX705D led support 2024-01-04 09:23:37 +13:00
Luke D. Jones 5cdfa5a8d4 Fix to suspend process in anime thread to let custom anims run on wake 2023-12-27 11:24:39 +13:00
Luke D. Jones ce870cd5ed Revert egui update due to a lot of issues arising from window closing 2023-12-27 10:13:26 +13:00
Luke D. Jones 4541d2e1ba Update dbus introspection 2023-12-26 11:56:47 +13:00
Luke D. Jones b525411fd3 Minor fixes in asusctl 2023-12-25 21:24:05 +13:00
Luke D. Jones a867496f13 Re-enable ROGCC fan curves 2023-12-24 10:30:33 +13:00
Luke D. Jones f421b8ee3b Fix to apply led effect in rogcc 2023-12-23 21:45:19 +13:00
Luke D. Jones 82780feb4b Update readme 2023-12-23 10:37:46 +13:00
Luke D. Jones 1e5443e206 Bugfix release 2023-12-22 11:39:17 +13:00
Luke D. Jones 027a591d26 Add cargo-vendor-filterer to pipeline 2023-12-17 21:44:33 +13:00
Luke D. Jones e90375828d Fix: nuke some async deadlocks in fan-curves 2023-12-17 21:41:07 +13:00
Luke D. Jones 75b4d67072 Fix: force Anime power/wakeup disabled to prevent idiotic random wakes 2023-12-15 19:15:14 +13:00
Luke D. Jones 9aa332de3b New release 2023-12-15 11:50:49 +13:00
Luke D. Jones 5efd7fc6a7 Fix: Corrections to dbus signature for some keyboard power settings
Closes #423
2023-12-15 11:48:20 +13:00
Luke D. Jones 0aafe24a02 Fix: correctiosn to asusd.service
Closes #424
2023-12-15 11:48:20 +13:00
Luke D. Jones dda6d343d9 Fix: correction to switching next fan profile
Closes #425
2023-12-15 11:48:18 +13:00
Luke D. Jones 6f39307080 remember how to tag releases 2023-12-12 22:00:37 +13:00
44 changed files with 613 additions and 411 deletions
+1
View File
@@ -59,6 +59,7 @@ release:
- tags
<<: *rust_cache
script:
- cargo install cargo-vendor-filterer
- make && make vendor
artifacts:
paths:
+24
View File
@@ -0,0 +1,24 @@
## Issue description
(Summarize the bug encountered)
## Steps to reproduce
(How can the issue be reproduced)
## What is the current bug behavior?
(What actually happens)
## What is the expected correct behavior?
(What you should see instead)
## Relevant logs and/or screenshots
(run `journalctl -b -u supergfxd > ~/supergfxd.log` and attach `~/supergfxd.log`)
(Paste any relevant logs - use code blocks (```) to format console output, logs, and code, as
it's very hard to read otherwise.)
/label ~bug ~reproducable ~needs-investigation
+40
View File
@@ -6,6 +6,46 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [v5.0.7]
### Changed
- Fix to suspend process in anime thread to let custom anims run on wake.
- Fix to reload the fan curves correctly on boot.
- Add new config option `platform_policy_linked_epp` to set if energy_performance_preference should be paired with platform_profile/throttle_thermal_policy
- Small fixes to rog-control-center
## [v5.0.6]
- Revert egui update due to a lot of issues arising from window closing.
## [v5.0.5]
- Resync. A release was made that was missing some commits.
## [v5.0.4]
### Changed
- Added G834JZ led config
- Fix in ROGCC to apply the actual effect changed
- Re-enable all fan curves (available) in ROGCC
- Update smithay-client-toolkit
## [v5.0.3]
### Changed
- Fix and error in platform ppt value gets
- Fix to asusctl CLI where an incorrect enum variant was used in throttle check
- Turn some error messages in to warning or info to prevent confusion
- Re-add the keyboard power settings in rogcc
- Add two new aura dbus properties for providing some basic info on aura modes/power
## [v5.0.2]
### Changed
- Fan-curves: nuke a few async deadlocks
- Anime: force power/wakeup disabled to prevent idiotic random wakes
## [v5.0.1]
### Changed
- Fix setting next fan profile
- Fix the assud.service
- Fix dbus signature of some power setting types for some keyboards
## [v5.0.0]
### Added
- Gnome 45 plugin
- Support for G513RW LED modes
Generated
+92 -100
View File
@@ -164,9 +164,9 @@ dependencies = [
[[package]]
name = "anyhow"
version = "1.0.75"
version = "1.0.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
checksum = "59d2a3357dde987206219e78ecfbbb6e8dad06cbb65292758d3270e6254f7355"
[[package]]
name = "arboard"
@@ -199,7 +199,7 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
[[package]]
name = "asusctl"
version = "5.0.0"
version = "5.0.7"
dependencies = [
"asusd",
"cargo-husky",
@@ -218,7 +218,7 @@ dependencies = [
[[package]]
name = "asusd"
version = "5.0.0"
version = "5.0.7"
dependencies = [
"async-trait",
"cargo-husky",
@@ -237,12 +237,13 @@ dependencies = [
"serde_derive",
"systemd-zbus",
"tokio",
"udev",
"zbus",
]
[[package]]
name = "asusd-user"
version = "5.0.0"
version = "5.0.7"
dependencies = [
"cargo-husky",
"config-traits",
@@ -288,7 +289,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c"
dependencies = [
"concurrent-queue",
"event-listener 4.0.0",
"event-listener 4.0.1",
"event-listener-strategy",
"futures-core",
"pin-project-lite",
@@ -374,7 +375,7 @@ version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c"
dependencies = [
"event-listener 4.0.0",
"event-listener 4.0.1",
"event-listener-strategy",
"pin-project-lite",
]
@@ -415,7 +416,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.40",
"syn 2.0.43",
]
[[package]]
@@ -438,19 +439,19 @@ dependencies = [
[[package]]
name = "async-task"
version = "4.5.0"
version = "4.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1"
checksum = "e1d90cd0b264dfdd8eb5bad0a2c217c1f88fa96a8573f40e7b12de23fb468f46"
[[package]]
name = "async-trait"
version = "0.1.74"
version = "0.1.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9"
checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.40",
"syn 2.0.43",
]
[[package]]
@@ -566,7 +567,7 @@ dependencies = [
"regex",
"rustc-hash",
"shlex",
"syn 2.0.40",
"syn 2.0.43",
]
[[package]]
@@ -657,7 +658,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.40",
"syn 2.0.43",
]
[[package]]
@@ -831,7 +832,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f76990911f2267d837d9d0ad060aa63aaad170af40904b29461734c339030d4d"
dependencies = [
"quote",
"syn 2.0.40",
"syn 2.0.43",
]
[[package]]
@@ -845,7 +846,7 @@ dependencies = [
[[package]]
name = "config-traits"
version = "5.0.0"
version = "5.0.7"
dependencies = [
"cargo-husky",
"log",
@@ -898,7 +899,7 @@ dependencies = [
[[package]]
name = "cpuctl"
version = "5.0.0"
version = "5.0.7"
[[package]]
name = "cpufeatures"
@@ -920,9 +921,9 @@ dependencies = [
[[package]]
name = "crossbeam-utils"
version = "0.8.16"
version = "0.8.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"
checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c"
dependencies = [
"cfg-if",
]
@@ -1020,12 +1021,12 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412"
dependencies = [
"libloading 0.8.1",
"libloading",
]
[[package]]
name = "dmi_id"
version = "5.0.0"
version = "5.0.7"
dependencies = [
"log",
"udev",
@@ -1164,7 +1165,7 @@ checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.40",
"syn 2.0.43",
]
[[package]]
@@ -1241,9 +1242,9 @@ dependencies = [
[[package]]
name = "event-listener"
version = "4.0.0"
version = "4.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae"
checksum = "84f2cdcf274580f2d63697192d744727b3198894b1bf02923643bf59e2c26712"
dependencies = [
"concurrent-queue",
"parking",
@@ -1256,7 +1257,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3"
dependencies = [
"event-listener 4.0.0",
"event-listener 4.0.1",
"pin-project-lite",
]
@@ -1277,9 +1278,9 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
[[package]]
name = "fdeflate"
version = "0.3.1"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868"
checksum = "7caf4086251adeba90011a7ff9bd1f6d7f7595be0871867daa4dbb0fcf2ca932"
dependencies = [
"simd-adler32",
]
@@ -1339,24 +1340,24 @@ dependencies = [
[[package]]
name = "futures-channel"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb"
checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
dependencies = [
"futures-core",
]
[[package]]
name = "futures-core"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c"
checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
[[package]]
name = "futures-executor"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc"
checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d"
dependencies = [
"futures-core",
"futures-task",
@@ -1365,9 +1366,9 @@ dependencies = [
[[package]]
name = "futures-io"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa"
checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
[[package]]
name = "futures-lite"
@@ -1399,32 +1400,32 @@ dependencies = [
[[package]]
name = "futures-macro"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb"
checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.40",
"syn 2.0.43",
]
[[package]]
name = "futures-sink"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817"
checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
[[package]]
name = "futures-task"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2"
checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
[[package]]
name = "futures-util"
version = "0.3.29"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104"
checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
dependencies = [
"futures-core",
"futures-io",
@@ -1675,7 +1676,7 @@ dependencies = [
"glutin_egl_sys",
"glutin_glx_sys",
"glutin_wgl_sys",
"libloading 0.7.4",
"libloading",
"objc2",
"once_cell",
"raw-window-handle",
@@ -1837,11 +1838,11 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "home"
version = "0.5.5"
version = "0.5.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb"
checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5"
dependencies = [
"windows-sys 0.48.0",
"windows-sys 0.52.0",
]
[[package]]
@@ -2042,7 +2043,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08fcb2bea89cee9613982501ec83eaa2d09256b24540ae463c52a28906163918"
dependencies = [
"gtk-sys",
"libloading 0.7.4",
"libloading",
"once_cell",
]
@@ -2062,16 +2063,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "libloading"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161"
dependencies = [
"cfg-if",
"windows-sys 0.48.0",
]
[[package]]
name = "libredox"
version = "0.0.1"
@@ -2414,7 +2405,7 @@ dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
"syn 2.0.40",
"syn 2.0.43",
]
[[package]]
@@ -2474,9 +2465,9 @@ dependencies = [
[[package]]
name = "object"
version = "0.32.1"
version = "0.32.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0"
checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
dependencies = [
"memchr",
]
@@ -2619,9 +2610,9 @@ checksum = "5de5067af0cd27add969cdb4ef2eecc955f59235f3b7a75a3c6ac9562cfb6b81"
[[package]]
name = "pkg-config"
version = "0.3.27"
version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a"
[[package]]
name = "png"
@@ -2724,9 +2715,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.70"
version = "1.0.71"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8"
dependencies = [
"unicode-ident",
]
@@ -2845,7 +2836,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
[[package]]
name = "rog-control-center"
version = "5.0.0"
version = "5.0.7"
dependencies = [
"asusd",
"cargo-husky",
@@ -2878,7 +2869,7 @@ dependencies = [
[[package]]
name = "rog_anime"
version = "5.0.0"
version = "5.0.7"
dependencies = [
"cargo-husky",
"dmi_id",
@@ -2895,7 +2886,7 @@ dependencies = [
[[package]]
name = "rog_aura"
version = "5.0.0"
version = "5.0.7"
dependencies = [
"cargo-husky",
"dmi_id",
@@ -2909,7 +2900,7 @@ dependencies = [
[[package]]
name = "rog_dbus"
version = "5.0.0"
version = "5.0.7"
dependencies = [
"asusd",
"cargo-husky",
@@ -2922,7 +2913,7 @@ dependencies = [
[[package]]
name = "rog_platform"
version = "5.0.0"
version = "5.0.7"
dependencies = [
"cargo-husky",
"concat-idents",
@@ -2939,7 +2930,7 @@ dependencies = [
[[package]]
name = "rog_profiles"
version = "5.0.0"
version = "5.0.7"
dependencies = [
"cargo-husky",
"log",
@@ -2953,7 +2944,7 @@ dependencies = [
[[package]]
name = "rog_simulators"
version = "5.0.0"
version = "5.0.7"
dependencies = [
"glam",
"log",
@@ -3118,7 +3109,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.40",
"syn 2.0.43",
]
[[package]]
@@ -3140,14 +3131,14 @@ checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.40",
"syn 2.0.43",
]
[[package]]
name = "serde_spanned"
version = "0.6.4"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80"
checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1"
dependencies = [
"serde",
]
@@ -3320,9 +3311,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.40"
version = "2.0.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13fa70a4ee923979ffb522cacce59d34421ebdea5625e1073c4326ef9d2dd42e"
checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53"
dependencies = [
"proc-macro2",
"quote",
@@ -3392,29 +3383,29 @@ dependencies = [
[[package]]
name = "thiserror"
version = "1.0.50"
version = "1.0.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2"
checksum = "83a48fd946b02c0a526b2e9481c8e2a17755e47039164a86c4070446e3a4614d"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.50"
version = "1.0.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.40",
"syn 2.0.43",
]
[[package]]
name = "time"
version = "0.3.30"
version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5"
checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e"
dependencies = [
"deranged",
"powerfmt",
@@ -3479,9 +3470,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.35.0"
version = "1.35.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c"
checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104"
dependencies = [
"backtrace",
"libc",
@@ -3501,7 +3492,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.40",
"syn 2.0.43",
]
[[package]]
@@ -3577,7 +3568,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.40",
"syn 2.0.43",
]
[[package]]
@@ -3636,10 +3627,11 @@ dependencies = [
[[package]]
name = "uds_windows"
version = "1.0.2"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d"
checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9"
dependencies = [
"memoffset 0.9.0",
"tempfile",
"winapi",
]
@@ -4263,9 +4255,9 @@ dependencies = [
[[package]]
name = "winnow"
version = "0.5.28"
version = "0.5.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c830786f7720c2fd27a1a0e27a709dbd3c4d009b56d098fc742d4f4eab91fe2"
checksum = "9b5c3db89721d50d0e2a673f5043fc4722f76dcc352d7b1ab8b8288bed4ed2c5"
dependencies = [
"memchr",
]
@@ -4393,22 +4385,22 @@ dependencies = [
[[package]]
name = "zerocopy"
version = "0.7.30"
version = "0.7.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "306dca4455518f1f31635ec308b6b3e4eb1b11758cefafc782827d0aa7acb5c7"
checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
version = "0.7.30"
version = "0.7.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be912bf68235a88fbefd1b73415cb218405958d1655b2ece9035a19920bdf6ba"
checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.40",
"syn 2.0.43",
]
[[package]]
+2 -2
View File
@@ -4,11 +4,11 @@ default-members = ["asusctl", "asusd", "asusd-user", "cpuctl", "rog-control-cent
resolver = "2"
[workspace.package]
version = "5.0.0"
version = "5.0.7"
[workspace.dependencies]
async-trait = "^0.1"
tokio = { version = "^1.23.0", features = ["macros", "sync", "rt-multi-thread"]}
tokio = { version = "^1.23.0", default-features = false, features = ["macros", "sync"]}
concat-idents = "^1.1"
dirs = "^4.0"
smol = "^1.3"
+16 -12
View File
@@ -2,7 +2,7 @@
[Become a Patron!](https://www.patreon.com/bePatron?u=7602281) - [Asus Linux Website](https://asus-linux.org/)
**WARNING:** Many features are developed in tandem with kernel patches. If you see a feature is missing you either need a patched kernel, or v6.1 which has all my work merged upstream.
**WARNING:** Many features are developed in tandem with kernel patches. If you see a feature is missing you either need a patched kernel or latest release.
`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.
@@ -11,23 +11,23 @@ Now includes a GUI, `rog-control-center`.
## Kernel support
**The minimum supported kernel version is 5.17**
**For TUF laptops, the minimum supported kernel version is 6.1**
**The minimum supported kernel version is 6.6**
## Goals
1. To provide an interface for rootless control of some system functions most users wish to control such as fan speeds, keyboard LEDs, graphics modes.
2. Enable third-party apps to use the above with dbus methods
3. To make the above as easy as possible for new users
4. Respect the users resources: be small, light, and fast
The main goal of this work is to provide a safe and easy to use abstraction over various laptop features via DBUS, and to provide some helpful defaults and other behaviour such as toggling throttle/profile on AC/battery change.
Point 3 means that the list of supported distros is very narrow - fedora is explicitly
supported. All other distros are *not* supported (while asusd might still run fine on them).
For best support use fedora 36+ Workstation.
1. Provide safe dbus interface
2. Respect the users resources: be small, light, and fast
Point 4? asusd currently uses a tiny fraction of cpu time, and less than 1Mb of ram, the way
a system-level daemon should.
a system-level daemon should. Languages such as JS and python should never be used for system level daemons (please stop).
## Keyboard LEDs
The level of support for laptops is dependent on folks submitting data to include in [`./rog-aura/data/layouts/aura_support.ron`](./rog-aura/data/layouts/aura_support.ron), typically installed in `/usr/share/asusd/aura_support.ron`. This is because the controller used for keyboards and LEDs is used across many years and many laptop models, all with different firmware configurations - the only way to track this is with the file mentioned above. Why not just enable all by default? Because it confuses people.
See the [rog-aura readme](./rog-aura/README.md) for more details.
## Discord
@@ -41,6 +41,10 @@ to this:
```
Bus 001 Device 002: ID 0b05:1866 ASUSTek Computer, Inc. N-KEY Device
```
or
```
Bus 003 Device 002: ID 0b05:19b6 ASUSTek Computer, Inc. [unknown]
```
then it may work without tweaks. Technically all other functions except the LED
and AniMe parts should work regardless of your latop make.
+5 -5
View File
@@ -132,9 +132,9 @@ fn do_parsed(
println!("{}", CliStart::usage());
println!();
if let Some(cmdlist) = CliStart::command_list() {
let dev_type = dbus.proxies().aura().device_type()?;
let commands: Vec<String> = cmdlist.lines().map(|s| s.to_owned()).collect();
for command in commands.iter().filter(|command| {
let dev_type = dbus.proxies().aura().device_type().unwrap();
if !dev_type.is_old_style()
&& !dev_type.is_tuf_style()
&& command.trim().starts_with("led-pow-1")
@@ -420,8 +420,8 @@ fn handle_led_mode(
if let Some(cmdlist) = LedModeCommand::command_list() {
let commands: Vec<String> = cmdlist.lines().map(|s| s.to_owned()).collect();
let modes = dbus.proxies().aura().supported_basic_modes()?;
for command in commands.iter().filter(|command| {
let modes = dbus.proxies().aura().supported_modes().unwrap();
for mode in &modes {
if command
.trim()
@@ -450,7 +450,7 @@ fn handle_led_mode(
}
if mode.next_mode {
let mode = dbus.proxies().aura().led_mode()?;
let modes = dbus.proxies().aura().supported_modes()?;
let modes = dbus.proxies().aura().supported_basic_modes()?;
let mut pos = modes.iter().position(|m| *m == mode).unwrap() + 1;
if pos >= modes.len() {
pos = 0;
@@ -458,7 +458,7 @@ fn handle_led_mode(
dbus.proxies().aura().set_led_mode(modes[pos])?;
} else if mode.prev_mode {
let mode = dbus.proxies().aura().led_mode()?;
let modes = dbus.proxies().aura().supported_modes()?;
let modes = dbus.proxies().aura().supported_basic_modes()?;
let mut pos = modes.iter().position(|m| *m == mode).unwrap();
if pos == 0 {
pos = modes.len() - 1;
@@ -662,7 +662,7 @@ fn handle_throttle_profile(
supported: &[Properties],
cmd: &ProfileCommand,
) -> Result<(), Box<dyn std::error::Error>> {
if !supported.contains(&Properties::DgpuDisable) {
if !supported.contains(&Properties::PlatformPolicy) {
println!("Profiles not supported by either this kernel or by the laptop.");
return Err(ProfileError::NotSupported.into());
}
+1
View File
@@ -21,6 +21,7 @@ rog_platform = { path = "../rog-platform" }
rog_profiles = { path = "../rog-profiles" }
dmi_id = { path = "../dmi-id" }
futures-lite = "*"
udev.workspace = true
async-trait.workspace = true
tokio.workspace = true
+51 -6
View File
@@ -1,4 +1,4 @@
use config_traits::{StdConfig, StdConfigLoad2};
use config_traits::{StdConfig, StdConfigLoad3};
use rog_platform::platform::PlatformPolicy;
use serde_derive::{Deserialize, Serialize};
@@ -13,9 +13,7 @@ pub struct Config {
pub disable_nvidia_powerd_on_battery: bool,
pub ac_command: String,
pub bat_command: String,
/// Restored on boot as well as when power is plugged
#[serde(skip)]
pub platform_policy_to_restore: PlatformPolicy,
pub platform_policy_linked_epp: bool,
pub platform_policy_on_battery: PlatformPolicy,
pub platform_policy_on_ac: PlatformPolicy,
//
@@ -50,9 +48,56 @@ impl StdConfig for Config {
}
}
impl StdConfigLoad2<Config462, Config472> for Config {}
impl StdConfigLoad3<Config462, Config472, Config506> for Config {}
#[derive(Deserialize, Serialize, Default, Debug)]
#[derive(Deserialize, Serialize)]
pub struct Config506 {
/// Save charge limit for restoring on boot
pub charge_control_end_threshold: u8,
pub panel_od: bool,
pub mini_led_mode: bool,
pub disable_nvidia_powerd_on_battery: bool,
pub ac_command: String,
pub bat_command: String,
/// Restored on boot as well as when power is plugged
#[serde(skip)]
pub platform_policy_to_restore: PlatformPolicy,
pub platform_policy_on_battery: PlatformPolicy,
pub platform_policy_on_ac: PlatformPolicy,
//
pub ppt_pl1_spl: Option<u8>,
pub ppt_pl2_sppt: Option<u8>,
pub ppt_fppt: Option<u8>,
pub ppt_apu_sppt: Option<u8>,
pub ppt_platform_sppt: Option<u8>,
pub nv_dynamic_boost: Option<u8>,
pub nv_temp_target: Option<u8>,
}
impl From<Config506> for Config {
fn from(c: Config506) -> Self {
Self {
charge_control_end_threshold: c.charge_control_end_threshold,
panel_od: c.panel_od,
disable_nvidia_powerd_on_battery: c.disable_nvidia_powerd_on_battery,
ac_command: c.ac_command,
bat_command: c.bat_command,
mini_led_mode: c.mini_led_mode,
platform_policy_linked_epp: true,
platform_policy_on_battery: c.platform_policy_on_battery,
platform_policy_on_ac: c.platform_policy_on_ac,
ppt_pl1_spl: c.ppt_pl1_spl,
ppt_pl2_sppt: c.ppt_pl2_sppt,
ppt_fppt: c.ppt_fppt,
ppt_apu_sppt: c.ppt_apu_sppt,
ppt_platform_sppt: c.ppt_platform_sppt,
nv_dynamic_boost: c.nv_dynamic_boost,
nv_temp_target: c.nv_temp_target,
}
}
}
#[derive(Deserialize, Serialize)]
pub struct Config472 {
/// Save charge limit for restoring on boot
pub bat_charge_limit: u8,
+14
View File
@@ -73,6 +73,20 @@ impl CtrlAnime {
return Err(RogError::Anime(AnimeError::NoDevice));
};
// TODO: something better to set wakeups disabled
if matches!(node, Node::Usb(_)) {
if let Ok(mut enumerator) = udev::Enumerator::new() {
enumerator.match_subsystem("usb").ok();
enumerator.match_attribute("idProduct", "193b").ok();
if let Ok(mut enumer) = enumerator.scan_devices() {
if let Some(mut dev) = enumer.next() {
dev.set_attribute_value("power/wakeup", "disabled").ok();
}
}
}
}
let mut anime_type = get_anime_type()?;
if let AnimeType::Unknown = anime_type {
if let Some(model) = config.model_override {
+33 -2
View File
@@ -278,6 +278,7 @@ impl crate::CtrlTask for CtrlAnimeZbus {
let lock = inner.lock().await;
if lock.config.display_enabled {
lock.thread_exit.store(true, Ordering::Release); // ensure clean slate
lock.node
.write_bytes(&pkt_set_enable_display(
!(sleeping && lock.config.off_when_suspended),
@@ -287,7 +288,21 @@ impl crate::CtrlTask for CtrlAnimeZbus {
})
.ok();
if !sleeping && !lock.config.builtin_anims_enabled {
if lock.config.builtin_anims_enabled {
lock.node
.write_bytes(&pkt_set_enable_powersave_anim(
!(sleeping && lock.config.off_when_suspended),
))
.map_err(|err| {
warn!("create_sys_event_tasks::off_when_suspended {}", err);
})
.ok();
} else if !sleeping && !lock.config.builtin_anims_enabled {
// Run custom wake animation
lock.node
.write_bytes(&pkt_set_enable_powersave_anim(false))
.ok(); // ensure builtins are disabled
CtrlAnime::run_thread(inner.clone(), lock.cache.wake.clone(), true)
.await;
}
@@ -316,8 +331,16 @@ impl crate::CtrlTask for CtrlAnimeZbus {
async move {
let lock = inner.lock().await;
if lock.config.off_when_lid_closed {
if lock.config.builtin_anims_enabled {
lock.node
.write_bytes(&pkt_set_enable_powersave_anim(!lid_closed))
.map_err(|err| {
warn!("create_sys_event_tasks::off_when_suspended {}", err);
})
.ok();
}
lock.node
.write_bytes(&pkt_set_enable_display(lid_closed))
.write_bytes(&pkt_set_enable_display(!lid_closed))
.map_err(|err| {
warn!("create_sys_event_tasks::off_when_lid_closed {}", err);
})
@@ -331,6 +354,14 @@ impl crate::CtrlTask for CtrlAnimeZbus {
async move {
let lock = inner.lock().await;
if lock.config.off_when_unplugged {
if lock.config.builtin_anims_enabled {
lock.node
.write_bytes(&pkt_set_enable_powersave_anim(power_plugged))
.map_err(|err| {
warn!("create_sys_event_tasks::off_when_suspended {}", err);
})
.ok();
}
lock.node
.write_bytes(&pkt_set_enable_display(power_plugged))
.map_err(|err| {
+11 -11
View File
@@ -25,13 +25,13 @@ pub struct CtrlKbdLed {
pub led_prod: AuraDevice,
pub led_node: LEDNode,
pub sysfs_node: KeyboardLed,
pub supported_modes: LaptopLedData,
pub supported_data: LaptopLedData,
pub per_key_mode_active: bool,
pub config: AuraConfig,
}
impl CtrlKbdLed {
pub fn new(supported_modes: LaptopLedData) -> Result<Self, RogError> {
pub fn new(supported_basic_modes: LaptopLedData) -> Result<Self, RogError> {
let mut led_prod = AuraDevice::Unknown;
let mut usb_node = None;
for prod in ASUS_KEYBOARD_DEVICES {
@@ -97,7 +97,7 @@ impl CtrlKbdLed {
let mut new_set = Vec::new();
// only reuse a zone mode if the mode is supported
for mode in loaded {
if supported_modes.basic_modes.contains(&mode.mode) {
if supported_basic_modes.basic_modes.contains(&mode.mode) {
new_set.push(mode.clone());
}
}
@@ -111,7 +111,7 @@ impl CtrlKbdLed {
led_prod,
led_node, // on TUF this is the same as rgb_led / kd_brightness
sysfs_node: rgb_led, // If was none then we already returned above
supported_modes,
supported_data: supported_basic_modes,
per_key_mode_active: false,
config: config_loaded,
};
@@ -245,7 +245,7 @@ impl CtrlKbdLed {
/// exists.
fn create_multizone_default(&mut self) -> Result<(), RogError> {
let mut default = vec![];
for (i, tmp) in self.supported_modes.basic_zones.iter().enumerate() {
for (i, tmp) in self.supported_data.basic_zones.iter().enumerate() {
default.push(AuraEffect {
mode: self.config.current_mode,
zone: *tmp,
@@ -285,7 +285,7 @@ mod tests {
fn create_multizone_if_no_config() {
// Checking to ensure set_mode errors when unsupported modes are tried
let config = AuraConfig::from_default_support(AuraDevice::X19b6, &LaptopLedData::default());
let supported_modes = LaptopLedData {
let supported_basic_modes = LaptopLedData {
board_name: String::new(),
layout_name: "ga401".to_owned(),
basic_modes: vec![AuraModeNum::Static],
@@ -297,7 +297,7 @@ mod tests {
led_prod: AuraDevice::X19b6,
led_node: LEDNode::None,
sysfs_node: KeyboardLed::default(),
supported_modes,
supported_data: supported_basic_modes,
per_key_mode_active: false,
config,
};
@@ -306,8 +306,8 @@ mod tests {
assert!(controller.create_multizone_default().is_err());
assert!(controller.config.multizone.is_none());
controller.supported_modes.basic_zones.push(AuraZone::Key1);
controller.supported_modes.basic_zones.push(AuraZone::Key2);
controller.supported_data.basic_zones.push(AuraZone::Key1);
controller.supported_data.basic_zones.push(AuraZone::Key2);
assert!(controller.create_multizone_default().is_ok());
assert!(controller.config.multizone.is_some());
@@ -323,7 +323,7 @@ mod tests {
fn next_mode_create_multizone_if_no_config() {
// Checking to ensure set_mode errors when unsupported modes are tried
let config = AuraConfig::from_default_support(AuraDevice::X19b6, &LaptopLedData::default());
let supported_modes = LaptopLedData {
let supported_basic_modes = LaptopLedData {
board_name: String::new(),
layout_name: "ga401".to_owned(),
basic_modes: vec![AuraModeNum::Static],
@@ -335,7 +335,7 @@ mod tests {
led_prod: AuraDevice::X19b6,
led_node: LEDNode::None,
sysfs_node: KeyboardLed::default(),
supported_modes,
supported_data: supported_basic_modes,
per_key_mode_active: false,
config,
};
+16 -3
View File
@@ -5,6 +5,7 @@ use async_trait::async_trait;
use config_traits::StdConfig;
use log::{debug, error, info, warn};
use rog_aura::advanced::UsbPackets;
use rog_aura::aura_detection::PowerZones;
use rog_aura::usb::{AuraDevice, AuraPowerDev};
use rog_aura::{AuraEffect, AuraModeNum, AuraZone, LedBrightness};
use zbus::export::futures_util::lock::{Mutex, MutexGuard};
@@ -78,11 +79,23 @@ impl CtrlAuraZbus {
/// The total available modes
#[dbus_interface(property)]
async fn supported_modes(&self) -> Result<Vec<AuraModeNum>, ZbErr> {
async fn supported_basic_modes(&self) -> Result<Vec<AuraModeNum>, ZbErr> {
let ctrl = self.0.lock().await;
Ok(ctrl.config.builtins.keys().cloned().collect())
}
#[dbus_interface(property)]
async fn supported_basic_zones(&self) -> Result<Vec<AuraZone>, ZbErr> {
let ctrl = self.0.lock().await;
Ok(ctrl.supported_data.basic_zones.clone())
}
#[dbus_interface(property)]
async fn supported_power_zones(&self) -> Result<Vec<PowerZones>, ZbErr> {
let ctrl = self.0.lock().await;
Ok(ctrl.supported_data.power_zones.clone())
}
/// The current mode data
#[dbus_interface(property)]
async fn led_mode(&self) -> Result<AuraModeNum, ZbErr> {
@@ -126,9 +139,9 @@ impl CtrlAuraZbus {
#[dbus_interface(property)]
async fn set_led_mode_data(&mut self, effect: AuraEffect) -> Result<(), ZbErr> {
let mut ctrl = self.0.lock().await;
if !ctrl.supported_modes.basic_modes.contains(&effect.mode)
if !ctrl.supported_data.basic_modes.contains(&effect.mode)
|| effect.zone != AuraZone::None
&& !ctrl.supported_modes.basic_zones.contains(&effect.zone)
&& !ctrl.supported_data.basic_zones.contains(&effect.zone)
{
return Err(ZbErr::NotSupported(format!(
"The Aura effect is not supported: {effect:?}"
+60 -42
View File
@@ -109,19 +109,18 @@ impl CtrlFanCurveZbus {
}
pub async fn update_profiles_from_config(&self) {
let mut fan_curves = self.fan_curves.lock().await;
let config = self.config.lock().await;
fan_curves.balanced = config.balanced.clone();
fan_curves.performance = config.performance.clone();
fan_curves.quiet = config.quiet.clone();
self.fan_curves.lock().await.balanced = self.config.lock().await.balanced.clone();
self.fan_curves.lock().await.performance = self.config.lock().await.performance.clone();
self.fan_curves.lock().await.quiet = self.config.lock().await.quiet.clone();
}
/// Because this locks both config and fan_curves, it means nothing else can
/// hold a lock across this function call. Stupid choice to do this and
/// needs to be fixed.
pub async fn update_config_from_profiles(&self) {
let fan_curves = self.fan_curves.lock().await;
let mut config = self.config.lock().await;
config.balanced = fan_curves.balanced.clone();
config.performance = fan_curves.performance.clone();
config.quiet = fan_curves.quiet.clone();
self.config.lock().await.balanced = self.fan_curves.lock().await.balanced.clone();
self.config.lock().await.performance = self.fan_curves.lock().await.performance.clone();
self.config.lock().await.quiet = self.fan_curves.lock().await.quiet.clone();
}
}
@@ -134,10 +133,14 @@ impl CtrlFanCurveZbus {
profile: PlatformPolicy,
enabled: bool,
) -> zbus::fdo::Result<()> {
let mut fan_curves = self.fan_curves.lock().await;
fan_curves.set_profile_curves_enabled(profile, enabled);
fan_curves.write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?;
self.fan_curves
.lock()
.await
.set_profile_curves_enabled(profile, enabled);
self.fan_curves
.lock()
.await
.write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?;
self.update_config_from_profiles().await;
self.config.lock().await.write();
Ok(())
@@ -151,10 +154,14 @@ impl CtrlFanCurveZbus {
fan: FanCurvePU,
enabled: bool,
) -> zbus::fdo::Result<()> {
let mut fan_curves = self.fan_curves.lock().await;
fan_curves.set_profile_fan_curve_enabled(profile, fan, enabled);
fan_curves.write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?;
self.fan_curves
.lock()
.await
.set_profile_fan_curve_enabled(profile, fan, enabled);
self.fan_curves
.lock()
.await
.write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?;
self.update_config_from_profiles().await;
self.config.lock().await.write();
Ok(())
@@ -165,9 +172,13 @@ impl CtrlFanCurveZbus {
&mut self,
profile: PlatformPolicy,
) -> zbus::fdo::Result<Vec<CurveData>> {
let fan_curves = self.fan_curves.lock().await;
let curve = fan_curves.get_fan_curves_for(profile);
Ok(curve.to_vec())
let curve = self
.fan_curves
.lock()
.await
.get_fan_curves_for(profile)
.to_vec();
Ok(curve)
}
/// Set the fan curve for the specified profile.
@@ -177,13 +188,16 @@ impl CtrlFanCurveZbus {
profile: PlatformPolicy,
curve: CurveData,
) -> zbus::fdo::Result<()> {
let mut fan_curves = self.fan_curves.lock().await;
fan_curves.save_fan_curve(curve, profile)?;
fan_curves.write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?;
self.fan_curves
.lock()
.await
.save_fan_curve(curve, profile)?;
self.fan_curves
.lock()
.await
.write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?;
self.update_config_from_profiles().await;
self.config.lock().await.write();
Ok(())
}
@@ -193,10 +207,11 @@ impl CtrlFanCurveZbus {
/// Each platform_profile has a different default and the defualt can be
/// read only for the currently active profile.
async fn set_active_curve_to_defaults(&mut self) -> zbus::fdo::Result<()> {
let mut fan_curves = self.fan_curves.lock().await;
let active = self.platform.get_throttle_thermal_policy()?;
fan_curves.set_active_curve_to_defaults(active.into(), &mut find_fan_curve_node()?)?;
self.fan_curves
.lock()
.await
.set_active_curve_to_defaults(active.into(), &mut find_fan_curve_node()?)?;
self.update_config_from_profiles().await;
self.config.lock().await.write();
Ok(())
@@ -208,15 +223,16 @@ impl CtrlFanCurveZbus {
/// Each platform_profile has a different default and the defualt can be
/// read only for the currently active profile.
async fn reset_profile_curves(&self, profile: PlatformPolicy) -> zbus::fdo::Result<()> {
let mut fan_curves = self.fan_curves.lock().await;
let active = self
.platform
.get_throttle_thermal_policy()
.unwrap_or(PlatformPolicy::Balanced.into());
self.platform.set_throttle_thermal_policy(profile.into())?;
fan_curves.set_active_curve_to_defaults(active.into(), &mut find_fan_curve_node()?)?;
self.fan_curves
.lock()
.await
.set_active_curve_to_defaults(active.into(), &mut find_fan_curve_node()?)?;
self.platform.set_throttle_thermal_policy(active)?;
self.update_config_from_profiles().await;
@@ -280,16 +296,18 @@ impl CtrlTask for CtrlFanCurveZbus {
impl crate::Reloadable for CtrlFanCurveZbus {
/// Fetch the active profile and use that to set all related components up
async fn reload(&mut self) -> Result<(), RogError> {
// let active = self.platform.get_throttle_thermal_policy()?.into();
// if let Ok(mut device) = find_fan_curve_node() {
// // There is a possibility that the curve was default zeroed, so this call
// // initialises the data from system read and we need to save it
// // after
// self.fan_curves
// .lock()
// .await
// .write_profile_curve_to_platform(active, &mut device)?;
// }
let active = self.platform.get_throttle_thermal_policy()?.into();
if let Ok(mut device) = find_fan_curve_node() {
// There is a possibility that the curve was default zeroed, so this call
// initialises the data from system read and we need to save it
// after
loop {
if let Ok(mut curves) = self.fan_curves.try_lock() {
curves.write_profile_curve_to_platform(active, &mut device)?;
break;
}
}
}
Ok(())
}
}
+47 -27
View File
@@ -4,7 +4,7 @@ use std::sync::Arc;
use async_trait::async_trait;
use config_traits::StdConfig;
use log::{debug, error, info, warn};
use rog_platform::cpu::CPUControl;
use rog_platform::cpu::{CPUControl, CPUGovernor};
use rog_platform::platform::{GpuMode, PlatformPolicy, Properties, RogPlatform};
use rog_platform::power::AsusPower;
use zbus::export::futures_util::lock::Mutex;
@@ -33,7 +33,7 @@ macro_rules! platform_get_value {
})
})
} else {
error!("RogPlatform: {} not supported", $prop_name);
info!("RogPlatform: {} not supported", $prop_name);
return Err(FdoErr::NotSupported(format!("RogPlatform: {} not supported", $prop_name)));
}
})
@@ -45,9 +45,9 @@ macro_rules! platform_get_value_if_some {
concat_idents::concat_idents!(has = has_, $property {
if $self.platform.has() {
let lock = $self.config.lock().await;
Ok(lock.ppt_pl1_spl.unwrap_or($default))
Ok(lock.$property.unwrap_or($default))
} else {
error!("RogPlatform: {} not supported", $prop_name);
info!("RogPlatform: {} not supported", $prop_name);
return Err(FdoErr::NotSupported(format!("RogPlatform: {} not supported", $prop_name)));
}
})
@@ -69,7 +69,7 @@ macro_rules! platform_set_bool {
lock.write();
Ok(())
} else {
error!("RogPlatform: {} not supported", $prop_name);
info!("RogPlatform: {} not supported", $prop_name);
Err(FdoErr::NotSupported(format!("RogPlatform: {} not supported", $prop_name)))
}
})
@@ -180,7 +180,28 @@ impl CtrlPlatform {
}
}
async fn update_policy_ac_or_bat(&self, power_plugged: bool) {
fn check_and_set_epp(&self, profile: PlatformPolicy, change_epp: bool) {
if !change_epp {
info!("PlatformPolicy unlinked from EPP");
return;
}
info!("PlatformPolicy setting EPP");
if let Some(cpu) = self.cpu_control.as_ref() {
if let Ok(epp) = cpu.get_available_epp() {
debug!("Available EPP: {epp:?}");
if epp.contains(&profile.into()) {
debug!("Setting {profile:?}");
cpu.set_epp(profile.into()).ok();
} else if let Ok(gov) = cpu.get_governor() {
if gov != CPUGovernor::Powersave {
warn!("powersave governor is not is use, you should use it.");
}
}
}
}
}
async fn update_policy_ac_or_bat(&self, power_plugged: bool, change_epp: bool) {
let profile = if power_plugged {
self.config.lock().await.platform_policy_on_ac
} else {
@@ -189,9 +210,7 @@ impl CtrlPlatform {
self.platform
.set_throttle_thermal_policy(profile.into())
.ok();
if let Some(cpu) = self.cpu_control.as_ref() {
cpu.set_epp(profile.into()).ok();
}
self.check_and_set_epp(profile, change_epp);
}
}
@@ -322,19 +341,17 @@ impl CtrlPlatform {
let policy: PlatformPolicy =
platform_get_value!(self, throttle_thermal_policy, "throttle_thermal_policy")
.map(|n| n.into())?;
let policy = PlatformPolicy::next(&policy);
if self.platform.has_throttle_thermal_policy() {
if let Some(cpu) = self.cpu_control.as_ref() {
info!("PlatformPolicy setting EPP");
cpu.set_epp(policy.into())?
}
let change_epp = self.config.lock().await.platform_policy_linked_epp;
self.check_and_set_epp(policy, change_epp);
self.platform
.set_throttle_thermal_policy(policy.into())
.map_err(|err| {
warn!("RogPlatform: throttle_thermal_policy {}", err);
FdoErr::Failed(format!("RogPlatform: throttle_thermal_policy: {err}"))
})?;
self.config.lock().await.platform_policy_to_restore = policy;
Ok(self.throttle_thermal_policy_changed(&ctxt).await?)
} else {
Err(FdoErr::NotSupported(
@@ -353,11 +370,8 @@ impl CtrlPlatform {
async fn set_throttle_thermal_policy(&mut self, policy: PlatformPolicy) -> Result<(), FdoErr> {
// TODO: watch for external changes
if self.platform.has_throttle_thermal_policy() {
if let Some(cpu) = self.cpu_control.as_ref() {
info!("PlatformPolicy setting EPP");
cpu.set_epp(policy.into())?
}
self.config.lock().await.platform_policy_to_restore = policy;
let change_epp = self.config.lock().await.platform_policy_linked_epp;
self.check_and_set_epp(policy, change_epp);
self.platform
.set_throttle_thermal_policy(policy.into())
.map_err(|err| {
@@ -524,7 +538,9 @@ impl crate::Reloadable for CtrlPlatform {
if let Ok(power_plugged) = self.power.get_online() {
if self.platform.has_throttle_thermal_policy() {
self.update_policy_ac_or_bat(power_plugged > 0).await;
let change_epp = self.config.lock().await.platform_policy_linked_epp;
self.update_policy_ac_or_bat(power_plugged > 0, change_epp)
.await;
}
self.run_ac_or_bat_cmd(power_plugged > 0).await;
}
@@ -604,7 +620,11 @@ impl CtrlTask for CtrlPlatform {
}
if let Ok(power_plugged) = platform1.power.get_online() {
if !sleeping && platform1.platform.has_throttle_thermal_policy() {
platform1.update_policy_ac_or_bat(power_plugged > 0).await;
let change_epp =
platform1.config.lock().await.platform_policy_linked_epp;
platform1
.update_policy_ac_or_bat(power_plugged > 0, change_epp)
.await;
}
if !sleeping {
platform1.run_ac_or_bat_cmd(power_plugged > 0).await;
@@ -638,7 +658,10 @@ impl CtrlTask for CtrlPlatform {
// power change
async move {
if platform3.platform.has_throttle_thermal_policy() {
platform3.update_policy_ac_or_bat(power_plugged).await;
let change_epp = platform3.config.lock().await.platform_policy_linked_epp;
platform3
.update_policy_ac_or_bat(power_plugged, change_epp)
.await;
}
platform3.run_ac_or_bat_cmd(power_plugged).await;
}
@@ -687,11 +710,8 @@ impl CtrlTask for CtrlPlatform {
error!("Platform: get_throttle_thermal_policy error: {e}");
})
{
if let Some(cpu) = ctrl.cpu_control.as_ref() {
info!("PlatformPolicy setting EPP");
cpu.set_epp(profile.into()).ok();
}
ctrl.config.lock().await.platform_policy_to_restore = profile;
let change_epp = ctrl.config.lock().await.platform_policy_linked_epp;
ctrl.check_and_set_epp(profile, change_epp);
}
}
}
+1 -1
View File
@@ -15,7 +15,7 @@ use asusd::ctrl_aura::trait_impls::CtrlAuraZbus;
use asusd::ctrl_fancurves::CtrlFanCurveZbus;
use asusd::ctrl_platform::CtrlPlatform;
use asusd::{print_board_info, CtrlTask, Reloadable, ZbusRun, DBUS_NAME};
use config_traits::{StdConfig, StdConfigLoad2};
use config_traits::{StdConfig, StdConfigLoad2, StdConfigLoad3};
use log::{error, info, warn};
use rog_aura::aura_detection::LaptopLedData;
use tokio::time::sleep;
+9 -7
View File
@@ -5,7 +5,7 @@
Get the data set for every mode available
-->
<method name="AllModeData">
<arg type="a{u(us(yyy)(yyy)ss)}" direction="out"/>
<arg type="a{u(uu(yyy)(yyy)ss)}" direction="out"/>
</method>
<!--
On machine that have some form of either per-key keyboard or per-zone
@@ -45,21 +45,23 @@
On success the aura config file is read to refresh cached values, then
the effect is stored and config written to disk.
-->
<property name="LedModeData" type="(us(yyy)(yyy)ss)" access="readwrite"/>
<property name="LedModeData" type="(uu(yyy)(yyy)ss)" access="readwrite"/>
<!--
Set a variety of states, input is array of enum.
`enabled` sets if the sent array should be disabled or enabled
For Modern ROG devices the "enabled" flag is ignored.
-->
<property name="LedPower" type="(asas((sbbbb)(sbbbb)(sbbbb)(sbbbb)(sbbbb)))" access="readwrite"/>
<property name="LedPower" type="(ayay((ubbbb)(ubbbb)(ubbbb)(ubbbb)(ubbbb)))" access="readwrite"/>
<!--
The total available modes
-->
<property name="SupportedBasicModes" type="au" access="read"/>
<property name="SupportedBasicZones" type="au" access="read"/>
<!--
Total levels of brightness available
-->
<property name="SupportedBrightness" type="au" access="read"/>
<!--
The total available modes
-->
<property name="SupportedModes" type="au" access="read"/>
<property name="SupportedPowerZones" type="au" access="read"/>
</interface>
</node>
+15
View File
@@ -2,6 +2,20 @@
Generated by typeshare 1.7.0
*/
export enum CPUGovernor {
Performance = "Performance",
Powersave = "Powersave",
BadValue = "BadValue",
}
export enum CPUEPP {
Default = "Default",
Performance = "Performance",
BalancePerformance = "BalancePerformance",
BalancePower = "BalancePower",
Power = "Power",
}
export enum GpuMode {
Discrete = "Discrete",
Optimus = "Optimus",
@@ -13,6 +27,7 @@ export enum GpuMode {
NotSupported = "NotSupported",
}
/** `throttle_thermal_policy` in asus_wmi */
export enum PlatformPolicy {
Balanced = "Balanced",
Performance = "Performance",
+1 -1
View File
@@ -2,7 +2,7 @@
Description=ASUS Notebook Control
StartLimitInterval=500
StartLimitBurst=5
After=nvidia-powerd.service,systemd-udevd.service
After=nvidia-powerd.service systemd-udevd.service
[Service]
Environment=IS_SERVICE=1
+16
View File
@@ -71,6 +71,14 @@
advanced_type: None,
power_zones: [Keyboard],
),
(
board_name: "FX705D",
layout_name: "fx505d",
basic_modes: [Static, Breathe, Strobe, Pulse],
basic_zones: [],
advanced_type: None,
power_zones: [Keyboard],
),
(
board_name: "G512",
layout_name: "g512",
@@ -399,6 +407,14 @@
advanced_type: PerKey,
power_zones: [Keyboard, Lightbar],
),
(
board_name: "G834JZ",
layout_name: "g814ji-per-key",
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
basic_zones: [],
advanced_type: PerKey,
power_zones: [Keyboard, Lightbar, Logo, RearGlow],
),
(
board_name: "GA401Q",
layout_name: "ga401q",
+1 -1
View File
@@ -28,7 +28,7 @@ pub struct LedSupportFile(Vec<LaptopLedData>);
#[cfg_attr(
feature = "dbus",
derive(Type, Value, OwnedValue),
zvariant(signature = "s")
zvariant(signature = "u")
)]
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Default, Copy, Clone)]
pub enum PowerZones {
+1 -1
View File
@@ -303,7 +303,7 @@ impl From<AuraEffect> for AuraModeNum {
#[cfg_attr(
feature = "dbus",
derive(Type, Value, OwnedValue),
zvariant(signature = "s")
zvariant(signature = "u")
)]
#[derive(Debug, Default, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
pub enum AuraZone {
+1 -2
View File
@@ -10,10 +10,9 @@ pub mod effects;
pub mod advanced;
/// Convert the `RgbAddress` to `&str` labels
pub mod advanced_to_str;
pub mod error;
pub use advanced_to_str::*;
/// Helper for detecting what is available
pub mod aura_detection;
pub mod error;
/// Helpers for consructing keyboard layouts for UI use and effects
pub mod layouts;
pub mod usb;
+2 -2
View File
@@ -137,7 +137,7 @@ pub struct AuraPowerDev {
#[cfg_attr(
feature = "dbus",
derive(Type, Value, OwnedValue),
zvariant(signature = "s")
zvariant(signature = "y")
)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[repr(u32)]
@@ -172,7 +172,7 @@ impl AuraDevTuf {
#[cfg_attr(
feature = "dbus",
derive(Type, Value, OwnedValue),
zvariant(signature = "s")
zvariant(signature = "y")
)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[repr(u32)]
+4 -2
View File
@@ -10,10 +10,12 @@ edition = "2021"
#mocking = []
[dependencies]
# egui = "0.24.1"
# eframe = "0.24.1"
# egui_plot = "0.24.1"
# Stuck on this revision due to crash issues on app close
egui = { git = "https://github.com/emilk/egui", rev = "b8e798777de519de3a1878798097ab2ab0bd4def"}
eframe = { git = "https://github.com/emilk/egui", rev = "b8e798777de519de3a1878798097ab2ab0bd4def"}
# egui = { path = "../../egui/crates/egui" }
# eframe = { path = "../../egui/crates/eframe" }
libappindicator = "0.8" # Tray icon
gtk = "0.16"
+2 -2
View File
@@ -107,7 +107,7 @@ impl eframe::App for RogApp {
/// Called each time the UI needs repainting, which may be many times per
/// second. Put your widgets into a `SidePanel`, `TopPanel`,
/// `CentralPanel`, `Window` or `Area`.
fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
fn update(&mut self, ctx: &eframe::egui::Context, frame: &mut eframe::Frame) {
let states = self.states.clone();
if let Ok(mut states) = states.try_lock() {
@@ -131,7 +131,7 @@ impl eframe::App for RogApp {
return;
}
self.top_bar(&mut states, ctx, frame);
self.top_bar(ctx, frame);
self.side_panel(ctx);
}
let page = self.page;
+48 -39
View File
@@ -6,9 +6,9 @@ use std::sync::{Arc, Mutex};
use std::thread;
use std::time::Duration;
use eframe::IconData;
use eframe::HardwareAcceleration;
use gumdrop::Options;
use log::{debug, error, info, warn, LevelFilter};
use log::{debug, error, warn, LevelFilter};
use rog_aura::aura_detection::{LaptopLedData, LedSupportFile};
use rog_aura::layouts::KeyLayout;
use rog_control_center::cli_options::CliStart;
@@ -29,7 +29,8 @@ const DATA_DIR: &str = "/usr/share/rog-gui/";
#[cfg(feature = "mocking")]
const DATA_DIR: &str = env!("CARGO_MANIFEST_DIR");
const BOARD_NAME: &str = "/sys/class/dmi/id/board_name";
const APP_ICON_PATH: &str = "/usr/share/icons/hicolor/512x512/apps/rog-control-center.png";
// const APP_ICON_PATH: &str =
// "/usr/share/icons/hicolor/512x512/apps/rog-control-center.png";
fn main() -> Result<()> {
let args: Vec<String> = args().skip(1).collect();
@@ -60,12 +61,10 @@ fn main() -> Result<()> {
let native_options = eframe::NativeOptions {
vsync: true,
decorated: true,
transparent: false,
min_window_size: Some(egui::vec2(960.0, 670.0)),
max_window_size: Some(egui::vec2(960.0, 670.0)),
hardware_acceleration: HardwareAcceleration::Preferred,
min_window_size: Some(egui::vec2(980.0, 670.0)),
max_window_size: Some(egui::vec2(980.0, 670.0)),
run_and_return: true,
icon_data: Some(load_icon()),
..Default::default()
};
@@ -187,6 +186,13 @@ fn main() -> Result<()> {
&config,
)?;
if cli_parsed.board_name.is_some() || cli_parsed.layout_viewing {
if let Ok(mut lock) = states.lock() {
lock.run_in_bg = false;
running_in_bg.store(false, Ordering::Release);
}
}
if config.enable_tray_icon {
init_tray(supported_properties, states.clone());
}
@@ -202,7 +208,9 @@ fn main() -> Result<()> {
"ROG Control Center",
native_options.clone(),
Box::new(move |cc| {
Box::new(RogApp::new(Config::load().unwrap(), states, cc).unwrap())
let cfg = Config::load().unwrap();
let app = RogApp::new(cfg, states, cc);
Box::new(app.unwrap())
}),
)?;
@@ -211,7 +219,7 @@ fn main() -> Result<()> {
}
if let Ok(lock) = states.try_lock() {
if !lock.run_in_bg || cli_parsed.board_name.is_some() || cli_parsed.layout_viewing {
if !lock.run_in_bg {
break;
}
@@ -261,37 +269,38 @@ fn setup_page_state_and_notifs(
}
/// Bah.. the icon dosn't work on wayland anyway, but we'll leave it in for now.
fn load_icon() -> IconData {
let path = PathBuf::from(APP_ICON_PATH);
let mut rgba = Vec::new();
let mut height = 512;
let mut width = 512;
if path.exists() {
if let Ok(data) = std::fs::read(path)
.map_err(|e| error!("Error reading app icon: {e:?}"))
.map_err(|e| error!("Error opening app icon: {e:?}"))
{
let data = std::io::Cursor::new(data);
let decoder = png_pong::Decoder::new(data).unwrap().into_steps();
let png_pong::Step { raster, delay: _ } = decoder.last().unwrap().unwrap();
// fn load_icon() -> IconData {
// let path = PathBuf::from(APP_ICON_PATH);
// let mut rgba = Vec::new();
// let mut height = 512;
// let mut width = 512;
// if path.exists() {
// if let Ok(data) = std::fs::read(path)
// .map_err(|e| error!("Error reading app icon: {e:?}"))
// .map_err(|e| error!("Error opening app icon: {e:?}"))
// {
// let data = std::io::Cursor::new(data);
// let decoder = png_pong::Decoder::new(data).unwrap().into_steps();
// let png_pong::Step { raster, delay: _ } =
// decoder.last().unwrap().unwrap();
if let png_pong::PngRaster::Rgba8(ras) = raster {
rgba = ras.as_u8_slice().to_vec();
width = ras.width();
height = ras.height();
info!("Loaded app icon. Not actually supported in Wayland yet");
}
}
} else {
error!("Missing {APP_ICON_PATH}");
}
// if let png_pong::PngRaster::Rgba8(ras) = raster {
// rgba = ras.as_u8_slice().to_vec();
// width = ras.width();
// height = ras.height();
// info!("Loaded app icon. Not actually supported in Wayland
// yet"); }
// }
// } else {
// error!("Missing {APP_ICON_PATH}");
// }
IconData {
height,
width,
rgba,
}
}
// IconData {
// height,
// width,
// rgba,
// }
// }
fn do_cli_help(parsed: &CliStart) -> bool {
if parsed.help {
+1 -1
View File
@@ -1,7 +1,7 @@
use crate::RogApp;
impl RogApp {
pub fn anime_page(&mut self, ctx: &egui::Context) {
pub fn anime_page(&mut self, ctx: &eframe::egui::Context) {
egui::CentralPanel::default().show(ctx, |ui| {
ui.label("In progress");
});
+1 -1
View File
@@ -3,7 +3,7 @@ use crate::widgets::app_settings;
use crate::RogApp;
impl RogApp {
pub fn app_settings_page(&mut self, states: &mut SystemState, ctx: &egui::Context) {
pub fn app_settings_page(&mut self, states: &mut SystemState, ctx: &eframe::egui::Context) {
let Self { config, .. } = self;
egui::CentralPanel::default().show(ctx, |ui| {
+1 -1
View File
@@ -9,7 +9,7 @@ use crate::widgets::{aura_modes_group, keyboard};
use crate::RogApp;
impl RogApp {
pub fn aura_page(&mut self, states: &mut SystemState, ctx: &egui::Context) {
pub fn aura_page(&mut self, states: &mut SystemState, ctx: &eframe::egui::Context) {
let Self {
oscillator1,
oscillator2,
+1 -26
View File
@@ -6,7 +6,7 @@ use crate::widgets::fan_graphs;
use crate::{RogApp, RogDbusClientBlocking};
impl RogApp {
pub fn fan_curve_page(&mut self, states: &mut SystemState, ctx: &egui::Context) {
pub fn fan_curve_page(&mut self, states: &mut SystemState, ctx: &eframe::egui::Context) {
if let Some(mut throttle) = states.bios.throttle {
egui::CentralPanel::default().show(ctx, |ui| {
ui.heading("Custom fan curves");
@@ -43,31 +43,6 @@ impl RogApp {
ui.label(RichText::new(format!("{}", current)).strong());
});
// ui.horizontal(|ui| {
// ui.label("Enabled fan-curves: ");
// let mut fan_curve_enable = |profile: Profile, fan: FanCurvePU, mut
// checked: bool| { if ui
// .add(egui::Checkbox::new(&mut checked, format!("{:?}", fan)))
// .changed()
// {
// dbus.proxies()
// .profile()
// .set_fan_curves_enabled(profile, checked)
// .map_err(|err| {
// *do_error = Some(err.to_string());
// })
// .ok();
// changed = true;
// }
// };
// if let Some(curves) = curves.curves.get_mut(&current) {
// for curve in curves.iter_mut() {
// fan_curve_enable(current, curve.fan, curve.enabled);
// }
// }
// });
ui.horizontal(|ui| {
ui.label("Enabled fan-curves: ");
let mut checked = false;
-6
View File
@@ -3,9 +3,3 @@ mod app_settings;
mod aura_page;
mod fan_curve_page;
mod system_page;
pub use anime_page::*;
pub use app_settings::*;
pub use aura_page::*;
pub use fan_curve_page::*;
pub use system_page::*;
+3 -3
View File
@@ -1,9 +1,9 @@
use crate::system_state::SystemState;
use crate::widgets::{anime_power_group, platform_profile, rog_bios_group};
use crate::widgets::{anime_power_group, aura_power_group, platform_profile, rog_bios_group};
use crate::RogApp;
impl RogApp {
pub fn system_page(&mut self, states: &mut SystemState, ctx: &egui::Context) {
pub fn system_page(&mut self, states: &mut SystemState, ctx: &eframe::egui::Context) {
egui::CentralPanel::default().show(ctx, |ui| {
ui.heading("Laptop settings");
@@ -22,7 +22,7 @@ impl RogApp {
ui.vertical(|ui| {
ui.separator();
if self.supported_interfaces.contains(&"Aura".to_string()) {
// aura_power_group(states, ui);
aura_power_group(states, ui);
}
});
ui.end_row();
+16 -14
View File
@@ -1,4 +1,4 @@
use egui::{Button, RichText};
use egui::RichText;
pub struct AppErrorShow {
error: String,
@@ -11,7 +11,7 @@ impl AppErrorShow {
}
impl eframe::App for AppErrorShow {
fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
ui.heading("ROG ERROR");
@@ -19,18 +19,20 @@ impl eframe::App for AppErrorShow {
ui.label(RichText::new(format!("The error was: {:?}", self.error)).size(22.0));
});
egui::TopBottomPanel::bottom("error_bar_2")
.default_height(26.0)
.show(ctx, |ui| {
ui.with_layout(egui::Layout::right_to_left(egui::Align::TOP), |ui| {
if ui
.add(Button::new(RichText::new("Okay").size(20.0)))
.clicked()
{
frame.close();
}
});
});
// egui::TopBottomPanel::bottom("error_bar_2")
// .default_height(26.0)
// .show(ctx, |ui| {
// ui.
// with_layout(egui::Layout::right_to_left(egui::Align::TOP), |ui| {
// if ui
// .add(Button::new(RichText::new("Okay").size(20.0)))
// .clicked()
// {
// // frame.close();
// // ui.close_menu();
// }
// });
// });
});
}
}
+23 -7
View File
@@ -6,9 +6,10 @@ use std::time::SystemTime;
use egui::Vec2;
use log::error;
use rog_anime::{Animations, DeviceState};
use rog_aura::aura_detection::PowerZones;
use rog_aura::layouts::KeyLayout;
use rog_aura::usb::AuraPowerDev;
use rog_aura::{AuraEffect, AuraModeNum, LedBrightness};
use rog_aura::usb::{AuraDevice, AuraPowerDev};
use rog_aura::{AuraEffect, AuraModeNum, AuraZone, LedBrightness};
use rog_platform::platform::{GpuMode, PlatformPolicy};
use rog_profiles::fan_curve_set::CurveData;
use rog_profiles::FanCurvePU;
@@ -79,20 +80,21 @@ impl FanCurvesState {
PlatformPolicy::Performance,
];
let mut available_fans = HashSet::new();
let mut curves: BTreeMap<PlatformPolicy, Vec<CurveData>> = BTreeMap::new();
for p in &profiles {
if let Ok(curve) = dbus.proxies().fan_curves().fan_curve_data(*p) {
if available_fans.is_empty() {
for fan in &curve {
available_fans.insert(fan.fan);
}
}
curves.insert(*p, curve);
} else {
curves.insert(*p, Default::default());
}
}
let available_fans = HashSet::new();
// for fan in supported.platform_profile.fans.iter() {
// available_fans.insert(*fan);
// }
let show_curve = dbus.proxies().platform().throttle_thermal_policy()?;
Ok(Self {
@@ -110,6 +112,9 @@ pub struct AuraState {
pub current_mode: AuraModeNum,
pub modes: BTreeMap<AuraModeNum, AuraEffect>,
pub enabled: AuraPowerDev,
pub dev_type: AuraDevice,
pub supported_basic_zones: Vec<AuraZone>,
pub supported_power_zones: Vec<PowerZones>,
/// Brightness from 0-3
pub bright: LedBrightness,
pub wave_red: [u8; 22],
@@ -132,6 +137,17 @@ impl AuraState {
BTreeMap::new()
},
enabled: dbus.proxies().aura().led_power().unwrap_or_default(),
supported_basic_zones: dbus
.proxies()
.aura()
.supported_basic_zones()
.unwrap_or_default(),
supported_power_zones: dbus
.proxies()
.aura()
.supported_power_zones()
.unwrap_or_default(),
dev_type: dbus.proxies().aura().device_type().unwrap_or_default(),
bright: dbus.proxies().aura().brightness().unwrap_or_default(),
wave_red: [0u8; 22],
wave_green: [0u8; 22],
+1 -2
View File
@@ -224,12 +224,11 @@ pub fn aura_modes_group(states: &mut SystemState, freq: &mut Arc<AtomicU8>, ui:
if changed {
states.aura.current_mode = selected;
states
.asus_dbus
.proxies()
.aura()
.set_led_mode(states.aura.modes.get(&selected).unwrap().mode)
.set_led_mode_data(states.aura.modes.get(&selected).unwrap().clone())
.map_err(|err| {
states.error = Some(err.to_string());
})
+15 -16
View File
@@ -4,24 +4,23 @@ use rog_aura::usb::{AuraDevRog1, AuraDevTuf, AuraDevice, AuraPowerDev};
use crate::system_state::SystemState;
pub fn aura_power_group(supported: &SupportedFunctions, states: &mut SystemState, ui: &mut Ui) {
pub fn aura_power_group(states: &mut SystemState, ui: &mut Ui) {
ui.heading("Keyboard LED power settings");
if supported.keyboard_led.dev_id.is_old_style() || supported.keyboard_led.dev_id.is_tuf_style()
{
aura_power1(supported, states, ui);
} else if supported.keyboard_led.dev_id.is_new_style() {
aura_power2(supported, states, ui);
if states.aura.dev_type.is_old_style() || states.aura.dev_type.is_tuf_style() {
aura_power1(states, ui);
} else if states.aura.dev_type.is_new_style() {
aura_power2(states, ui);
}
}
fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mut Ui) {
fn aura_power1(states: &mut SystemState, ui: &mut Ui) {
let enabled_states = &mut states.aura.enabled;
let mut boot = enabled_states.old_rog.contains(&AuraDevRog1::Boot);
let mut sleep = enabled_states.old_rog.contains(&AuraDevRog1::Sleep);
let mut keyboard = enabled_states.old_rog.contains(&AuraDevRog1::Keyboard);
let mut lightbar = enabled_states.old_rog.contains(&AuraDevRog1::Lightbar);
if supported.keyboard_led.dev_id == AuraDevice::Tuf {
if states.aura.dev_type == AuraDevice::Tuf {
boot = enabled_states.tuf.contains(&AuraDevTuf::Boot);
sleep = enabled_states.tuf.contains(&AuraDevTuf::Sleep);
keyboard = enabled_states.tuf.contains(&AuraDevTuf::Awake);
@@ -58,7 +57,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
if ui.toggle_value(&mut keyboard, "Keyboard").changed() {
changed = true;
}
if !supported.keyboard_led.basic_zones.is_empty()
if !states.aura.supported_basic_zones.is_empty()
&& ui.toggle_value(&mut lightbar, "Lightbar").changed()
{
changed = true;
@@ -93,7 +92,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
});
if changed {
if supported.keyboard_led.dev_id == AuraDevice::Tuf {
if states.aura.dev_type == AuraDevice::Tuf {
let mut enabled = Vec::new();
let mut disabled = Vec::new();
@@ -132,7 +131,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
.asus_dbus
.proxies()
.aura()
.set_led_power(options, enable)
.set_led_power((options, enable))
.map_err(|err| {
states.error = Some(err.to_string());
})
@@ -168,7 +167,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
modify_x1866(boot, AuraDevRog1::Boot);
modify_x1866(sleep, AuraDevRog1::Sleep);
modify_x1866(keyboard, AuraDevRog1::Keyboard);
if !supported.keyboard_led.basic_zones.is_empty() {
if !states.aura.supported_basic_zones.is_empty() {
modify_x1866(lightbar, AuraDevRog1::Lightbar);
}
@@ -182,7 +181,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
.asus_dbus
.proxies()
.aura()
.set_led_power(options, enable)
.set_led_power((options, enable))
.map_err(|err| {
states.error = Some(err.to_string());
})
@@ -194,7 +193,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
}
}
fn aura_power2(supported: &SupportedFunctions, states: &mut SystemState, ui: &mut Ui) {
fn aura_power2(states: &mut SystemState, ui: &mut Ui) {
let AuraPower {
keyboard,
logo,
@@ -208,7 +207,7 @@ fn aura_power2(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
let mut changed = false;
let mut item = |power: &mut KbAuraPowerState, ui: &mut Ui| {
ui.vertical(|ui| {
if supported.keyboard_led.power_zones.contains(&power.zone) {
if states.aura.supported_power_zones.contains(&power.zone) {
ui.horizontal_wrapped(|ui| {
ui.label(RichText::new(format!("{:?}", power.zone)).size(14.0));
});
@@ -247,7 +246,7 @@ fn aura_power2(supported: &SupportedFunctions, states: &mut SystemState, ui: &mu
.asus_dbus
.proxies()
.aura()
.set_led_power(options, enable)
.set_led_power((options, enable))
.map_err(|err| {
states.error = Some(err.to_string());
})
+3 -5
View File
@@ -1,4 +1,4 @@
use egui::plot::Points;
use egui::plot::{Line, Plot, Points};
use egui::Ui;
use rog_platform::platform::PlatformPolicy;
use rog_profiles::fan_curve_set::CurveData;
@@ -60,8 +60,6 @@ pub fn fan_graphs(
let curve = curves.curves.get_mut(&curves.show_curve).unwrap();
use egui::plot::{Line, Plot};
let mut data = &mut CurveData::default();
for c in curve {
if c.fan == curves.show_graph {
@@ -116,8 +114,8 @@ pub fn fan_graphs(
.allow_scroll(false)
.allow_drag(false)
.allow_boxed_zoom(false)
.x_axis_formatter(|d, _r| format!("{}", d))
.y_axis_formatter(|d, _r| format!("{:.*}%", 1, d))
// .x_axis_formatter(|d, _r| format!("{}", d))
// .y_axis_formatter(|d, _r| format!("{:.*}%", 1, d))
.label_formatter(|name, value| {
if !name.is_empty() {
format!("{}: {:.*}%", name, 1, value.y)
+2 -4
View File
@@ -1,7 +1,7 @@
mod anime_power;
mod app_settings;
mod aura_modes;
// mod aura_power;
mod aura_power;
mod fan_graph;
mod keyboard_layout;
mod rog_bios;
@@ -11,9 +11,7 @@ mod top_bar;
pub use anime_power::*;
pub use app_settings::*;
pub use aura_modes::*;
// pub use aura_power::*;
pub use aura_power::*;
pub use fan_graph::*;
pub use keyboard_layout::*;
pub use rog_bios::*;
pub use side_panel::*;
pub use top_bar::*;
+1 -1
View File
@@ -1,7 +1,7 @@
use crate::{Page, RogApp};
impl RogApp {
pub fn side_panel(&mut self, ctx: &egui::Context) {
pub fn side_panel(&mut self, ctx: &eframe::egui::Context) {
egui::SidePanel::left("side_panel")
.resizable(false)
.default_width(60.0) // TODO: set size to match icon buttons when done
+11 -52
View File
@@ -1,25 +1,15 @@
use egui::{vec2, Align2, FontId, Id, Sense};
use egui::{vec2, Align2, Button, FontId, Id, Rect, RichText, Sense, Vec2};
use crate::system_state::SystemState;
use crate::{RogApp, VERSION};
impl RogApp {
pub fn top_bar(
&mut self,
states: &mut SystemState,
ctx: &egui::Context,
frame: &mut eframe::Frame,
) {
pub fn top_bar(&mut self, ctx: &eframe::egui::Context, frame: &mut eframe::Frame) {
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.horizontal(|ui| {
self.dark_light_mode_buttons(ui);
egui::global_dark_light_mode_buttons(ui);
egui::warn_if_debug_build(ui);
if ui.button("Quit app").clicked() {
states.run_in_bg = false;
frame.close();
}
});
// Drag area
@@ -43,46 +33,15 @@ impl RogApp {
FontId::proportional(height - 2.0),
text_color,
);
// // Add the close button:
// let close_response = ui.put(
// egui::Rect::from_min_size(titlebar_rect.right_top(),
// egui::Vec2::splat(height)),
// egui::Button::new(egui::RichText::new("❌").size(height -
// 4.0)).frame(false), );
// if close_response.clicked() {
// frame.close();
// }
// Add the close button:
let close_response = ui.put(
Rect::from_min_size(titlebar_rect.right_top(), Vec2::splat(height)),
Button::new(RichText::new("").size(height - 4.0)).frame(false),
);
if close_response.clicked() {
frame.close();
}
});
});
}
fn dark_light_mode_buttons(&mut self, ui: &mut egui::Ui) {
let load_from_cfg = self.config.dark_mode != ui.ctx().style().visuals.dark_mode;
if ui
.add(egui::SelectableLabel::new(
!self.config.dark_mode,
"☀ Light",
))
.clicked()
|| (load_from_cfg && !self.config.dark_mode)
{
ui.ctx().set_visuals(egui::Visuals::light());
}
if ui
.add(egui::SelectableLabel::new(self.config.dark_mode, "🌙 Dark"))
.clicked()
|| (load_from_cfg && self.config.dark_mode)
{
ui.ctx().set_visuals(egui::Visuals::dark());
}
let applied_dark_mode = ui.ctx().style().visuals.dark_mode;
if self.config.dark_mode != applied_dark_mode {
self.config.dark_mode = applied_dark_mode;
let tmp = self.config.enabled_notifications.clone();
self.config.save(&tmp).ok();
}
}
}
+12 -3
View File
@@ -23,8 +23,9 @@
use std::collections::BTreeMap;
use rog_aura::advanced::UsbPackets;
use rog_aura::aura_detection::PowerZones;
use rog_aura::usb::{AuraDevice, AuraPowerDev};
use rog_aura::{AuraEffect, AuraModeNum, LedBrightness};
use rog_aura::{AuraEffect, AuraModeNum, AuraZone, LedBrightness};
use zbus::blocking::Connection;
use zbus::{dbus_proxy, Result};
@@ -74,9 +75,17 @@ trait Aura {
#[dbus_proxy(property)]
fn supported_brightness(&self) -> zbus::Result<Vec<LedBrightness>>;
/// SupportedModes property
/// SupportedBasicModes property
#[dbus_proxy(property)]
fn supported_modes(&self) -> zbus::Result<Vec<AuraModeNum>>;
fn supported_basic_modes(&self) -> zbus::Result<Vec<AuraModeNum>>;
/// SupportedBasicZones property
#[dbus_proxy(property)]
fn supported_basic_zones(&self) -> zbus::Result<Vec<AuraZone>>;
/// SupportedPowerZones property
#[dbus_proxy(property)]
fn supported_power_zones(&self) -> zbus::Result<Vec<PowerZones>>;
}
pub struct AuraProxyPerkey<'a>(AuraProxyBlocking<'a>);
+7
View File
@@ -4,6 +4,7 @@ use std::io::Write;
use std::path::PathBuf;
use log::{info, warn};
use udev::Device;
use crate::error::{PlatformError, Result};
@@ -88,4 +89,10 @@ impl HidRaw {
file.write_all(message)
.map_err(|e| PlatformError::IoPath(path.to_string_lossy().to_string(), e))
}
pub fn set_wakeup_disabled(&self) -> Result<()> {
let path = unsafe { &*(self.path.get()) };
let mut dev = Device::from_syspath(path)?;
Ok(dev.set_attribute_value("power/wakeup", "disabled")?)
}
}
+1 -1
View File
@@ -278,7 +278,7 @@ pub enum PlatformPolicy {
impl PlatformPolicy {
pub const fn next(&self) -> Self {
match self {
Self::Balanced => Self::Balanced,
Self::Balanced => Self::Performance,
Self::Performance => Self::Quiet,
Self::Quiet => Self::Balanced,
}