Compare commits

...

12 Commits

Author SHA1 Message Date
Luke D. Jones 14bf07ba79 Version bump for dep updates 2022-12-02 16:39:46 +13:00
Luke D. Jones e76d01eaed Update dependencies 2022-12-02 16:37:33 +13:00
Luke Jones 072a066f28 Merge branch 'fixed_readme_dependency_list_for_fedora' into 'main'
rust/cargo is also needed

See merge request asus-linux/asusctl!140
2022-12-01 20:11:39 +00:00
A. Binzxxxxxx 165c6f8ab3 rust/cargo is also needed 2022-12-01 20:06:28 +00:00
Luke Jones 5728a9af62 Update README.md 2022-11-22 21:54:51 +00:00
Luke Jones 17a880b2c5 Merge branch 'main' into 'main'
Fix VivoBook detection

See merge request asus-linux/asusctl!139
2022-11-20 19:48:29 +00:00
RushingAlien 6ba9b9d75d Fix VivoBook detection 2022-11-19 22:06:34 +07:00
Luke Jones eb1f6c83ce Merge branch 'fix-gitlab-ci' into 'main'
Fix GitLab CI

See merge request asus-linux/asusctl!138
2022-11-16 20:06:06 +00:00
Herohtar af653ea405 Don't install unnecessary packages 2022-11-16 12:26:14 -06:00
Herohtar bc13891cdf Install required libgtk-3-dev package 2022-11-16 12:25:29 -06:00
Luke D. Jones aad4dc909e Bump version 2022-11-16 20:33:23 +13:00
Luke D. Jones ad79adcbfa ROGCC: splatter log messages everywhere. Rename state control 2022-11-16 20:32:11 +13:00
50 changed files with 380 additions and 319 deletions
+1 -2
View File
@@ -1,7 +1,7 @@
image: rust:latest image: rust:latest
before_script: before_script:
- apt-get update -qq && apt-get install -y -qq libdbus-1-dev libclang-dev libudev-dev libfontconfig1-dev - apt-get update -qq && apt-get install -y -qq libudev-dev libgtk-3-dev
stages: stages:
- test - test
@@ -26,4 +26,3 @@ build:
variables: variables:
GIT_SUBMODULE_STRATEGY: normal GIT_SUBMODULE_STRATEGY: normal
+6 -4
View File
@@ -5,17 +5,19 @@ 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased] ## [Unreleased]
## [v4.5.1- RC2] ## [v4.5.2]
- Share pagestates with tray process in ROGCC ### Changed
- Update dependencies and bump version
## [v4.5.1- RC1] ## [v4.5.1]
### Added ### Added
- Support for FA506IE LED modes (Author: Herohtar) - Support for FA506IE LED modes (Author: Herohtar)
### Changed ### Changed
- Add a basic system tray with dGPU status and gpu mode switch actions - Add a basic system tray with dGPU status and gpu mode switch actions
- Fixup some notifications in ROGCC - Fixup some notifications in ROGCC
- Add config options for notifications for ROGCC - Add config options for notifications for ROGCC
- Share pagestates with tray process in ROGCC - Share states with tray process in ROGCC
- Share tates with tray process in ROGCC
## [v4.5.0] ## [v4.5.0]
### Added ### Added
Generated
+88 -124
View File
@@ -26,9 +26,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]] [[package]]
name = "ahash" name = "ahash"
version = "0.8.1" version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "464b3811b747f8f7ebc8849c9c728c39f6ac98a055edad93baf9eb330e3f8f9d" checksum = "bf6ccdb167abbf410dcb915cabd428929d7f6a04980b54a11f26a39f1c7f7107"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"getrandom", "getrandom",
@@ -38,9 +38,9 @@ dependencies = [
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
version = "0.7.19" version = "0.7.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@@ -83,7 +83,7 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
[[package]] [[package]]
name = "asusctl" name = "asusctl"
version = "4.5.1-RC2" version = "4.5.2"
dependencies = [ dependencies = [
"daemon", "daemon",
"gif", "gif",
@@ -112,11 +112,11 @@ dependencies = [
[[package]] [[package]]
name = "async-channel" name = "async-channel"
version = "1.7.1" version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833"
dependencies = [ dependencies = [
"concurrent-queue 1.2.4", "concurrent-queue",
"event-listener", "event-listener",
"futures-core", "futures-core",
] ]
@@ -129,7 +129,7 @@ checksum = "17adb73da160dfb475c183343c8cccd80721ea5a605d3eb57125f0a7b7a92d0b"
dependencies = [ dependencies = [
"async-lock", "async-lock",
"async-task", "async-task",
"concurrent-queue 2.0.0", "concurrent-queue",
"fastrand", "fastrand",
"futures-lite", "futures-lite",
"slab", "slab",
@@ -149,13 +149,13 @@ dependencies = [
[[package]] [[package]]
name = "async-io" name = "async-io"
version = "1.10.0" version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8121296a9f05be7f34aa4196b1747243b3b62e048bb7906f644f3fbfc490cf7" checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794"
dependencies = [ dependencies = [
"async-lock", "async-lock",
"autocfg", "autocfg",
"concurrent-queue 1.2.4", "concurrent-queue",
"futures-lite", "futures-lite",
"libc", "libc",
"log", "log",
@@ -164,7 +164,7 @@ dependencies = [
"slab", "slab",
"socket2", "socket2",
"waker-fn", "waker-fn",
"winapi", "windows-sys 0.42.0",
] ]
[[package]] [[package]]
@@ -191,20 +191,20 @@ dependencies = [
[[package]] [[package]]
name = "async-process" name = "async-process"
version = "1.5.0" version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02111fd8655a613c25069ea89fc8d9bb89331fa77486eb3bc059ee757cfa481c" checksum = "6381ead98388605d0d9ff86371043b5aa922a3905824244de40dc263a14fcba4"
dependencies = [ dependencies = [
"async-io", "async-io",
"async-lock",
"autocfg", "autocfg",
"blocking", "blocking",
"cfg-if", "cfg-if",
"event-listener", "event-listener",
"futures-lite", "futures-lite",
"libc", "libc",
"once_cell",
"signal-hook", "signal-hook",
"winapi", "windows-sys 0.42.0",
] ]
[[package]] [[package]]
@@ -226,9 +226,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524"
[[package]] [[package]]
name = "async-trait" name = "async-trait"
version = "0.1.58" version = "0.1.59"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" checksum = "31e6e93155431f3931513b243d371981bb2770112b370c82745a1d19d2f99364"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -317,16 +317,16 @@ dependencies = [
[[package]] [[package]]
name = "blocking" name = "blocking"
version = "1.2.0" version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" checksum = "3c67b173a56acffd6d2326fb7ab938ba0b00a71480e14902b2591c87bc5741e8"
dependencies = [ dependencies = [
"async-channel", "async-channel",
"async-lock",
"async-task", "async-task",
"atomic-waker", "atomic-waker",
"fastrand", "fastrand",
"futures-lite", "futures-lite",
"once_cell",
] ]
[[package]] [[package]]
@@ -363,15 +363,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
[[package]] [[package]]
name = "bytes" name = "bytes"
version = "1.2.1" version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c"
[[package]]
name = "cache-padded"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c"
[[package]] [[package]]
name = "cairo-rs" name = "cairo-rs"
@@ -399,12 +393,12 @@ dependencies = [
[[package]] [[package]]
name = "calloop" name = "calloop"
version = "0.10.2" version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "595eb0438b3c6d262395fe30e6de9a61beb57ea56290b00a07f227fe6e20cbf2" checksum = "5bcf530afb40e45e14440701e5e996d7fd139e84a912a4d83a8d6a0fb3e58663"
dependencies = [ dependencies = [
"log", "log",
"nix 0.24.2", "nix 0.25.0",
"slotmap", "slotmap",
"thiserror", "thiserror",
"vec_map", "vec_map",
@@ -412,9 +406,9 @@ dependencies = [
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.76" version = "1.0.77"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76a284da2e6fe2092f2353e51713435363112dfd60030e22add80be333fb928f" checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4"
[[package]] [[package]]
name = "cesu8" name = "cesu8"
@@ -523,15 +517,6 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "concurrent-queue"
version = "1.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c"
dependencies = [
"cache-padded",
]
[[package]] [[package]]
name = "concurrent-queue" name = "concurrent-queue"
version = "2.0.0" version = "2.0.0"
@@ -614,9 +599,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-utils" name = "crossbeam-utils"
version = "0.8.12" version = "0.8.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
] ]
@@ -662,7 +647,7 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
[[package]] [[package]]
name = "daemon" name = "daemon"
version = "4.5.1-RC2" version = "4.5.2"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"concat-idents", "concat-idents",
@@ -681,12 +666,11 @@ dependencies = [
"tokio", "tokio",
"toml", "toml",
"zbus", "zbus",
"zvariant",
] ]
[[package]] [[package]]
name = "daemon-user" name = "daemon-user"
version = "4.5.1-RC2" version = "4.5.2"
dependencies = [ dependencies = [
"dirs", "dirs",
"rog_anime", "rog_anime",
@@ -698,8 +682,6 @@ dependencies = [
"serde_json", "serde_json",
"smol", "smol",
"zbus", "zbus",
"zvariant",
"zvariant_derive",
] ]
[[package]] [[package]]
@@ -750,9 +732,9 @@ dependencies = [
[[package]] [[package]]
name = "digest" name = "digest"
version = "0.10.5" version = "0.10.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
dependencies = [ dependencies = [
"block-buffer", "block-buffer",
"crypto-common", "crypto-common",
@@ -1020,12 +1002,12 @@ dependencies = [
[[package]] [[package]]
name = "flate2" name = "flate2"
version = "1.0.24" version = "1.0.25"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841"
dependencies = [ dependencies = [
"crc32fast", "crc32fast",
"miniz_oxide 0.5.4", "miniz_oxide 0.6.2",
] ]
[[package]] [[package]]
@@ -1765,13 +1747,12 @@ dependencies = [
[[package]] [[package]]
name = "logind-zbus" name = "logind-zbus"
version = "3.0.2" version = "3.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c2bd5667a34b046e66f21ac2c016b1f4b41318423f9282b4e04f755ad947817" checksum = "214b1739f5cf1b467329c1a7b42e9b142aee6dce3f38a86cf902b5b6ac1b55b3"
dependencies = [ dependencies = [
"serde", "serde",
"zbus", "zbus",
"zvariant",
] ]
[[package]] [[package]]
@@ -1842,15 +1823,6 @@ dependencies = [
"autocfg", "autocfg",
] ]
[[package]]
name = "miniz_oxide"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34"
dependencies = [
"adler",
]
[[package]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.6.2" version = "0.6.2"
@@ -1923,9 +1895,9 @@ dependencies = [
[[package]] [[package]]
name = "ndk-sys" name = "ndk-sys"
version = "0.4.0" version = "0.4.1+23.1.7779620"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21d83ec9c63ec5bf950200a8e508bdad6659972187b625469f58ef8c08e29046" checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3"
dependencies = [ dependencies = [
"jni-sys", "jni-sys",
] ]
@@ -1984,15 +1956,13 @@ dependencies = [
[[package]] [[package]]
name = "notify-rust" name = "notify-rust"
version = "4.5.11" version = "4.6.0"
source = "git+https://github.com/flukejones/notify-rust.git#6033d06377d6d601207ae31861cda560d03a9aa8" source = "git+https://github.com/flukejones/notify-rust.git#c83082a2549932bde52a4ec449b9981fc39e9a0d"
dependencies = [ dependencies = [
"mac-notification-sys", "mac-notification-sys",
"serde", "serde",
"tauri-winrt-notification", "tauri-winrt-notification",
"zbus", "zbus",
"zvariant",
"zvariant_derive",
] ]
[[package]] [[package]]
@@ -2097,9 +2067,9 @@ dependencies = [
[[package]] [[package]]
name = "owned_ttf_parser" name = "owned_ttf_parser"
version = "0.17.0" version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4665508572151759e8d60404e20dc096ef93a99801a05ac2ac6e43bf5b4ca187" checksum = "18904d3c65493a9f0d7542293d1a7f69bfdc309a6b9ef4f46dc3e58b0577edc5"
dependencies = [ dependencies = [
"ttf-parser", "ttf-parser",
] ]
@@ -2147,9 +2117,9 @@ dependencies = [
[[package]] [[package]]
name = "parking_lot_core" name = "parking_lot_core"
version = "0.9.4" version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
@@ -2166,9 +2136,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
[[package]] [[package]]
name = "pest" name = "pest"
version = "2.4.1" version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a528564cc62c19a7acac4d81e01f39e53e25e17b934878f4c6d25cc2836e62f8" checksum = "5f400b0f7905bf702f9f3dc3df5a121b16c54e9e8012c082905fdf09a931861a"
dependencies = [ dependencies = [
"thiserror", "thiserror",
"ucd-trie", "ucd-trie",
@@ -2222,16 +2192,16 @@ dependencies = [
[[package]] [[package]]
name = "polling" name = "polling"
version = "2.4.0" version = "2.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab4609a838d88b73d8238967b60dd115cc08d38e2bbaf51ee1e4b695f89122e2" checksum = "166ca89eb77fd403230b9c156612965a81e094ec6ec3aa13663d4c8b113fa748"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"cfg-if", "cfg-if",
"libc", "libc",
"log", "log",
"wepoll-ffi", "wepoll-ffi",
"winapi", "windows-sys 0.42.0",
] ]
[[package]] [[package]]
@@ -2398,7 +2368,7 @@ dependencies = [
[[package]] [[package]]
name = "rog-control-center" name = "rog-control-center"
version = "4.5.1-RC2" version = "4.5.2"
dependencies = [ dependencies = [
"daemon", "daemon",
"dirs", "dirs",
@@ -2428,7 +2398,7 @@ dependencies = [
[[package]] [[package]]
name = "rog_anime" name = "rog_anime"
version = "4.5.1-RC2" version = "4.5.2"
dependencies = [ dependencies = [
"gif", "gif",
"glam", "glam",
@@ -2439,36 +2409,33 @@ dependencies = [
"serde_derive", "serde_derive",
"sysfs-class", "sysfs-class",
"zbus", "zbus",
"zvariant",
] ]
[[package]] [[package]]
name = "rog_aura" name = "rog_aura"
version = "4.5.1-RC2" version = "4.5.2"
dependencies = [ dependencies = [
"serde", "serde",
"serde_derive", "serde_derive",
"serde_json", "serde_json",
"toml", "toml",
"zvariant", "zbus",
] ]
[[package]] [[package]]
name = "rog_dbus" name = "rog_dbus"
version = "4.5.1-RC2" version = "4.5.2"
dependencies = [ dependencies = [
"rog_anime", "rog_anime",
"rog_aura", "rog_aura",
"rog_platform", "rog_platform",
"rog_profiles", "rog_profiles",
"zbus", "zbus",
"zbus_macros",
"zvariant",
] ]
[[package]] [[package]]
name = "rog_platform" name = "rog_platform"
version = "4.5.1-RC2" version = "4.5.2"
dependencies = [ dependencies = [
"concat-idents", "concat-idents",
"inotify", "inotify",
@@ -2479,19 +2446,17 @@ dependencies = [
"serde_derive", "serde_derive",
"sysfs-class", "sysfs-class",
"udev", "udev",
"zvariant", "zbus",
"zvariant_derive",
] ]
[[package]] [[package]]
name = "rog_profiles" name = "rog_profiles"
version = "4.5.1-RC2" version = "4.5.2"
dependencies = [ dependencies = [
"serde", "serde",
"serde_derive", "serde_derive",
"udev", "udev",
"zvariant", "zbus",
"zvariant_derive",
] ]
[[package]] [[package]]
@@ -2581,18 +2546,18 @@ dependencies = [
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.147" version = "1.0.148"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.147" version = "1.0.148"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" checksum = "a55492425aa53521babf6137309e7d34c20bbfbbfcfe2c7f3a047fd1f6b92c0c"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -2601,9 +2566,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.87" version = "1.0.89"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db"
dependencies = [ dependencies = [
"itoa", "itoa",
"ryu", "ryu",
@@ -2737,9 +2702,9 @@ dependencies = [
[[package]] [[package]]
name = "smol" name = "smol"
version = "1.2.5" version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85cf3b5351f3e783c1d79ab5fc604eeed8b8ae9abd36b166e8b87a089efd85e4" checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1"
dependencies = [ dependencies = [
"async-channel", "async-channel",
"async-executor", "async-executor",
@@ -2750,7 +2715,6 @@ dependencies = [
"async-process", "async-process",
"blocking", "blocking",
"futures-lite", "futures-lite",
"once_cell",
] ]
[[package]] [[package]]
@@ -2821,9 +2785,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.103" version = "1.0.104"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" checksum = "4ae548ec36cf198c0ef7710d3c230987c2d6d7bd98ad6edc0274462724c585ce"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -2974,9 +2938,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]] [[package]]
name = "tokio" name = "tokio"
version = "1.21.2" version = "1.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" checksum = "d76ce4a75fb488c605c54bf610f221cea8b0dafb53333c1a67e8ee199dcd2ae3"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"libc", "libc",
@@ -2990,9 +2954,9 @@ dependencies = [
[[package]] [[package]]
name = "tokio-macros" name = "tokio-macros"
version = "1.8.0" version = "1.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -3587,9 +3551,9 @@ dependencies = [
[[package]] [[package]]
name = "x11-dl" name = "x11-dl"
version = "2.20.0" version = "2.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c83627bc137605acc00bb399c7b908ef460b621fc37c953db2b09f88c449ea6" checksum = "b1536d6965a5d4e573c7ef73a2c15ebcd0b2de3347bdf526c34c297c00ac40f0"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"libc", "libc",
@@ -3635,9 +3599,9 @@ checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3"
[[package]] [[package]]
name = "zbus" name = "zbus"
version = "3.4.0" version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78a0b85c5608c27d2306d67e955b9c6e23a42d824205c85038a7afbe19c0ae22" checksum = "a25ae891bd547674b368906552115143031c16c23a0f2f4b2f5f5436ab2e6a9f"
dependencies = [ dependencies = [
"async-broadcast", "async-broadcast",
"async-channel", "async-channel",
@@ -3674,9 +3638,9 @@ dependencies = [
[[package]] [[package]]
name = "zbus_macros" name = "zbus_macros"
version = "3.4.0" version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b18018648e7e10ed856809befe7309002b87b2b12d5b282cb5040d7974b58677" checksum = "8aa37701ce7b3a43632d2b0ad9d4aef602b46be6bdd7fba3b7c5007f9f6eb2c2"
dependencies = [ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
@@ -3687,9 +3651,9 @@ dependencies = [
[[package]] [[package]]
name = "zbus_names" name = "zbus_names"
version = "2.2.0" version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41a408fd8a352695690f53906dc7fd036be924ec51ea5e05666ff42685ed0af5" checksum = "d69bb79b44e1901ed8b217e485d0f01991aec574479b68cb03415f142bc7ae67"
dependencies = [ dependencies = [
"serde", "serde",
"static_assertions", "static_assertions",
@@ -3698,9 +3662,9 @@ dependencies = [
[[package]] [[package]]
name = "zvariant" name = "zvariant"
version = "3.7.1" version = "3.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b794fb7f59af4105697b0449ba31731ee5dbb3e773a17dbdf3d36206ea1b1644" checksum = "5c817f416f05fcbc833902f1e6064b72b1778573978cfeac54731451ccc9e207"
dependencies = [ dependencies = [
"byteorder", "byteorder",
"enumflags2", "enumflags2",
@@ -3712,9 +3676,9 @@ dependencies = [
[[package]] [[package]]
name = "zvariant_derive" name = "zvariant_derive"
version = "3.7.1" version = "3.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd58d4b6c8e26d3dd2149c8c40c6613ef6451b9885ff1296d1ac86c388351a54" checksum = "fdd24fffd02794a76eb10109de463444064c88f5adb9e9d1a78488adc332bfef"
dependencies = [ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
+3 -6
View File
@@ -2,7 +2,7 @@
members = ["asusctl", "daemon", "daemon-user", "rog-platform", "rog-dbus", "rog-anime", "rog-aura", "rog-profiles", "rog-control-center"] members = ["asusctl", "daemon", "daemon-user", "rog-platform", "rog-dbus", "rog-anime", "rog-aura", "rog-profiles", "rog-control-center"]
[workspace.package] [workspace.package]
version = "4.5.1-RC2" version = "4.5.2"
[workspace.dependencies] [workspace.dependencies]
async-trait = "^0.1" async-trait = "^0.1"
@@ -11,11 +11,8 @@ concat-idents = "^1.1"
dirs = "^4.0" dirs = "^4.0"
smol = "^1.2" smol = "^1.2"
zbus = "^3.4" zbus = "^3.5"
zbus_macros = "^3.4" logind-zbus = { version = "^3.0.3" } #, default-features = false, features = ["non_blocking"] }
zvariant = "^3.7"
zvariant_derive = "^3.7"
logind-zbus = { version = "^3.0" } #, default-features = false, features = ["non_blocking"] }
serde = "^1.0" serde = "^1.0"
serde_derive = "^1.0" serde_derive = "^1.0"
+2 -2
View File
@@ -2,7 +2,7 @@
[![](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/) [![](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. **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.
`asusd` is a utility for Linux to control many aspects of various ASUS laptops `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. but can also be used with non-asus laptops with reduced features.
@@ -81,7 +81,7 @@ Requirements are rust >= 1.57 installed from rustup.io if the distro provided ve
**fedora:** **fedora:**
dnf install cmake clang-devel systemd-devel gtk3-devel dnf install cmake clang-devel systemd-devel gtk3-devel cargo
make make
sudo make install sudo make install
+1 -3
View File
@@ -27,6 +27,4 @@ rog_aura = { path = "../rog-aura" }
rog_dbus = { path = "../rog-dbus" } rog_dbus = { path = "../rog-dbus" }
rog_platform = { path = "../rog-platform" } rog_platform = { path = "../rog-platform" }
zbus.workspace = true zbus.workspace = true
zvariant.workspace = true
zvariant_derive.workspace = true
+4 -3
View File
@@ -11,9 +11,10 @@ use std::{
}, },
}; };
use std::{sync::Arc, thread::sleep, time::Instant}; use std::{sync::Arc, thread::sleep, time::Instant};
use zbus::dbus_interface; use zbus::{
use zvariant::ObjectPath; dbus_interface,
use zvariant_derive::Type; zvariant::{ObjectPath, Type},
};
use crate::user_config::ConfigLoadSave; use crate::user_config::ConfigLoadSave;
use crate::{error::Error, user_config::UserAnimeConfig}; use crate::{error::Error, user_config::UserAnimeConfig};
-1
View File
@@ -32,7 +32,6 @@ log.workspace = true
env_logger.workspace = true env_logger.workspace = true
zbus.workspace = true zbus.workspace = true
zvariant.workspace = true
logind-zbus.workspace = true logind-zbus.workspace = true
# serialisation # serialisation
+2 -2
View File
@@ -145,7 +145,7 @@ impl AnimeConfig {
.read(true) .read(true)
.write(true) .write(true)
.create(true) .create(true)
.open(&ANIME_CONFIG_PATH) .open(ANIME_CONFIG_PATH)
.unwrap_or_else(|_| { .unwrap_or_else(|_| {
panic!( panic!(
"The file {} or directory /etc/asusd/ is missing", "The file {} or directory /etc/asusd/ is missing",
@@ -249,7 +249,7 @@ impl AnimeConfig {
pub fn read(&mut self) { pub fn read(&mut self) {
let mut file = OpenOptions::new() let mut file = OpenOptions::new()
.read(true) .read(true)
.open(&ANIME_CONFIG_PATH) .open(ANIME_CONFIG_PATH)
.unwrap_or_else(|err| panic!("Error reading {}: {}", ANIME_CONFIG_PATH, err)); .unwrap_or_else(|err| panic!("Error reading {}: {}", ANIME_CONFIG_PATH, err));
let mut buf = String::new(); let mut buf = String::new();
if let Ok(l) = file.read_to_string(&mut buf) { if let Ok(l) = file.read_to_string(&mut buf) {
+2 -2
View File
@@ -192,7 +192,7 @@ impl AuraConfig {
.read(true) .read(true)
.write(true) .write(true)
.create(true) .create(true)
.open(&AURA_CONFIG_PATH) .open(AURA_CONFIG_PATH)
.unwrap_or_else(|_| { .unwrap_or_else(|_| {
panic!( panic!(
"The file {} or directory /etc/asusd/ is missing", "The file {} or directory /etc/asusd/ is missing",
@@ -264,7 +264,7 @@ impl AuraConfig {
pub fn read(&mut self) { pub fn read(&mut self) {
let mut file = OpenOptions::new() let mut file = OpenOptions::new()
.read(true) .read(true)
.open(&AURA_CONFIG_PATH) .open(AURA_CONFIG_PATH)
.unwrap_or_else(|err| panic!("Error reading {}: {}", AURA_CONFIG_PATH, err)); .unwrap_or_else(|err| panic!("Error reading {}: {}", AURA_CONFIG_PATH, err));
let mut buf = String::new(); let mut buf = String::new();
if let Ok(l) = file.read_to_string(&mut buf) { if let Ok(l) = file.read_to_string(&mut buf) {
+1 -3
View File
@@ -1,8 +1,6 @@
use async_trait::async_trait; use async_trait::async_trait;
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
use zbus::dbus_interface; use zbus::{dbus_interface, zvariant::Type, Connection};
use zbus::Connection;
use zvariant::Type;
use crate::{ use crate::{
ctrl_anime::CtrlAnime, ctrl_aura::controller::CtrlKbdLed, ctrl_platform::CtrlPlatform, ctrl_anime::CtrlAnime, ctrl_aura::controller::CtrlKbdLed, ctrl_platform::CtrlPlatform,
+1 -2
View File
@@ -25,8 +25,7 @@ use crate::error::RogError;
use async_trait::async_trait; use async_trait::async_trait;
use log::warn; use log::warn;
use logind_zbus::manager::ManagerProxy; use logind_zbus::manager::ManagerProxy;
use zbus::{export::futures_util::StreamExt, Connection, SignalContext}; use zbus::{export::futures_util::StreamExt, zvariant::ObjectPath, Connection, SignalContext};
use zvariant::ObjectPath;
/// This macro adds a function which spawns an `inotify` task on the passed in `Executor`. /// This macro adds a function which spawns an `inotify` task on the passed in `Executor`.
/// ///
+2 -2
View File
@@ -9,7 +9,7 @@ ENV{DMI_FAMILY}=="*TUF*", GOTO="asusd_start"
ENV{DMI_FAMILY}=="*ROG*", GOTO="asusd_start" ENV{DMI_FAMILY}=="*ROG*", GOTO="asusd_start"
ENV{DMI_FAMILY}=="*Zephyrus*", GOTO="asusd_start" ENV{DMI_FAMILY}=="*Zephyrus*", GOTO="asusd_start"
ENV{DMI_FAMILY}=="*Strix*", GOTO="asusd_start" ENV{DMI_FAMILY}=="*Strix*", GOTO="asusd_start"
ENV{DMI_FAMILY}=="*Vivobook*", GOTO="asusd_start" ENV{DMI_FAMILY}=="*Vivo*ook*", GOTO="asusd_start"
# No match so # No match so
GOTO="asusd_end" GOTO="asusd_end"
@@ -17,4 +17,4 @@ LABEL="asusd_start"
ACTION=="add|change", DRIVER=="asus-nb-wmi", TAG+="systemd", ENV{SYSTEMD_WANTS}="asusd.service" ACTION=="add|change", DRIVER=="asus-nb-wmi", TAG+="systemd", ENV{SYSTEMD_WANTS}="asusd.service"
ACTION=="add|remove", DRIVER=="asus-nb-wmi", TAG+="systemd", RUN+="systemctl restart asusd.service" ACTION=="add|remove", DRIVER=="asus-nb-wmi", TAG+="systemd", RUN+="systemctl restart asusd.service"
LABEL="asusd_end" LABEL="asusd_end"
+1 -2
View File
@@ -14,7 +14,7 @@ exclude = ["data"]
[features] [features]
default = ["dbus", "detect"] default = ["dbus", "detect"]
dbus = ["zvariant", "zbus"] dbus = ["zbus"]
detect = ["sysfs-class"] detect = ["sysfs-class"]
[dependencies] [dependencies]
@@ -28,7 +28,6 @@ serde_derive.workspace = true
glam.workspace = true glam.workspace = true
zvariant = { workspace = true, optional = true }
zbus = { workspace = true, optional = true } zbus = { workspace = true, optional = true }
sysfs-class = { workspace = true, optional = true } sysfs-class = { workspace = true, optional = true }
+1 -1
View File
@@ -7,7 +7,7 @@ use std::{
use log::info; use log::info;
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
#[cfg(feature = "dbus")] #[cfg(feature = "dbus")]
use zvariant::Type; use zbus::zvariant::Type;
use crate::{ use crate::{
error::{AnimeError, Result}, error::{AnimeError, Result},
+2 -2
View File
@@ -14,13 +14,13 @@ exclude = ["data"]
[features] [features]
default = ["dbus", "toml"] default = ["dbus", "toml"]
dbus = ["zvariant"] dbus = ["zbus"]
[dependencies] [dependencies]
serde.workspace = true serde.workspace = true
serde_derive.workspace = true serde_derive.workspace = true
toml = { workspace = true, optional = true } toml = { workspace = true, optional = true }
zvariant = { workspace = true, optional = true } zbus = { workspace = true, optional = true }
[dev-dependencies] [dev-dependencies]
serde_json.workspace = true serde_json.workspace = true
+1 -1
View File
@@ -7,7 +7,7 @@ pub const LED_INIT5: [u8; 6] = [0x5e, 0x05, 0x20, 0x31, 0, 0x08];
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
use std::{fmt::Display, str::FromStr}; use std::{fmt::Display, str::FromStr};
#[cfg(feature = "dbus")] #[cfg(feature = "dbus")]
use zvariant::Type; use zbus::zvariant::Type;
use crate::{error::Error, LED_MSG_LEN}; use crate::{error::Error, LED_MSG_LEN};
+1 -1
View File
@@ -1,7 +1,7 @@
use crate::keys::Key; use crate::keys::Key;
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
#[cfg(feature = "dbus")] #[cfg(feature = "dbus")]
use zvariant::Type; use zbus::zvariant::Type;
/// Represents the per-key raw USB packets /// Represents the per-key raw USB packets
pub type PerKeyRaw = Vec<Vec<u8>>; pub type PerKeyRaw = Vec<Vec<u8>>;
+1 -1
View File
@@ -1,6 +1,6 @@
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
#[cfg(feature = "dbus")] #[cfg(feature = "dbus")]
use zvariant::Type; use zbus::zvariant::Type;
/// Represents the zoned raw USB packets /// Represents the zoned raw USB packets
pub type ZonedRaw = Vec<u8>; pub type ZonedRaw = Vec<u8>;
+1 -1
View File
@@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::ops::{BitAnd, BitOr}; use std::ops::{BitAnd, BitOr};
#[cfg(feature = "dbus")] #[cfg(feature = "dbus")]
use zvariant::Type; use zbus::zvariant::Type;
pub const LED_INIT1: [u8; 2] = [0x5d, 0xb9]; pub const LED_INIT1: [u8; 2] = [0x5d, 0xb9];
pub const LED_INIT2: &str = "]ASUS Tech.Inc."; // ] == 0x5d pub const LED_INIT2: &str = "]ASUS Tech.Inc."; // ] == 0x5d
+3 -3
View File
@@ -11,12 +11,12 @@ use egui::{Button, RichText};
use rog_platform::supported::SupportedFunctions; use rog_platform::supported::SupportedFunctions;
use crate::{ use crate::{
config::Config, error::Result, page_states::PageDataStates, Page, RogDbusClientBlocking, config::Config, error::Result, system_state::SystemState, Page, RogDbusClientBlocking,
}; };
pub struct RogApp { pub struct RogApp {
pub page: Page, pub page: Page,
pub states: Arc<Mutex<PageDataStates>>, pub states: Arc<Mutex<SystemState>>,
pub supported: SupportedFunctions, pub supported: SupportedFunctions,
// TODO: can probably just open and read whenever // TODO: can probably just open and read whenever
pub config: Config, pub config: Config,
@@ -34,7 +34,7 @@ impl RogApp {
/// Called once before the first frame. /// Called once before the first frame.
pub fn new( pub fn new(
config: Config, config: Config,
states: Arc<Mutex<PageDataStates>>, states: Arc<Mutex<SystemState>>,
_cc: &eframe::CreationContext<'_>, _cc: &eframe::CreationContext<'_>,
) -> Result<Self> { ) -> Result<Self> {
let (dbus, _) = RogDbusClientBlocking::new()?; let (dbus, _) = RogDbusClientBlocking::new()?;
+9 -2
View File
@@ -1,9 +1,9 @@
use log::{error, info, warn};
use serde_derive::{Deserialize, Serialize};
use std::{ use std::{
fs::{create_dir, OpenOptions}, fs::{create_dir, OpenOptions},
io::{Read, Write}, io::{Read, Write},
}; };
use serde_derive::{Deserialize, Serialize};
//use log::{error, info, warn}; //use log::{error, info, warn};
use crate::{error::Error, notify::EnabledNotifications}; use crate::{error::Error, notify::EnabledNotifications};
@@ -34,14 +34,17 @@ impl Default for Config {
impl Config { impl Config {
pub fn load() -> Result<Config, Error> { pub fn load() -> Result<Config, Error> {
let mut path = if let Some(dir) = dirs::config_dir() { let mut path = if let Some(dir) = dirs::config_dir() {
info!("Found XDG config dir {dir:?}");
dir dir
} else { } else {
error!("Could not get XDG config dir");
return Err(Error::XdgVars); return Err(Error::XdgVars);
}; };
path.push(CFG_DIR); path.push(CFG_DIR);
if !path.exists() { if !path.exists() {
create_dir(path.clone())?; create_dir(path.clone())?;
info!("Created {path:?}");
} }
path.push(CFG_FILE_NAME); path.push(CFG_FILE_NAME);
@@ -56,11 +59,13 @@ impl Config {
if let Ok(read_len) = file.read_to_string(&mut buf) { if let Ok(read_len) = file.read_to_string(&mut buf) {
if read_len == 0 { if read_len == 0 {
warn!("Zero len read of Config file");
let default = Config::default(); let default = Config::default();
let t = toml::to_string_pretty(&default).unwrap(); let t = toml::to_string_pretty(&default).unwrap();
file.write_all(t.as_bytes())?; file.write_all(t.as_bytes())?;
return Ok(default); return Ok(default);
} else if let Ok(data) = toml::from_str::<Config>(&buf) { } else if let Ok(data) = toml::from_str::<Config>(&buf) {
info!("Loaded config file {path:?}");
return Ok(data); return Ok(data);
} }
} }
@@ -77,6 +82,7 @@ impl Config {
path.push(CFG_DIR); path.push(CFG_DIR);
if !path.exists() { if !path.exists() {
create_dir(path.clone())?; create_dir(path.clone())?;
info!("Created {path:?}");
} }
path.push(CFG_FILE_NAME); path.push(CFG_FILE_NAME);
@@ -90,6 +96,7 @@ impl Config {
self.enabled_notifications = enabled_notifications.clone(); self.enabled_notifications = enabled_notifications.clone();
let t = toml::to_string_pretty(&self).unwrap(); let t = toml::to_string_pretty(&self).unwrap();
file.write_all(t.as_bytes())?; file.write_all(t.as_bytes())?;
info!("Saved config file {path:?}");
Ok(()) Ok(())
} }
} }
+1 -1
View File
@@ -14,9 +14,9 @@ pub mod error;
#[cfg(feature = "mocking")] #[cfg(feature = "mocking")]
pub mod mocking; pub mod mocking;
pub mod notify; pub mod notify;
pub mod page_states;
pub mod pages; pub mod pages;
pub mod startup_error; pub mod startup_error;
pub mod system_state;
pub mod tray; pub mod tray;
pub mod widgets; pub mod widgets;
+11 -10
View File
@@ -1,11 +1,11 @@
use eframe::{IconData, NativeOptions}; use eframe::{IconData, NativeOptions};
use log::{error, LevelFilter}; use log::{error, info, LevelFilter};
use rog_aura::layouts::KeyLayout; use rog_aura::layouts::KeyLayout;
use rog_control_center::notify::EnabledNotifications; use rog_control_center::notify::EnabledNotifications;
use rog_control_center::tray::init_tray; use rog_control_center::tray::init_tray;
use rog_control_center::{ use rog_control_center::{
config::Config, error::Result, get_ipc_file, notify::start_notifications, on_tmp_dir_exists, config::Config, error::Result, get_ipc_file, notify::start_notifications, on_tmp_dir_exists,
page_states::PageDataStates, print_versions, startup_error::AppErrorShow, RogApp, print_versions, startup_error::AppErrorShow, system_state::SystemState, RogApp,
RogDbusClientBlocking, SHOWING_GUI, SHOW_GUI, RogDbusClientBlocking, SHOWING_GUI, SHOW_GUI,
}; };
use rog_platform::supported::SupportedFunctions; use rog_platform::supported::SupportedFunctions;
@@ -118,7 +118,7 @@ fn main() -> Result<()> {
Err(_) => on_tmp_dir_exists().unwrap(), Err(_) => on_tmp_dir_exists().unwrap(),
}; };
let states = setup_page_state_and_notifs(layout, enabled_notifications, &supported).unwrap(); let states = setup_page_state_and_notifs(layout, enabled_notifications, &supported)?;
init_tray(supported, states.clone()); init_tray(supported, states.clone());
@@ -127,7 +127,7 @@ fn main() -> Result<()> {
start_app(states.clone(), native_options.clone())?; start_app(states.clone(), native_options.clone())?;
} }
let config = Config::load().unwrap(); let config = Config::load()?;
if !config.run_in_background { if !config.run_in_background {
break; break;
} }
@@ -136,7 +136,7 @@ fn main() -> Result<()> {
let mut buf = [0u8; 4]; let mut buf = [0u8; 4];
// blocks until it is read, typically the read will happen after a second // blocks until it is read, typically the read will happen after a second
// process writes to the IPC (so there is data to actually read) // process writes to the IPC (so there is data to actually read)
if get_ipc_file().unwrap().read(&mut buf).is_ok() && buf[0] == SHOW_GUI { if get_ipc_file()?.read(&mut buf).is_ok() && buf[0] == SHOW_GUI {
start_closed = false; start_closed = false;
continue; continue;
} }
@@ -154,8 +154,8 @@ fn setup_page_state_and_notifs(
keyboard_layout: KeyLayout, keyboard_layout: KeyLayout,
enabled_notifications: Arc<Mutex<EnabledNotifications>>, enabled_notifications: Arc<Mutex<EnabledNotifications>>,
supported: &SupportedFunctions, supported: &SupportedFunctions,
) -> Result<Arc<Mutex<PageDataStates>>> { ) -> Result<Arc<Mutex<SystemState>>> {
let page_states = Arc::new(Mutex::new(PageDataStates::new( let page_states = Arc::new(Mutex::new(SystemState::new(
keyboard_layout, keyboard_layout,
enabled_notifications.clone(), enabled_notifications.clone(),
supported, supported,
@@ -166,9 +166,9 @@ fn setup_page_state_and_notifs(
Ok(page_states) Ok(page_states)
} }
fn start_app(states: Arc<Mutex<PageDataStates>>, native_options: NativeOptions) -> Result<()> { fn start_app(states: Arc<Mutex<SystemState>>, native_options: NativeOptions) -> Result<()> {
let mut ipc_file = get_ipc_file().unwrap(); let mut ipc_file = get_ipc_file()?;
ipc_file.write_all(&[SHOWING_GUI]).unwrap(); ipc_file.write_all(&[SHOWING_GUI])?;
eframe::run_native( eframe::run_native(
"ROG Control Center", "ROG Control Center",
native_options, native_options,
@@ -202,6 +202,7 @@ fn load_icon() -> IconData {
rgba = ras.as_u8_slice().to_vec(); rgba = ras.as_u8_slice().to_vec();
width = ras.width(); width = ras.width();
height = ras.height(); height = ras.height();
info!("Loaded app icon. Not actually supported in Wayland yet");
} }
} }
} else { } else {
+62 -10
View File
@@ -1,4 +1,5 @@
use crate::{config::Config, error::Result, page_states::PageDataStates}; use crate::{config::Config, error::Result, system_state::SystemState};
use log::{error, info, trace};
use notify_rust::{Hint, Notification, NotificationHandle, Urgency}; use notify_rust::{Hint, Notification, NotificationHandle, Urgency};
use rog_dbus::{ use rog_dbus::{
zbus_anime::AnimeProxy, zbus_led::LedProxy, zbus_platform::RogBiosProxy, zbus_anime::AnimeProxy, zbus_led::LedProxy, zbus_platform::RogBiosProxy,
@@ -90,14 +91,22 @@ macro_rules! recv_notif {
let page_states1 = $page_states.clone(); let page_states1 = $page_states.clone();
tokio::spawn(async move { tokio::spawn(async move {
let conn = zbus::Connection::system().await.unwrap(); let conn = zbus::Connection::system().await.map_err(|e| {
let proxy = $proxy::new(&conn).await.unwrap(); log::error!("zbus signal: {}: {e}", stringify!($signal));
e
}).unwrap();
let proxy = $proxy::new(&conn).await.map_err(|e| {
log::error!("zbus signal: {}: {e}", stringify!($signal));
e
}).unwrap();
if let Ok(mut p) = proxy.$signal().await { if let Ok(mut p) = proxy.$signal().await {
info!("Started zbus signal thread: {}", stringify!($signal));
while let Some(e) = p.next().await { while let Some(e) = p.next().await {
if let Ok(out) = e.args() { if let Ok(out) = e.args() {
if let Ok(config) = notifs_enabled1.lock() { if let Ok(config) = notifs_enabled1.lock() {
if config.all_enabled && config.$signal { if config.all_enabled && config.$signal {
if let Ok(ref mut lock) = last_notif.lock() { if let Ok(ref mut lock) = last_notif.lock() {
trace!("zbus signal {} locked last_notif", stringify!($signal));
notify!($notifier($msg, &out.$($out_arg)+()), lock); notify!($notifier($msg, &out.$($out_arg)+()), lock);
} }
} }
@@ -116,7 +125,7 @@ macro_rules! recv_notif {
type SharedHandle = Arc<Mutex<Option<NotificationHandle>>>; type SharedHandle = Arc<Mutex<Option<NotificationHandle>>>;
pub fn start_notifications( pub fn start_notifications(
page_states: Arc<Mutex<PageDataStates>>, page_states: Arc<Mutex<SystemState>>,
enabled_notifications: Arc<Mutex<EnabledNotifications>>, enabled_notifications: Arc<Mutex<EnabledNotifications>>,
) -> Result<()> { ) -> Result<()> {
let last_notification: SharedHandle = Arc::new(Mutex::new(None)); let last_notification: SharedHandle = Arc::new(Mutex::new(None));
@@ -236,9 +245,22 @@ pub fn start_notifications(
let page_states1 = page_states.clone(); let page_states1 = page_states.clone();
tokio::spawn(async move { tokio::spawn(async move {
let conn = zbus::Connection::system().await.unwrap(); let conn = zbus::Connection::system()
let proxy = AnimeProxy::new(&conn).await.unwrap(); .await
.map_err(|e| {
error!("zbus signal: receive_power_states: {e}");
e
})
.unwrap();
let proxy = AnimeProxy::new(&conn)
.await
.map_err(|e| {
error!("zbus signal: receive_power_states: {e}");
e
})
.unwrap();
if let Ok(p) = proxy.receive_power_states().await { if let Ok(p) = proxy.receive_power_states().await {
info!("Started zbus signal thread: receive_power_states");
p.for_each(|_| { p.for_each(|_| {
if let Ok(_lock) = page_states1.lock() { if let Ok(_lock) = page_states1.lock() {
// TODO: lock.anime. // TODO: lock.anime.
@@ -273,13 +295,30 @@ pub fn start_notifications(
// ); // );
tokio::spawn(async move { tokio::spawn(async move {
let conn = zbus::Connection::system().await.unwrap(); let conn = zbus::Connection::system()
let proxy = SuperProxy::new(&conn).await.unwrap(); .await
.map_err(|e| {
error!("zbus signal: receive_notify_action: {e}");
e
})
.unwrap();
let proxy = SuperProxy::new(&conn)
.await
.map_err(|e| {
error!("zbus signal: receive_notify_action: {e}");
e
})
.unwrap();
if let Ok(mut p) = proxy.receive_notify_action().await { if let Ok(mut p) = proxy.receive_notify_action().await {
info!("Started zbus signal thread: receive_notify_action");
while let Some(e) = p.next().await { while let Some(e) = p.next().await {
if let Ok(out) = e.args() { if let Ok(out) = e.args() {
let action = out.action(); let action = out.action();
do_gfx_action_notif("Gfx mode change requires", &format!("{action:?}",)) do_gfx_action_notif("Gfx mode change requires", &format!("{action:?}",))
.map_err(|e| {
error!("zbus signal: do_gfx_action_notif: {e}");
e
})
.unwrap(); .unwrap();
} }
} }
@@ -289,9 +328,22 @@ pub fn start_notifications(
let notifs_enabled1 = enabled_notifications; let notifs_enabled1 = enabled_notifications;
let last_notif = last_notification; let last_notif = last_notification;
tokio::spawn(async move { tokio::spawn(async move {
let conn = zbus::Connection::system().await.unwrap(); let conn = zbus::Connection::system()
let proxy = SuperProxy::new(&conn).await.unwrap(); .await
.map_err(|e| {
error!("zbus signal: receive_notify_gfx_status: {e}");
e
})
.unwrap();
let proxy = SuperProxy::new(&conn)
.await
.map_err(|e| {
error!("zbus signal: receive_notify_gfx_status: {e}");
e
})
.unwrap();
if let Ok(mut p) = proxy.receive_notify_gfx_status().await { if let Ok(mut p) = proxy.receive_notify_gfx_status().await {
info!("Started zbus signal thread: receive_notify_gfx_status");
while let Some(e) = p.next().await { while let Some(e) = p.next().await {
if let Ok(out) = e.args() { if let Ok(out) = e.args() {
let status = out.status; let status = out.status;
+2 -2
View File
@@ -4,13 +4,13 @@ use egui::Color32;
use rog_aura::{AuraEffect, AuraModeNum}; use rog_aura::{AuraEffect, AuraModeNum};
use crate::{ use crate::{
page_states::PageDataStates, system_state::SystemState,
widgets::{aura_modes_group, keyboard}, widgets::{aura_modes_group, keyboard},
RogApp, RogApp,
}; };
impl RogApp { impl RogApp {
pub fn aura_page(&mut self, states: &mut PageDataStates, ctx: &egui::Context) { pub fn aura_page(&mut self, states: &mut SystemState, ctx: &egui::Context) {
let Self { let Self {
supported, supported,
oscillator1, oscillator1,
@@ -1,5 +1,5 @@
use crate::{ use crate::{
page_states::{FanCurvesState, PageDataStates, ProfilesState}, system_state::{FanCurvesState, ProfilesState, SystemState},
widgets::fan_graphs, widgets::fan_graphs,
RogApp, RogDbusClientBlocking, RogApp, RogDbusClientBlocking,
}; };
@@ -8,7 +8,7 @@ use rog_platform::supported::SupportedFunctions;
use rog_profiles::Profile; use rog_profiles::Profile;
impl RogApp { impl RogApp {
pub fn fan_curve_page(&mut self, states: &mut PageDataStates, ctx: &egui::Context) { pub fn fan_curve_page(&mut self, states: &mut SystemState, ctx: &egui::Context) {
let Self { supported, .. } = self; let Self { supported, .. } = self;
egui::CentralPanel::default().show(ctx, |ui| { egui::CentralPanel::default().show(ctx, |ui| {
+2 -2
View File
@@ -1,5 +1,5 @@
use crate::{ use crate::{
page_states::PageDataStates, system_state::SystemState,
widgets::{ widgets::{
anime_power_group, app_settings, aura_power_group, platform_profile, rog_bios_group, anime_power_group, app_settings, aura_power_group, platform_profile, rog_bios_group,
}, },
@@ -7,7 +7,7 @@ use crate::{
}; };
impl RogApp { impl RogApp {
pub fn system_page(&mut self, states: &mut PageDataStates, ctx: &egui::Context) { pub fn system_page(&mut self, states: &mut SystemState, ctx: &egui::Context) {
let Self { let Self {
config, supported, .. config, supported, ..
} = self; } = self;
@@ -247,7 +247,9 @@ impl PowerState {
} }
} }
pub struct PageDataStates { /// State stored from system daemons. This is shared with: tray, zbus notifications thread
/// and the GUI app thread.
pub struct SystemState {
pub keyboard_layout: KeyLayout, pub keyboard_layout: KeyLayout,
pub enabled_notifications: Arc<Mutex<EnabledNotifications>>, pub enabled_notifications: Arc<Mutex<EnabledNotifications>>,
/// Because much of the app state here is the same as `RogBiosSupportedFunctions` /// Because much of the app state here is the same as `RogBiosSupportedFunctions`
@@ -268,7 +270,7 @@ pub struct PageDataStates {
pub gfx_dbus: GfxProxyBlocking<'static>, pub gfx_dbus: GfxProxyBlocking<'static>,
} }
impl PageDataStates { impl SystemState {
/// Creates self, including the relevant dbus connections and proixies for internal use /// Creates self, including the relevant dbus connections and proixies for internal use
pub fn new( pub fn new(
keyboard_layout: KeyLayout, keyboard_layout: KeyLayout,
@@ -301,7 +303,7 @@ impl PageDataStates {
} }
} }
impl Default for PageDataStates { impl Default for SystemState {
fn default() -> Self { fn default() -> Self {
let (asus_dbus, conn) = RogDbusClientBlocking::new().unwrap(); let (asus_dbus, conn) = RogDbusClientBlocking::new().unwrap();
let gfx_dbus = GfxProxyBlocking::new(&conn).unwrap(); let gfx_dbus = GfxProxyBlocking::new(&conn).unwrap();
+132 -29
View File
@@ -14,14 +14,14 @@ use gtk::{gio::Icon, prelude::*};
use rog_dbus::zbus_platform::RogBiosProxyBlocking; use rog_dbus::zbus_platform::RogBiosProxyBlocking;
use rog_platform::{platform::GpuMode, supported::SupportedFunctions}; use rog_platform::{platform::GpuMode, supported::SupportedFunctions};
use crate::{error::Result, get_ipc_file, page_states::PageDataStates, SHOW_GUI}; use crate::{error::Result, get_ipc_file, system_state::SystemState, SHOW_GUI};
use libappindicator::{AppIndicator, AppIndicatorStatus}; use libappindicator::{AppIndicator, AppIndicatorStatus};
use supergfxctl::{ use supergfxctl::{
pci_device::{GfxMode, GfxPower}, pci_device::{GfxMode, GfxPower},
zbus_proxy::DaemonProxyBlocking as GfxProxyBlocking, zbus_proxy::DaemonProxyBlocking as GfxProxyBlocking,
}; };
use log::trace; use log::{debug, error, info, trace};
const TRAY_APP_ICON: &str = "rog-control-center"; const TRAY_APP_ICON: &str = "rog-control-center";
const TRAY_LABEL: &str = "ROG Control Center"; const TRAY_LABEL: &str = "ROG Control Center";
@@ -86,13 +86,22 @@ pub struct ROGTray {
impl ROGTray { impl ROGTray {
pub fn new() -> Result<Self> { pub fn new() -> Result<Self> {
let conn = zbus::blocking::Connection::system().unwrap(); let conn = zbus::blocking::Connection::system().map_err(|e| {
error!("ROGTray: {e}");
e
})?;
let rog_tray = Self { let rog_tray = Self {
tray: AppIndicator::new(TRAY_LABEL, TRAY_APP_ICON), tray: AppIndicator::new(TRAY_LABEL, TRAY_APP_ICON),
menu: gtk::Menu::new(), menu: gtk::Menu::new(),
icon: TRAY_APP_ICON, icon: TRAY_APP_ICON,
bios_proxy: RogBiosProxyBlocking::new(&conn).unwrap(), bios_proxy: RogBiosProxyBlocking::new(&conn).map_err(|e| {
gfx_proxy: GfxProxyBlocking::new(&conn).unwrap(), error!("ROGTray: {e}");
e
})?,
gfx_proxy: GfxProxyBlocking::new(&conn).map_err(|e| {
error!("ROGTray: {e}");
e
})?,
}; };
Ok(rog_tray) Ok(rog_tray)
} }
@@ -126,7 +135,11 @@ impl ROGTray {
let menu = gtk::Menu::new(); let menu = gtk::Menu::new();
for item in sub_menu.0.iter() { for item in sub_menu.0.iter() {
item.set_active(item.label().unwrap() == active_label); if let Some(label) = item.label() {
item.set_active(label == active_label);
} else {
item.set_active(false);
}
item.set_no_show_all(false); item.set_no_show_all(false);
item.show_all(); item.show_all();
menu.add(item); menu.add(item);
@@ -135,7 +148,7 @@ impl ROGTray {
header_item.set_submenu(Some(&menu)); header_item.set_submenu(Some(&menu));
} }
fn add_menu_item<F>(&mut self, label: &str, cb: F) fn _add_menu_item<F>(&mut self, label: &str, cb: F)
where where
F: Fn() + Send + 'static, F: Fn() + Send + 'static,
{ {
@@ -183,60 +196,124 @@ impl ROGTray {
self.tray.set_menu(&mut self.menu); self.tray.set_menu(&mut self.menu);
} }
fn set_status(&mut self, status: AppIndicatorStatus) { fn _set_status(&mut self, status: AppIndicatorStatus) {
self.tray.set_status(status) self.tray.set_status(status)
} }
fn menu_add_base(&mut self) { fn menu_add_base(&mut self) {
self.add_icon_menu_item("Open app", "asus_notif_red", move || { self.add_icon_menu_item("Open app", "asus_notif_red", move || {
get_ipc_file().unwrap().write_all(&[SHOW_GUI]).ok(); if let Ok(mut ipc) = get_ipc_file().map_err(|e| {
error!("ROGTray: get_ipc_file: {}", e);
}) {
ipc.write_all(&[SHOW_GUI]).ok();
}
}); });
self.add_separator(); self.add_separator();
debug!("ROGTray: built base menu");
} }
fn menu_add_charge_limit(&mut self, limit: u8) { fn menu_add_charge_limit(&mut self, supported: &SupportedFunctions, limit: u8) {
self.add_inactive_label(&format!("Charge limit: {limit}")); if supported.charge_ctrl.charge_level_set {
self.add_inactive_label(&format!("Charge limit: {limit}"));
debug!("ROGTray: appended charge limit menu");
}
} }
fn menu_add_panel_od(&mut self, panel_od: bool) { fn menu_add_panel_od(&mut self, supported: &SupportedFunctions, panel_od: bool) {
let bios = self.bios_proxy.clone(); if supported.rog_bios_ctrl.panel_overdrive {
self.add_check_menu_item("Panel Overdrive", panel_od, move |this| { let bios = self.bios_proxy.clone();
bios.set_panel_od(this.is_active()).unwrap(); self.add_check_menu_item("Panel Overdrive", panel_od, move |this| {
}); bios.set_panel_od(this.is_active())
.map_err(|e| {
error!("ROGTray: set_panel_od: {e}");
e
})
.ok();
});
debug!("ROGTray: appended panel overdrive menu");
}
} }
fn menu_add_gpu(&mut self, supported: &SupportedFunctions, current_mode: GfxMode) { fn menu_add_gpu(&mut self, supported: &SupportedFunctions, current_mode: GfxMode) {
let gfx_dbus = self.gfx_proxy.clone(); let gfx_dbus = self.gfx_proxy.clone();
let mut gpu_menu = RadioGroup::new("Integrated", move |_| { let mut gpu_menu = RadioGroup::new("Integrated", move |_| {
let mode = gfx_dbus.mode().unwrap(); let mode = gfx_dbus
.mode()
.map_err(|e| {
error!("ROGTray: mode: {e}");
e
})
.unwrap_or(GfxMode::None);
if mode != GfxMode::Integrated { if mode != GfxMode::Integrated {
gfx_dbus.set_mode(&GfxMode::Integrated).unwrap(); gfx_dbus
.set_mode(&GfxMode::Integrated)
.map_err(|e| {
error!("ROGTray: srt_mode: {e}");
e
})
.ok();
} }
}); });
let gfx_dbus = self.gfx_proxy.clone(); let gfx_dbus = self.gfx_proxy.clone();
gpu_menu.add("Hybrid", move |_| { gpu_menu.add("Hybrid", move |_| {
let mode = gfx_dbus.mode().unwrap(); let mode = gfx_dbus
.mode()
.map_err(|e| {
error!("ROGTray: mode: {e}");
e
})
.unwrap_or(GfxMode::None);
if mode != GfxMode::Hybrid { if mode != GfxMode::Hybrid {
gfx_dbus.set_mode(&GfxMode::Hybrid).unwrap(); gfx_dbus
.set_mode(&GfxMode::Hybrid)
.map_err(|e| {
error!("ROGTray: set_mode: {e}");
e
})
.ok();
} }
}); });
if supported.rog_bios_ctrl.gpu_mux { if supported.rog_bios_ctrl.gpu_mux {
let gfx_dbus = self.bios_proxy.clone(); let gfx_dbus = self.bios_proxy.clone();
gpu_menu.add("Ultimate (Reboot required)", move |_| { gpu_menu.add("Ultimate (Reboot required)", move |_| {
let mode = gfx_dbus.gpu_mux_mode().unwrap(); let mode = gfx_dbus
.gpu_mux_mode()
.map_err(|e| {
error!("ROGTray: mode: {e}");
e
})
.unwrap_or(GpuMode::Error);
if mode != GpuMode::Discrete { if mode != GpuMode::Discrete {
gfx_dbus.set_gpu_mux_mode(GpuMode::Discrete).unwrap(); gfx_dbus
.set_gpu_mux_mode(GpuMode::Discrete)
.map_err(|e| {
error!("ROGTray: set_mode: {e}");
e
})
.ok();
} }
}); });
} }
if supported.rog_bios_ctrl.egpu_enable { if supported.rog_bios_ctrl.egpu_enable {
let gfx_dbus = self.gfx_proxy.clone(); let gfx_dbus = self.gfx_proxy.clone();
gpu_menu.add("eGPU", move |_| { gpu_menu.add("eGPU", move |_| {
let mode = gfx_dbus.mode().unwrap(); let mode = gfx_dbus
.mode()
.map_err(|e| {
error!("ROGTray: mode: {e}");
e
})
.unwrap_or(GfxMode::None);
if mode != GfxMode::Egpu { if mode != GfxMode::Egpu {
gfx_dbus.set_mode(&GfxMode::Egpu).unwrap(); gfx_dbus
.set_mode(&GfxMode::Egpu)
.map_err(|e| {
error!("ROGTray: set_mode: {e}");
e
})
.ok();
} }
}); });
} }
@@ -250,10 +327,13 @@ impl ROGTray {
active.as_str(), active.as_str(),
gpu_menu, gpu_menu,
); );
debug!("ROGTray: appended gpu menu");
} }
fn menu_clear(&mut self) { fn menu_clear(&mut self) {
self.menu = gtk::Menu::new(); self.menu = gtk::Menu::new();
debug!("ROGTray: cleared self");
} }
/// Reset GTK menu to internal state, this can be called after clearing and rebuilding the menu too. /// Reset GTK menu to internal state, this can be called after clearing and rebuilding the menu too.
@@ -272,8 +352,8 @@ impl ROGTray {
) { ) {
self.menu_clear(); self.menu_clear();
self.menu_add_base(); self.menu_add_base();
self.menu_add_charge_limit(charge_limit); self.menu_add_charge_limit(supported, charge_limit);
self.menu_add_panel_od(panel_od); self.menu_add_panel_od(supported, panel_od);
self.menu_add_gpu(supported, current_gfx_mode); self.menu_add_gpu(supported, current_gfx_mode);
self.menu_update(); self.menu_update();
} }
@@ -281,17 +361,39 @@ impl ROGTray {
pub fn init_tray( pub fn init_tray(
supported: SupportedFunctions, supported: SupportedFunctions,
states: Arc<Mutex<PageDataStates>>, states: Arc<Mutex<SystemState>>,
) -> Receiver<TrayToApp> { ) -> Receiver<TrayToApp> {
let (send, recv) = channel(); let (send, recv) = channel();
let _send = Arc::new(Mutex::new(send)); let _send = Arc::new(Mutex::new(send));
std::thread::spawn(move || { std::thread::spawn(move || {
gtk::init().unwrap(); // Make this the main thread for gtk if gtk::init()
.map_err(|e| {
error!("ROGTray: gtk init {e}");
e
})
.is_err()
{
return;
} // Make this the main thread for gtk
debug!("init_tray gtk");
let mut tray = ROGTray::new().unwrap(); let mut tray = match ROGTray::new() {
Ok(t) => {
info!("init_tray: built menus");
t
}
Err(e) => {
error!("ROGTray: tray init {e}");
if let Ok(mut states) = states.lock() {
states.error = Some(format!("Could not start tray: {e}"));
}
return;
}
};
tray.rebuild_and_update(&supported, GfxMode::Hybrid, 100, false); tray.rebuild_and_update(&supported, GfxMode::Hybrid, 100, false);
tray.set_icon(TRAY_APP_ICON); tray.set_icon(TRAY_APP_ICON);
info!("Started ROGTray");
loop { loop {
if let Ok(mut lock) = states.lock() { if let Ok(mut lock) = states.lock() {
@@ -303,6 +405,7 @@ pub fn init_tray(
lock.bios.panel_overdrive, lock.bios.panel_overdrive,
); );
lock.tray_should_update = false; lock.tray_should_update = false;
debug!("ROGTray: rebuilt menus due to state change");
match lock.gfx_state.power_status { match lock.gfx_state.power_status {
GfxPower::Active => tray.set_icon("asus_notif_red"), GfxPower::Active => tray.set_icon("asus_notif_red"),
@@ -1,13 +1,9 @@
use egui::{RichText, Ui}; use egui::{RichText, Ui};
use rog_platform::supported::SupportedFunctions; use rog_platform::supported::SupportedFunctions;
use crate::page_states::PageDataStates; use crate::system_state::SystemState;
pub fn anime_power_group( pub fn anime_power_group(_supported: &SupportedFunctions, states: &mut SystemState, ui: &mut Ui) {
_supported: &SupportedFunctions,
states: &mut PageDataStates,
ui: &mut Ui,
) {
ui.heading("AniMe Matrix Settings"); ui.heading("AniMe Matrix Settings");
ui.label("Options are incomplete. Awake + Boot should work"); ui.label("Options are incomplete. Awake + Boot should work");
@@ -1,8 +1,8 @@
use egui::Ui; use egui::Ui;
use crate::{config::Config, page_states::PageDataStates}; use crate::{config::Config, system_state::SystemState};
pub fn app_settings(config: &mut Config, states: &mut PageDataStates, ui: &mut Ui) { pub fn app_settings(config: &mut Config, states: &mut SystemState, ui: &mut Ui) {
ui.heading("ROG GUI Settings"); ui.heading("ROG GUI Settings");
// ui.label("Options are incomplete. Awake + Boot should work"); // ui.label("Options are incomplete. Awake + Boot should work");
+2 -2
View File
@@ -7,11 +7,11 @@ use egui::{RichText, Ui};
use rog_aura::{AuraEffect, AuraModeNum, AuraZone, Colour, Speed}; use rog_aura::{AuraEffect, AuraModeNum, AuraZone, Colour, Speed};
use rog_platform::supported::SupportedFunctions; use rog_platform::supported::SupportedFunctions;
use crate::page_states::{AuraState, PageDataStates}; use crate::system_state::{AuraState, SystemState};
pub fn aura_modes_group( pub fn aura_modes_group(
supported: &SupportedFunctions, supported: &SupportedFunctions,
states: &mut PageDataStates, states: &mut SystemState,
freq: &mut Arc<AtomicU8>, freq: &mut Arc<AtomicU8>,
ui: &mut Ui, ui: &mut Ui,
) { ) {
+4 -4
View File
@@ -5,9 +5,9 @@ use rog_aura::{
}; };
use rog_platform::supported::SupportedFunctions; use rog_platform::supported::SupportedFunctions;
use crate::page_states::PageDataStates; use crate::system_state::SystemState;
pub fn aura_power_group(supported: &SupportedFunctions, states: &mut PageDataStates, ui: &mut Ui) { pub fn aura_power_group(supported: &SupportedFunctions, states: &mut SystemState, ui: &mut Ui) {
ui.heading("LED settings"); ui.heading("LED settings");
match supported.keyboard_led.prod_id { match supported.keyboard_led.prod_id {
@@ -20,7 +20,7 @@ pub fn aura_power_group(supported: &SupportedFunctions, states: &mut PageDataSta
} }
} }
fn aura_power1(supported: &SupportedFunctions, states: &mut PageDataStates, ui: &mut Ui) { fn aura_power1(supported: &SupportedFunctions, states: &mut SystemState, ui: &mut Ui) {
let enabled_states = &mut states.aura.enabled; let enabled_states = &mut states.aura.enabled;
let mut boot = enabled_states.x1866.contains(&AuraDev1866::Boot); let mut boot = enabled_states.x1866.contains(&AuraDev1866::Boot);
let mut sleep = enabled_states.x1866.contains(&AuraDev1866::Sleep); let mut sleep = enabled_states.x1866.contains(&AuraDev1866::Sleep);
@@ -201,7 +201,7 @@ fn aura_power1(supported: &SupportedFunctions, states: &mut PageDataStates, ui:
} }
} }
fn aura_power2(supported: &SupportedFunctions, states: &mut PageDataStates, ui: &mut Ui) { fn aura_power2(supported: &SupportedFunctions, states: &mut SystemState, ui: &mut Ui) {
let enabled_states = &mut states.aura.enabled; let enabled_states = &mut states.aura.enabled;
let has_logo = supported let has_logo = supported
.keyboard_led .keyboard_led
+1 -1
View File
@@ -3,7 +3,7 @@ use rog_platform::supported::SupportedFunctions;
use rog_profiles::{FanCurvePU, Profile}; use rog_profiles::{FanCurvePU, Profile};
use crate::{ use crate::{
page_states::{FanCurvesState, ProfilesState}, system_state::{FanCurvesState, ProfilesState},
RogDbusClientBlocking, RogDbusClientBlocking,
}; };
@@ -1,7 +1,7 @@
use egui::{Align, Color32, Vec2}; use egui::{Align, Color32, Vec2};
use rog_aura::{keys::KeyShape, layouts::KeyLayout, AuraModeNum}; use rog_aura::{keys::KeyShape, layouts::KeyLayout, AuraModeNum};
use crate::page_states::AuraState; use crate::system_state::AuraState;
pub fn keyboard( pub fn keyboard(
ui: &mut egui::Ui, ui: &mut egui::Ui,
+3 -3
View File
@@ -1,9 +1,9 @@
use crate::page_states::PageDataStates; use crate::system_state::SystemState;
use egui::Ui; use egui::Ui;
use rog_platform::{platform::GpuMode, supported::SupportedFunctions}; use rog_platform::{platform::GpuMode, supported::SupportedFunctions};
use rog_profiles::Profile; use rog_profiles::Profile;
pub fn platform_profile(states: &mut PageDataStates, ui: &mut Ui) { pub fn platform_profile(states: &mut SystemState, ui: &mut Ui) {
ui.heading("Platform profile"); ui.heading("Platform profile");
let mut changed = false; let mut changed = false;
@@ -35,7 +35,7 @@ pub fn platform_profile(states: &mut PageDataStates, ui: &mut Ui) {
}; };
} }
pub fn rog_bios_group(supported: &SupportedFunctions, states: &mut PageDataStates, ui: &mut Ui) { pub fn rog_bios_group(supported: &SupportedFunctions, states: &mut SystemState, ui: &mut Ui) {
ui.heading("Bios options"); ui.heading("Bios options");
let slider = egui::Slider::new(&mut states.power_state.charge_limit, 20..=100) let slider = egui::Slider::new(&mut states.power_state.charge_limit, 20..=100)
-2
View File
@@ -15,5 +15,3 @@ rog_aura = { path = "../rog-aura" }
rog_profiles = { path = "../rog-profiles" } rog_profiles = { path = "../rog-profiles" }
rog_platform = { path = "../rog-platform" } rog_platform = { path = "../rog-platform" }
zbus.workspace = true zbus.workspace = true
zbus_macros.workspace = true
zvariant.workspace = true
+1 -8
View File
@@ -1,5 +1,5 @@
use rog_anime::{AnimeDataBuffer, AnimePowerStates}; use rog_anime::{AnimeDataBuffer, AnimePowerStates};
use zbus_macros::dbus_proxy; use zbus::dbus_proxy;
#[dbus_proxy( #[dbus_proxy(
interface = "org.asuslinux.Daemon", interface = "org.asuslinux.Daemon",
@@ -7,33 +7,26 @@ use zbus_macros::dbus_proxy;
)] )]
trait Anime { trait Anime {
/// Set whether the AniMe will show boot, suspend, or off animations /// Set whether the AniMe will show boot, suspend, or off animations
#[inline]
fn set_boot_on_off(&self, status: bool) -> zbus::Result<()>; fn set_boot_on_off(&self, status: bool) -> zbus::Result<()>;
/// Set the global AniMe brightness /// Set the global AniMe brightness
#[inline]
fn set_brightness(&self, bright: f32) -> zbus::Result<()>; fn set_brightness(&self, bright: f32) -> zbus::Result<()>;
/// Set whether the AniMe is displaying images/data /// Set whether the AniMe is displaying images/data
#[inline]
fn set_on_off(&self, status: bool) -> zbus::Result<()>; fn set_on_off(&self, status: bool) -> zbus::Result<()>;
/// Writes a data stream of length. Will force system thread to exit until it is restarted /// Writes a data stream of length. Will force system thread to exit until it is restarted
#[inline]
fn write(&self, input: AnimeDataBuffer) -> zbus::Result<()>; fn write(&self, input: AnimeDataBuffer) -> zbus::Result<()>;
/// Get status of if the AniMe LEDs are on /// Get status of if the AniMe LEDs are on
#[inline]
#[dbus_proxy(property)] #[dbus_proxy(property)]
fn awake_enabled(&self) -> zbus::Result<bool>; fn awake_enabled(&self) -> zbus::Result<bool>;
/// Get the status of if factory system-status animations are enabled /// Get the status of if factory system-status animations are enabled
#[inline]
#[dbus_proxy(property)] #[dbus_proxy(property)]
fn boot_enabled(&self) -> zbus::Result<bool>; fn boot_enabled(&self) -> zbus::Result<bool>;
/// Notify listeners of the status of AniMe LED power and factory system-status animations /// Notify listeners of the status of AniMe LED power and factory system-status animations
#[inline]
#[dbus_proxy(signal)] #[dbus_proxy(signal)]
fn power_states(&self, data: AnimePowerStates) -> zbus::Result<()>; fn power_states(&self, data: AnimePowerStates) -> zbus::Result<()>;
} }
+1 -15
View File
@@ -21,8 +21,8 @@
use std::collections::BTreeMap; use std::collections::BTreeMap;
use zbus::dbus_proxy;
use zbus::{blocking::Connection, Result}; use zbus::{blocking::Connection, Result};
use zbus_macros::dbus_proxy;
use rog_aura::{usb::AuraPowerDev, AuraEffect, AuraModeNum, LedBrightness, PerKeyRaw}; use rog_aura::{usb::AuraPowerDev, AuraEffect, AuraModeNum, LedBrightness, PerKeyRaw};
@@ -34,60 +34,46 @@ const BLOCKING_TIME: u64 = 40; // 100ms = 10 FPS, max 50ms = 20 FPS, 40ms = 25 F
)] )]
trait Led { trait Led {
/// NextLedMode method /// NextLedMode method
#[inline]
fn next_led_mode(&self) -> zbus::Result<()>; fn next_led_mode(&self) -> zbus::Result<()>;
/// PrevLedMode method /// PrevLedMode method
#[inline]
fn prev_led_mode(&self) -> zbus::Result<()>; fn prev_led_mode(&self) -> zbus::Result<()>;
/// Toggle to next led brightness /// Toggle to next led brightness
#[inline]
fn next_led_brightness(&self) -> zbus::Result<()>; fn next_led_brightness(&self) -> zbus::Result<()>;
/// Toggle to previous led brightness /// Toggle to previous led brightness
#[inline]
fn prev_led_brightness(&self) -> zbus::Result<()>; fn prev_led_brightness(&self) -> zbus::Result<()>;
/// SetBrightness method /// SetBrightness method
#[inline]
fn set_brightness(&self, brightness: LedBrightness) -> zbus::Result<()>; fn set_brightness(&self, brightness: LedBrightness) -> zbus::Result<()>;
/// SetLedMode method /// SetLedMode method
#[inline]
fn set_led_mode(&self, effect: &AuraEffect) -> zbus::Result<()>; fn set_led_mode(&self, effect: &AuraEffect) -> zbus::Result<()>;
#[inline]
fn set_leds_power(&self, options: AuraPowerDev, enabled: bool) -> zbus::Result<()>; fn set_leds_power(&self, options: AuraPowerDev, enabled: bool) -> zbus::Result<()>;
#[inline]
fn per_key_raw(&self, data: PerKeyRaw) -> zbus::fdo::Result<()>; fn per_key_raw(&self, data: PerKeyRaw) -> zbus::fdo::Result<()>;
/// NotifyLed signal /// NotifyLed signal
#[inline]
#[dbus_proxy(signal)] #[dbus_proxy(signal)]
fn notify_led(&self, data: AuraEffect) -> zbus::Result<()>; fn notify_led(&self, data: AuraEffect) -> zbus::Result<()>;
#[dbus_proxy(signal)] #[dbus_proxy(signal)]
#[inline]
fn notify_power_states(&self, data: AuraPowerDev) -> zbus::Result<()>; fn notify_power_states(&self, data: AuraPowerDev) -> zbus::Result<()>;
/// LedBrightness property /// LedBrightness property
#[inline]
#[dbus_proxy(property)] #[dbus_proxy(property)]
fn led_brightness(&self) -> zbus::Result<i16>; fn led_brightness(&self) -> zbus::Result<i16>;
/// LedMode property /// LedMode property
#[inline]
fn led_mode(&self) -> zbus::Result<AuraModeNum>; fn led_mode(&self) -> zbus::Result<AuraModeNum>;
/// LedModes property /// LedModes property
#[inline]
fn led_modes(&self) -> zbus::Result<BTreeMap<AuraModeNum, AuraEffect>>; fn led_modes(&self) -> zbus::Result<BTreeMap<AuraModeNum, AuraEffect>>;
// As property doesn't work for AuraPowerDev (complexity of serialization?) // As property doesn't work for AuraPowerDev (complexity of serialization?)
// #[dbus_proxy(property)] // #[dbus_proxy(property)]
#[inline]
fn leds_enabled(&self) -> zbus::Result<AuraPowerDev>; fn leds_enabled(&self) -> zbus::Result<AuraPowerDev>;
} }
+1 -15
View File
@@ -20,7 +20,7 @@
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces. //! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
use rog_platform::platform::GpuMode; use rog_platform::platform::GpuMode;
use zbus_macros::dbus_proxy; use zbus::dbus_proxy;
#[dbus_proxy( #[dbus_proxy(
interface = "org.asuslinux.Daemon", interface = "org.asuslinux.Daemon",
@@ -28,62 +28,48 @@ use zbus_macros::dbus_proxy;
)] )]
trait RogBios { trait RogBios {
/// DgpuDisable method /// DgpuDisable method
#[inline]
fn dgpu_disable(&self) -> zbus::Result<bool>; fn dgpu_disable(&self) -> zbus::Result<bool>;
/// EgpuEnable method /// EgpuEnable method
#[inline]
fn egpu_enable(&self) -> zbus::Result<bool>; fn egpu_enable(&self) -> zbus::Result<bool>;
/// GpuMuxMode method /// GpuMuxMode method
#[inline]
fn gpu_mux_mode(&self) -> zbus::Result<GpuMode>; fn gpu_mux_mode(&self) -> zbus::Result<GpuMode>;
/// PanelOd method /// PanelOd method
#[inline]
fn panel_od(&self) -> zbus::Result<bool>; fn panel_od(&self) -> zbus::Result<bool>;
/// PostBootSound method /// PostBootSound method
#[inline]
fn post_boot_sound(&self) -> zbus::Result<i16>; fn post_boot_sound(&self) -> zbus::Result<i16>;
/// SetDgpuDisable method /// SetDgpuDisable method
#[inline]
fn set_dgpu_disable(&self, disable: bool) -> zbus::Result<()>; fn set_dgpu_disable(&self, disable: bool) -> zbus::Result<()>;
/// SetEgpuEnable method /// SetEgpuEnable method
#[inline]
fn set_egpu_enable(&self, enable: bool) -> zbus::Result<()>; fn set_egpu_enable(&self, enable: bool) -> zbus::Result<()>;
/// SetGpuMuxMode method /// SetGpuMuxMode method
#[inline]
fn set_gpu_mux_mode(&self, mode: GpuMode) -> zbus::Result<()>; fn set_gpu_mux_mode(&self, mode: GpuMode) -> zbus::Result<()>;
/// SetPanelOd method /// SetPanelOd method
#[inline]
fn set_panel_od(&self, overdrive: bool) -> zbus::Result<()>; fn set_panel_od(&self, overdrive: bool) -> zbus::Result<()>;
/// SetPostBootSound method /// SetPostBootSound method
#[inline]
fn set_post_boot_sound(&self, on: bool) -> zbus::Result<()>; fn set_post_boot_sound(&self, on: bool) -> zbus::Result<()>;
/// NotifyDgpuDisable signal /// NotifyDgpuDisable signal
#[inline]
#[dbus_proxy(signal)] #[dbus_proxy(signal)]
fn notify_dgpu_disable(&self, disable: bool) -> zbus::Result<()>; fn notify_dgpu_disable(&self, disable: bool) -> zbus::Result<()>;
/// NotifyEgpuEnable signal /// NotifyEgpuEnable signal
#[inline]
#[dbus_proxy(signal)] #[dbus_proxy(signal)]
fn notify_egpu_enable(&self, enable: bool) -> zbus::Result<()>; fn notify_egpu_enable(&self, enable: bool) -> zbus::Result<()>;
/// NotifyGpuMuxMode signal /// NotifyGpuMuxMode signal
#[inline]
#[dbus_proxy(signal)] #[dbus_proxy(signal)]
fn notify_gpu_mux_mode(&self, mode: GpuMode) -> zbus::Result<()>; fn notify_gpu_mux_mode(&self, mode: GpuMode) -> zbus::Result<()>;
/// NotifyPanelOd signal /// NotifyPanelOd signal
#[inline]
#[dbus_proxy(signal)] #[dbus_proxy(signal)]
fn notify_panel_od(&self, overdrive: bool) -> zbus::Result<()>; fn notify_panel_od(&self, overdrive: bool) -> zbus::Result<()>;
+1 -6
View File
@@ -19,7 +19,7 @@
//! //!
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces. //! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
use zbus_macros::dbus_proxy; use zbus::dbus_proxy;
#[dbus_proxy( #[dbus_proxy(
interface = "org.asuslinux.Daemon", interface = "org.asuslinux.Daemon",
@@ -27,24 +27,19 @@ use zbus_macros::dbus_proxy;
)] )]
trait Power { trait Power {
/// charge_control_end_threshold method /// charge_control_end_threshold method
#[inline]
fn charge_control_end_threshold(&self) -> zbus::Result<u8>; fn charge_control_end_threshold(&self) -> zbus::Result<u8>;
/// MainsOnline method /// MainsOnline method
#[inline]
fn mains_online(&self) -> zbus::Result<bool>; fn mains_online(&self) -> zbus::Result<bool>;
/// set_charge_control_end_threshold method /// set_charge_control_end_threshold method
#[inline]
fn set_charge_control_end_threshold(&self, limit: u8) -> zbus::Result<()>; fn set_charge_control_end_threshold(&self, limit: u8) -> zbus::Result<()>;
/// NotifyCharge signal /// NotifyCharge signal
#[inline]
#[dbus_proxy(signal)] #[dbus_proxy(signal)]
fn notify_charge_control_end_threshold(&self, limit: u8) -> zbus::Result<u8>; fn notify_charge_control_end_threshold(&self, limit: u8) -> zbus::Result<u8>;
/// NotifyMainsOnline signal /// NotifyMainsOnline signal
#[inline]
#[dbus_proxy(signal)] #[dbus_proxy(signal)]
fn notify_mains_online(&self, on: bool) -> zbus::Result<()>; fn notify_mains_online(&self, on: bool) -> zbus::Result<()>;
} }
+1 -12
View File
@@ -23,7 +23,7 @@ use rog_profiles::{
fan_curve_set::{CurveData, FanCurveSet}, fan_curve_set::{CurveData, FanCurveSet},
Profile, Profile,
}; };
use zbus_macros::dbus_proxy; use zbus::dbus_proxy;
#[dbus_proxy( #[dbus_proxy(
interface = "org.asuslinux.Daemon", interface = "org.asuslinux.Daemon",
@@ -31,55 +31,44 @@ use zbus_macros::dbus_proxy;
)] )]
trait Profile { trait Profile {
/// Get the fan-curve data for the currently active Profile /// Get the fan-curve data for the currently active Profile
#[inline]
fn fan_curve_data(&self, profile: Profile) -> zbus::Result<FanCurveSet>; fn fan_curve_data(&self, profile: Profile) -> zbus::Result<FanCurveSet>;
/// Fetch the active profile name /// Fetch the active profile name
#[inline]
fn active_profile(&self) -> zbus::Result<Profile>; fn active_profile(&self) -> zbus::Result<Profile>;
/// Get a list of profiles that have fan-curves enabled. /// Get a list of profiles that have fan-curves enabled.
#[inline]
fn enabled_fan_profiles(&self) -> zbus::Result<Vec<Profile>>; fn enabled_fan_profiles(&self) -> zbus::Result<Vec<Profile>>;
/// Toggle to next platform_profile. Names provided by `Profiles`. /// Toggle to next platform_profile. Names provided by `Profiles`.
/// If fan-curves are supported will also activate a fan curve for profile. /// If fan-curves are supported will also activate a fan curve for profile.
#[inline]
fn next_profile(&self) -> zbus::Result<()>; fn next_profile(&self) -> zbus::Result<()>;
/// Fetch profile names /// Fetch profile names
#[inline]
fn profiles(&self) -> zbus::Result<Vec<Profile>>; fn profiles(&self) -> zbus::Result<Vec<Profile>>;
/// Set this platform_profile name as active /// Set this platform_profile name as active
#[inline]
fn set_active_profile(&self, profile: Profile) -> zbus::Result<()>; fn set_active_profile(&self, profile: Profile) -> zbus::Result<()>;
/// Set a profile fan curve enabled status. Will also activate a fan curve. /// Set a profile fan curve enabled status. Will also activate a fan curve.
#[inline]
fn set_fan_curve_enabled(&self, profile: Profile, enabled: bool) -> zbus::Result<()>; fn set_fan_curve_enabled(&self, profile: Profile, enabled: bool) -> zbus::Result<()>;
/// Set the fan curve for the specified profile, or the profile the user is /// Set the fan curve for the specified profile, or the profile the user is
/// currently in if profile == None. Will also activate the fan curve. /// currently in if profile == None. Will also activate the fan curve.
#[inline]
fn set_fan_curve(&self, profile: Profile, curve: CurveData) -> zbus::Result<()>; fn set_fan_curve(&self, profile: Profile, curve: CurveData) -> zbus::Result<()>;
/// Reset the stored (self) and device curve to the defaults of the platform. /// Reset the stored (self) and device curve to the defaults of the platform.
/// ///
/// Each platform_profile has a different default and the defualt can be read /// Each platform_profile has a different default and the defualt can be read
/// only for the currently active profile. /// only for the currently active profile.
#[inline]
fn set_active_curve_to_defaults(&self) -> zbus::Result<()>; fn set_active_curve_to_defaults(&self) -> zbus::Result<()>;
/// Reset the stored (self) and device curve to the defaults of the platform. /// Reset the stored (self) and device curve to the defaults of the platform.
/// ///
/// Each platform_profile has a different default and the defualt can be read /// Each platform_profile has a different default and the defualt can be read
/// only for the currently active profile. /// only for the currently active profile.
#[inline]
fn reset_profile_curves(&self, profile: Profile) -> zbus::fdo::Result<()>; fn reset_profile_curves(&self, profile: Profile) -> zbus::fdo::Result<()>;
/// NotifyProfile signal /// NotifyProfile signal
#[inline]
#[dbus_proxy(signal)] #[dbus_proxy(signal)]
async fn notify_profile(&self, profile: Profile) -> zbus::Result<Profile>; async fn notify_profile(&self, profile: Profile) -> zbus::Result<Profile>;
} }
+1 -2
View File
@@ -20,7 +20,7 @@
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces. //! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
use rog_platform::supported::SupportedFunctions; use rog_platform::supported::SupportedFunctions;
use zbus_macros::dbus_proxy; use zbus::dbus_proxy;
#[dbus_proxy( #[dbus_proxy(
interface = "org.asuslinux.Daemon", interface = "org.asuslinux.Daemon",
@@ -28,6 +28,5 @@ use zbus_macros::dbus_proxy;
)] )]
trait Supported { trait Supported {
/// SupportedFunctions method /// SupportedFunctions method
#[inline]
fn supported_functions(&self) -> zbus::Result<SupportedFunctions>; fn supported_functions(&self) -> zbus::Result<SupportedFunctions>;
} }
+1 -2
View File
@@ -8,8 +8,7 @@ log.workspace = true
rog_aura = { path = "../rog-aura" } rog_aura = { path = "../rog-aura" }
serde.workspace = true serde.workspace = true
serde_derive.workspace = true serde_derive.workspace = true
zvariant.workspace = true zbus.workspace = true
zvariant_derive.workspace = true
sysfs-class.workspace = true sysfs-class.workspace = true
concat-idents.workspace = true concat-idents.workspace = true
udev.workspace = true udev.workspace = true
+1 -1
View File
@@ -2,7 +2,7 @@ use std::{fmt::Display, path::PathBuf, str::FromStr};
use log::{info, warn}; use log::{info, warn};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use zvariant::Type; use zbus::zvariant::Type;
use crate::{ use crate::{
attr_bool, attr_u8, attr_bool, attr_u8,
+1 -1
View File
@@ -1,7 +1,7 @@
use rog_aura::{usb::AuraDevice, AuraModeNum, AuraZone}; use rog_aura::{usb::AuraDevice, AuraModeNum, AuraZone};
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
use std::fmt; use std::fmt;
use zvariant_derive::Type; use zbus::zvariant::Type;
#[derive(Serialize, Deserialize, Type, Debug, Default, Clone)] #[derive(Serialize, Deserialize, Type, Debug, Default, Clone)]
pub struct SupportedFunctions { pub struct SupportedFunctions {
+2 -3
View File
@@ -6,12 +6,11 @@ edition = "2021"
[features] [features]
default = ["dbus"] default = ["dbus"]
dbus = ["zvariant", "zvariant_derive"] dbus = ["zbus"]
[dependencies] [dependencies]
udev.workspace = true udev.workspace = true
serde.workspace = true serde.workspace = true
serde_derive.workspace = true serde_derive.workspace = true
zvariant = { workspace = true, optional = true } zbus = { workspace = true, optional = true }
zvariant_derive = { workspace = true, optional = true }
+1 -1
View File
@@ -2,7 +2,7 @@ use serde_derive::{Deserialize, Serialize};
use udev::Device; use udev::Device;
#[cfg(feature = "dbus")] #[cfg(feature = "dbus")]
use zvariant_derive::Type; use zbus::zvariant::Type;
use crate::{error::ProfileError, FanCurvePU}; use crate::{error::ProfileError, FanCurvePU};
+3 -3
View File
@@ -14,7 +14,7 @@ use serde_derive::{Deserialize, Serialize};
use udev::Device; use udev::Device;
#[cfg(feature = "dbus")] #[cfg(feature = "dbus")]
use zvariant_derive::Type; use zbus::zvariant::Type;
pub const PLATFORM_PROFILE: &str = "/sys/firmware/acpi/platform_profile"; pub const PLATFORM_PROFILE: &str = "/sys/firmware/acpi/platform_profile";
pub const PLATFORM_PROFILES: &str = "/sys/firmware/acpi/platform_profile_choices"; pub const PLATFORM_PROFILES: &str = "/sys/firmware/acpi/platform_profile_choices";
@@ -52,7 +52,7 @@ impl Profile {
} }
pub fn get_active_profile() -> Result<Profile, ProfileError> { pub fn get_active_profile() -> Result<Profile, ProfileError> {
let mut file = OpenOptions::new().read(true).open(&PLATFORM_PROFILE)?; let mut file = OpenOptions::new().read(true).open(PLATFORM_PROFILE)?;
let mut buf = String::new(); let mut buf = String::new();
file.read_to_string(&mut buf)?; file.read_to_string(&mut buf)?;
@@ -60,7 +60,7 @@ impl Profile {
} }
pub fn get_profile_names() -> Result<Vec<Profile>, ProfileError> { pub fn get_profile_names() -> Result<Vec<Profile>, ProfileError> {
let mut file = OpenOptions::new().read(true).open(&PLATFORM_PROFILES)?; let mut file = OpenOptions::new().read(true).open(PLATFORM_PROFILES)?;
let mut buf = String::new(); let mut buf = String::new();
file.read_to_string(&mut buf)?; file.read_to_string(&mut buf)?;