mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b023d0f5f | |||
| 74f74e73c4 | |||
| 9c7df9ad39 | |||
| 94adf5d24d | |||
| 8dbdb68175 | |||
| 89002eb5ec | |||
| dc9ef8cf54 | |||
| 667697d042 | |||
| bc92fa11f9 |
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [v6.0.2]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Clean up code
|
||||||
|
- Don't panic if no aura device in ROGCC
|
||||||
|
- Try to prevent an errorenous tuf keyboard detection
|
||||||
|
|
||||||
|
## [v6.0.1]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Support the G713P keyboard
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Update all `Cargo.toml` to use workspace deps and remove unused features
|
||||||
|
- Update dependencies where possible
|
||||||
|
- Switch the UI to use fluent-dark instead of cosmic-dark due to extremely long compile time
|
||||||
|
|
||||||
## [v6.0.0]
|
## [v6.0.0]
|
||||||
|
|
||||||
### Important note
|
### Important note
|
||||||
|
|||||||
Generated
+212
-731
File diff suppressed because it is too large
Load Diff
+15
-6
@@ -25,8 +25,15 @@ default-members = [
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "6.0.0"
|
version = "6.0.2"
|
||||||
rust-version = "1.77"
|
rust-version = "1.77"
|
||||||
|
license = "MPL-2.0"
|
||||||
|
readme = "README.md"
|
||||||
|
authors = ["Luke <luke@ljones.dev>"]
|
||||||
|
repository = "https://gitlab.com/asus-linux/asusctl"
|
||||||
|
homepage = "https://gitlab.com/asus-linux/asusctl"
|
||||||
|
description = "Laptop feature control for ASUS ROG laptops and others"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
tokio = { version = "^1.36.0", default-features = false, features = [
|
tokio = { version = "^1.36.0", default-features = false, features = [
|
||||||
@@ -40,13 +47,11 @@ dirs = "^4.0"
|
|||||||
smol = "^1.3"
|
smol = "^1.3"
|
||||||
mio = "0.8.11"
|
mio = "0.8.11"
|
||||||
|
|
||||||
zbus = "~4.1.2"
|
zbus = "4.1"
|
||||||
logind-zbus = { version = "~4.0.2" } #, default-features = false, features = ["non_blocking"] }
|
logind-zbus = { version = "4.0.2" } #, default-features = false, features = ["non_blocking"] }
|
||||||
|
|
||||||
serde = "^1.0"
|
serde = "^1.0"
|
||||||
serde_derive = "^1.0"
|
serde_derive = "^1.0"
|
||||||
serde_json = "^1.0"
|
|
||||||
toml = "^0.5.10"
|
|
||||||
ron = "*"
|
ron = "*"
|
||||||
typeshare = "1.0.0"
|
typeshare = "1.0.0"
|
||||||
|
|
||||||
@@ -64,7 +69,7 @@ pix = "^0.13"
|
|||||||
tinybmp = "^0.4.0"
|
tinybmp = "^0.4.0"
|
||||||
gif = "^0.12.0"
|
gif = "^0.12.0"
|
||||||
|
|
||||||
versions = "4.1"
|
versions = "6.2"
|
||||||
|
|
||||||
notify-rust = { git = "https://github.com/flukejones/notify-rust.git", rev = "54176413b81189a3e4edbdc20a0b4f7e2e35c063", default-features = false, features = [
|
notify-rust = { git = "https://github.com/flukejones/notify-rust.git", rev = "54176413b81189a3e4edbdc20a0b4f7e2e35c063", default-features = false, features = [
|
||||||
"z",
|
"z",
|
||||||
@@ -83,6 +88,10 @@ codegen-units = 1
|
|||||||
opt-level = 1
|
opt-level = 1
|
||||||
codegen-units = 16
|
codegen-units = 16
|
||||||
|
|
||||||
|
[profile.dev.package."*"]
|
||||||
|
opt-level = 1
|
||||||
|
codegen-units = 16
|
||||||
|
|
||||||
[profile.bench]
|
[profile.bench]
|
||||||
debug = false
|
debug = false
|
||||||
opt-level = 3
|
opt-level = 3
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ Now includes a GUI, `rog-control-center`.
|
|||||||
|
|
||||||
## Kernel support
|
## Kernel support
|
||||||
|
|
||||||
**The minimum supported kernel version is 6.10**, which will contain the patches from [here](https://lore.kernel.org/platform-driver-x86/20240404001652.86207-1-luke@ljones.dev/). Z13 devices will need [these](https://lore.kernel.org/linux-input/20240416090402.31057-1-luke@ljones.dev/T/#t)
|
**The minimum supported kernel version is 6.10**, which will contain the patches from [here](https://lore.kernel.org/platform-driver-x86/20240404001652.86207-1-luke@ljones.dev/). This is especially required for 2023+ devices and possibly some lat 2022 devices.
|
||||||
|
|
||||||
|
Z13 devices will need [these](https://lore.kernel.org/linux-input/20240416090402.31057-1-luke@ljones.dev/T/#t)
|
||||||
|
|
||||||
## Goals
|
## Goals
|
||||||
|
|
||||||
@@ -31,7 +33,7 @@ See the [rog-aura readme](./rog-aura/README.md) for more details.
|
|||||||
|
|
||||||
## Discord
|
## Discord
|
||||||
|
|
||||||
[Discord server link](https://discord.gg/z8y99XqPb7)
|
[](https://discord.gg/z8y99XqPb7)
|
||||||
|
|
||||||
## SUPPORTED LAPTOPS
|
## SUPPORTED LAPTOPS
|
||||||
|
|
||||||
|
|||||||
+7
-9
@@ -1,9 +1,12 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "asusctl"
|
name = "asusctl"
|
||||||
license = "MPL-2.0"
|
license.workspace = true
|
||||||
authors = ["Luke D Jones <luke@ljones.dev>"]
|
|
||||||
edition = "2021"
|
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
|
readme.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rog_anime = { path = "../rog-anime" }
|
rog_anime = { path = "../rog-anime" }
|
||||||
@@ -15,16 +18,11 @@ rog_platform = { path = "../rog-platform" }
|
|||||||
asusd = { path = "../asusd" }
|
asusd = { path = "../asusd" }
|
||||||
dmi_id = { path = "../dmi-id" }
|
dmi_id = { path = "../dmi-id" }
|
||||||
|
|
||||||
|
ron.workspace = true
|
||||||
gumdrop.workspace = true
|
gumdrop.workspace = true
|
||||||
toml.workspace = true
|
|
||||||
zbus.workspace = true
|
zbus.workspace = true
|
||||||
tokio.workspace = true
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
gif.workspace = true
|
|
||||||
tinybmp.workspace = true
|
|
||||||
glam.workspace = true
|
|
||||||
rog_dbus = { path = "../rog-dbus" }
|
rog_dbus = { path = "../rog-dbus" }
|
||||||
tokio.workspace = true
|
|
||||||
|
|
||||||
cargo-husky.workspace = true
|
cargo-husky.workspace = true
|
||||||
@@ -87,6 +87,7 @@ impl FromStr for LedBrightness {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#[allow(clippy::to_string_trait_impl)]
|
||||||
impl ToString for LedBrightness {
|
impl ToString for LedBrightness {
|
||||||
fn to_string(&self) -> String {
|
fn to_string(&self) -> String {
|
||||||
let s = match self.level {
|
let s = match self.level {
|
||||||
|
|||||||
+3
-2
@@ -22,6 +22,7 @@ use rog_dbus::zbus_slash::SlashProxyBlocking;
|
|||||||
use rog_platform::platform::{GpuMode, Properties, ThrottlePolicy};
|
use rog_platform::platform::{GpuMode, Properties, ThrottlePolicy};
|
||||||
use rog_profiles::error::ProfileError;
|
use rog_profiles::error::ProfileError;
|
||||||
use rog_slash::SlashMode;
|
use rog_slash::SlashMode;
|
||||||
|
use ron::ser::PrettyConfig;
|
||||||
use zbus::blocking::Connection;
|
use zbus::blocking::Connection;
|
||||||
|
|
||||||
use crate::aura_cli::{AuraPowerStates, LedBrightness};
|
use crate::aura_cli::{AuraPowerStates, LedBrightness};
|
||||||
@@ -826,8 +827,8 @@ fn handle_fan_curve(
|
|||||||
if let Some(profile) = cmd.mod_profile {
|
if let Some(profile) = cmd.mod_profile {
|
||||||
if cmd.enable_fan_curves.is_none() && cmd.data.is_none() {
|
if cmd.enable_fan_curves.is_none() && cmd.data.is_none() {
|
||||||
let data = fan_proxy.fan_curve_data(profile)?;
|
let data = fan_proxy.fan_curve_data(profile)?;
|
||||||
let data = toml::to_string(&data)?;
|
let ron = ron::ser::to_string_pretty(&data, PrettyConfig::new().depth_limit(4))?;
|
||||||
println!("\nFan curves for {:?}\n\n{}", profile, data);
|
println!("\nFan curves for {:?}\n\n{}", profile, ron);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(enabled) = cmd.enable_fan_curves {
|
if let Some(enabled) = cmd.enable_fan_curves {
|
||||||
|
|||||||
+10
-8
@@ -1,10 +1,12 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "asusd-user"
|
name = "asusd-user"
|
||||||
license = "MPL-2.0"
|
license.workspace = true
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
authors = ["Luke D Jones <luke@ljones.dev>"]
|
readme.workspace = true
|
||||||
edition = "2021"
|
authors.workspace = true
|
||||||
description = "Usermode daemon for user settings, anime, per-key lighting"
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "asusd-user"
|
name = "asusd-user"
|
||||||
@@ -16,8 +18,8 @@ smol.workspace = true
|
|||||||
|
|
||||||
# serialisation
|
# serialisation
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_json.workspace = true
|
|
||||||
serde_derive.workspace = true
|
serde_derive.workspace = true
|
||||||
|
ron.workspace = true
|
||||||
|
|
||||||
rog_anime = { path = "../rog-anime" }
|
rog_anime = { path = "../rog-anime" }
|
||||||
rog_aura = { path = "../rog-aura" }
|
rog_aura = { path = "../rog-aura" }
|
||||||
@@ -26,10 +28,10 @@ rog_platform = { path = "../rog-platform" }
|
|||||||
config-traits = { path = "../config-traits" }
|
config-traits = { path = "../config-traits" }
|
||||||
|
|
||||||
zbus.workspace = true
|
zbus.workspace = true
|
||||||
|
|
||||||
# cli and logging
|
|
||||||
log.workspace = true
|
|
||||||
env_logger.workspace = true
|
env_logger.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cargo-husky.workspace = true
|
cargo-husky.workspace = true
|
||||||
|
|
||||||
|
[package.metadata.cargo-machete]
|
||||||
|
ignored = ["serde"]
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use config_traits::StdConfig;
|
|||||||
use rog_anime::error::AnimeError;
|
use rog_anime::error::AnimeError;
|
||||||
use rog_anime::{ActionData, ActionLoader, AnimTime, Fade, Sequences, Vec2};
|
use rog_anime::{ActionData, ActionLoader, AnimTime, Fade, Sequences, Vec2};
|
||||||
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
||||||
|
use ron::ser::PrettyConfig;
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
use zbus::interface;
|
use zbus::interface;
|
||||||
use zbus::zvariant::{ObjectPath, Type};
|
use zbus::zvariant::{ObjectPath, Type};
|
||||||
@@ -199,11 +200,12 @@ impl CtrlAnime<'static> {
|
|||||||
config.anime.push(action);
|
config.anime.push(action);
|
||||||
config.write();
|
config.write();
|
||||||
|
|
||||||
let json = serde_json::to_string_pretty(&*config).expect("Parse config to JSON failed");
|
let ron = ron::ser::to_string_pretty(&*config, PrettyConfig::new().depth_limit(4))
|
||||||
|
.expect("Parse config to RON failed");
|
||||||
|
|
||||||
// Release the inner run loop again
|
// Release the inner run loop again
|
||||||
self.inner_early_return.store(false, Ordering::SeqCst);
|
self.inner_early_return.store(false, Ordering::SeqCst);
|
||||||
return Ok(json);
|
return Ok(ron);
|
||||||
}
|
}
|
||||||
Err(zbus::fdo::Error::Failed("UserConfig lock fail".into()))
|
Err(zbus::fdo::Error::Failed("UserConfig lock fail".into()))
|
||||||
}
|
}
|
||||||
@@ -244,12 +246,11 @@ impl CtrlAnime<'static> {
|
|||||||
config.anime.push(action);
|
config.anime.push(action);
|
||||||
config.write();
|
config.write();
|
||||||
|
|
||||||
let json =
|
let ron = ron::ser::to_string_pretty(&*config, PrettyConfig::new().depth_limit(4))
|
||||||
serde_json::to_string_pretty(&*config.anime).expect("Parse config to JSON failed");
|
.expect("Parse config to RON failed");
|
||||||
|
|
||||||
// Release the inner run loop again
|
// Release the inner run loop again
|
||||||
self.inner_early_return.store(false, Ordering::SeqCst);
|
self.inner_early_return.store(false, Ordering::SeqCst);
|
||||||
return Ok(json);
|
return Ok(ron);
|
||||||
}
|
}
|
||||||
Err(zbus::fdo::Error::Failed("UserConfig lock fail".into()))
|
Err(zbus::fdo::Error::Failed("UserConfig lock fail".into()))
|
||||||
}
|
}
|
||||||
@@ -289,12 +290,11 @@ impl CtrlAnime<'static> {
|
|||||||
config.anime.push(action);
|
config.anime.push(action);
|
||||||
config.write();
|
config.write();
|
||||||
|
|
||||||
let json =
|
let ron = ron::ser::to_string_pretty(&*config, PrettyConfig::new().depth_limit(4))
|
||||||
serde_json::to_string_pretty(&*config.anime).expect("Parse config to JSON failed");
|
.expect("Parse config to RON failed");
|
||||||
|
|
||||||
// Release the inner run loop again
|
// Release the inner run loop again
|
||||||
self.inner_early_return.store(false, Ordering::SeqCst);
|
self.inner_early_return.store(false, Ordering::SeqCst);
|
||||||
return Ok(json);
|
return Ok(ron);
|
||||||
}
|
}
|
||||||
Err(zbus::fdo::Error::Failed("UserConfig lock fail".into()))
|
Err(zbus::fdo::Error::Failed("UserConfig lock fail".into()))
|
||||||
}
|
}
|
||||||
@@ -314,12 +314,11 @@ impl CtrlAnime<'static> {
|
|||||||
config.anime.push(action);
|
config.anime.push(action);
|
||||||
config.write();
|
config.write();
|
||||||
|
|
||||||
let json =
|
let ron = ron::ser::to_string_pretty(&*config, PrettyConfig::new().depth_limit(4))
|
||||||
serde_json::to_string_pretty(&*config.anime).expect("Parse config to JSON failed");
|
.expect("Parse config to RON failed");
|
||||||
|
|
||||||
// Release the inner run loop again
|
// Release the inner run loop again
|
||||||
self.inner_early_return.store(false, Ordering::SeqCst);
|
self.inner_early_return.store(false, Ordering::SeqCst);
|
||||||
return Ok(json);
|
return Ok(ron);
|
||||||
}
|
}
|
||||||
Err(zbus::fdo::Error::Failed("UserConfig lock fail".into()))
|
Err(zbus::fdo::Error::Failed("UserConfig lock fail".into()))
|
||||||
}
|
}
|
||||||
@@ -337,12 +336,11 @@ impl CtrlAnime<'static> {
|
|||||||
}
|
}
|
||||||
config.write();
|
config.write();
|
||||||
|
|
||||||
let json =
|
let ron = ron::ser::to_string_pretty(&*config, PrettyConfig::new().depth_limit(4))
|
||||||
serde_json::to_string_pretty(&*config.anime).expect("Parse config to JSON failed");
|
.expect("Parse config to RON failed");
|
||||||
|
|
||||||
// Release the inner run loop again
|
// Release the inner run loop again
|
||||||
self.inner_early_return.store(false, Ordering::SeqCst);
|
self.inner_early_return.store(false, Ordering::SeqCst);
|
||||||
return Ok(json);
|
return Ok(ron);
|
||||||
}
|
}
|
||||||
Err(zbus::fdo::Error::Failed("UserConfig lock fail".into()))
|
Err(zbus::fdo::Error::Failed("UserConfig lock fail".into()))
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-9
@@ -1,13 +1,13 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "asusd"
|
name = "asusd"
|
||||||
license = "MPL-2.0"
|
license.workspace = true
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
readme = "README.md"
|
readme.workspace = true
|
||||||
authors = ["Luke <luke@ljones.dev>"]
|
authors.workspace = true
|
||||||
repository = "https://gitlab.com/asus-linux/asus-nb-ctrl"
|
repository.workspace = true
|
||||||
homepage = "https://gitlab.com/asus-linux/asus-nb-ctrl"
|
homepage.workspace = true
|
||||||
description = "A daemon app for ASUS GX502 and similar laptops to control missing features"
|
description.workspace = true
|
||||||
edition = "2021"
|
edition.workspace = true
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "asusd"
|
name = "asusd"
|
||||||
@@ -42,7 +42,8 @@ serde_derive.workspace = true
|
|||||||
|
|
||||||
concat-idents.workspace = true
|
concat-idents.workspace = true
|
||||||
|
|
||||||
systemd-zbus = "*"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cargo-husky.workspace = true
|
cargo-husky.workspace = true
|
||||||
|
|
||||||
|
[package.metadata.cargo-machete]
|
||||||
|
ignored = ["serde"]
|
||||||
|
|||||||
@@ -31,18 +31,25 @@ pub struct Config {
|
|||||||
/// The energy_performance_preference for this throttle/platform profile
|
/// The energy_performance_preference for this throttle/platform profile
|
||||||
pub throttle_performance_epp: CPUEPP,
|
pub throttle_performance_epp: CPUEPP,
|
||||||
/// Defaults to `None` if not supported
|
/// Defaults to `None` if not supported
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none", default)]
|
||||||
pub ppt_pl1_spl: Option<u8>,
|
pub ppt_pl1_spl: Option<u8>,
|
||||||
/// Defaults to `None` if not supported
|
/// Defaults to `None` if not supported
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none", default)]
|
||||||
pub ppt_pl2_sppt: Option<u8>,
|
pub ppt_pl2_sppt: Option<u8>,
|
||||||
/// Defaults to `None` if not supported
|
/// Defaults to `None` if not supported
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none", default)]
|
||||||
pub ppt_fppt: Option<u8>,
|
pub ppt_fppt: Option<u8>,
|
||||||
/// Defaults to `None` if not supported
|
/// Defaults to `None` if not supported
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none", default)]
|
||||||
pub ppt_apu_sppt: Option<u8>,
|
pub ppt_apu_sppt: Option<u8>,
|
||||||
/// Defaults to `None` if not supported
|
/// Defaults to `None` if not supported
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none", default)]
|
||||||
pub ppt_platform_sppt: Option<u8>,
|
pub ppt_platform_sppt: Option<u8>,
|
||||||
/// Defaults to `None` if not supported
|
/// Defaults to `None` if not supported
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none", default)]
|
||||||
pub nv_dynamic_boost: Option<u8>,
|
pub nv_dynamic_boost: Option<u8>,
|
||||||
/// Defaults to `None` if not supported
|
/// Defaults to `None` if not supported
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none", default)]
|
||||||
pub nv_temp_target: Option<u8>,
|
pub nv_temp_target: Option<u8>,
|
||||||
/// Temporary state for AC/Batt
|
/// Temporary state for AC/Batt
|
||||||
#[serde(skip)]
|
#[serde(skip)]
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use std::sync::Arc;
|
|||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
|
|
||||||
use ::zbus::export::futures_util::lock::Mutex;
|
use ::zbus::export::futures_util::lock::Mutex;
|
||||||
|
use config_traits::{StdConfig, StdConfigLoad2};
|
||||||
use log::{error, info, warn};
|
use log::{error, info, warn};
|
||||||
use rog_anime::error::AnimeError;
|
use rog_anime::error::AnimeError;
|
||||||
use rog_anime::usb::{
|
use rog_anime::usb::{
|
||||||
@@ -62,7 +63,7 @@ pub struct CtrlAnime {
|
|||||||
|
|
||||||
impl CtrlAnime {
|
impl CtrlAnime {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new(config: AnimeConfig) -> Result<CtrlAnime, RogError> {
|
pub fn new() -> Result<CtrlAnime, RogError> {
|
||||||
let usb = USBRaw::new(0x193b).ok();
|
let usb = USBRaw::new(0x193b).ok();
|
||||||
let hid = HidRaw::new("193b").ok();
|
let hid = HidRaw::new("193b").ok();
|
||||||
let node = if usb.is_some() {
|
let node = if usb.is_some() {
|
||||||
@@ -89,6 +90,7 @@ impl CtrlAnime {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
let config = AnimeConfig::new().load();
|
||||||
let mut anime_type = get_anime_type()?;
|
let mut anime_type = get_anime_type()?;
|
||||||
if let AnimeType::Unknown = anime_type {
|
if let AnimeType::Unknown = anime_type {
|
||||||
if let Some(model) = config.model_override {
|
if let Some(model) = config.model_override {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ pub struct AuraConfig {
|
|||||||
pub brightness: LedBrightness,
|
pub brightness: LedBrightness,
|
||||||
pub current_mode: AuraModeNum,
|
pub current_mode: AuraModeNum,
|
||||||
pub builtins: BTreeMap<AuraModeNum, AuraEffect>,
|
pub builtins: BTreeMap<AuraModeNum, AuraEffect>,
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none", default)]
|
||||||
pub multizone: Option<BTreeMap<AuraModeNum, Vec<AuraEffect>>>,
|
pub multizone: Option<BTreeMap<AuraModeNum, Vec<AuraEffect>>>,
|
||||||
pub multizone_on: bool,
|
pub multizone_on: bool,
|
||||||
pub enabled: LaptopAuraPower,
|
pub enabled: LaptopAuraPower,
|
||||||
|
|||||||
@@ -121,12 +121,12 @@ impl CtrlKbdLed {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for a TUF laptop LED. Assume there is only ever one.
|
// Check for a TUF laptop LED. Assume there is only ever one.
|
||||||
if let Ok(tuf_kbd) = KeyboardLed::new() {
|
if let Ok(kbd_backlight) = KeyboardLed::new() {
|
||||||
if tuf_kbd.has_kbd_rgb_mode() {
|
if kbd_backlight.has_kbd_rgb_mode() {
|
||||||
info!("AuraControl found a TUF laptop keyboard");
|
info!("AuraControl found a TUF laptop keyboard");
|
||||||
let ctrl = CtrlKbdLed {
|
let ctrl = CtrlKbdLed {
|
||||||
led_type: AuraDeviceType::LaptopTuf,
|
led_type: AuraDeviceType::LaptopTuf,
|
||||||
led_node: LEDNode::KbdLed(tuf_kbd),
|
led_node: LEDNode::KbdLed(kbd_backlight),
|
||||||
supported_data: LedSupportData::get_data("tuf"),
|
supported_data: LedSupportData::get_data("tuf"),
|
||||||
per_key_mode_active: false,
|
per_key_mode_active: false,
|
||||||
config: Self::init_config("tuf"),
|
config: Self::init_config("tuf"),
|
||||||
|
|||||||
@@ -720,6 +720,7 @@ impl crate::ZbusRun for CtrlPlatform {
|
|||||||
impl ReloadAndNotify for CtrlPlatform {
|
impl ReloadAndNotify for CtrlPlatform {
|
||||||
type Data = Config;
|
type Data = Config;
|
||||||
|
|
||||||
|
/// Called on config file changed externally
|
||||||
async fn reload_and_notify(
|
async fn reload_and_notify(
|
||||||
&mut self,
|
&mut self,
|
||||||
signal_context: &SignalContext<'static>,
|
signal_context: &SignalContext<'static>,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
pub mod config;
|
pub mod config;
|
||||||
pub mod trait_impls;
|
pub mod trait_impls;
|
||||||
|
|
||||||
|
use config_traits::{StdConfig, StdConfigLoad};
|
||||||
use rog_platform::hid_raw::HidRaw;
|
use rog_platform::hid_raw::HidRaw;
|
||||||
use rog_platform::usb_raw::USBRaw;
|
use rog_platform::usb_raw::USBRaw;
|
||||||
use rog_slash::error::SlashError;
|
use rog_slash::error::SlashError;
|
||||||
@@ -31,19 +32,13 @@ impl Node {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub struct CtrlSlash {
|
pub struct CtrlSlash {
|
||||||
// node: HidRaw,
|
|
||||||
node: Node,
|
node: Node,
|
||||||
config: SlashConfig,
|
config: SlashConfig,
|
||||||
// slash_type: SlashType,
|
|
||||||
// // set to force thread to exit
|
|
||||||
// thread_exit: Arc<AtomicBool>,
|
|
||||||
// // Set to false when the thread exits
|
|
||||||
// thread_running: Arc<AtomicBool>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CtrlSlash {
|
impl CtrlSlash {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new(config: SlashConfig) -> Result<CtrlSlash, RogError> {
|
pub fn new() -> Result<CtrlSlash, RogError> {
|
||||||
let slash_type = get_slash_type()?;
|
let slash_type = get_slash_type()?;
|
||||||
if matches!(slash_type, SlashType::Unknown | SlashType::Unsupported) {
|
if matches!(slash_type, SlashType::Unknown | SlashType::Unsupported) {
|
||||||
return Err(RogError::Slash(SlashError::NoDevice));
|
return Err(RogError::Slash(SlashError::NoDevice));
|
||||||
@@ -61,10 +56,7 @@ impl CtrlSlash {
|
|||||||
|
|
||||||
let ctrl = CtrlSlash {
|
let ctrl = CtrlSlash {
|
||||||
node,
|
node,
|
||||||
config,
|
config: SlashConfig::new().load(),
|
||||||
// slash_type,
|
|
||||||
// thread_exit: Arc::new(AtomicBool::new(false)),
|
|
||||||
// thread_running: Arc::new(AtomicBool::new(false)),
|
|
||||||
};
|
};
|
||||||
ctrl.do_initialization()?;
|
ctrl.do_initialization()?;
|
||||||
|
|
||||||
|
|||||||
+3
-5
@@ -5,17 +5,15 @@ use std::sync::Arc;
|
|||||||
use ::zbus::export::futures_util::lock::Mutex;
|
use ::zbus::export::futures_util::lock::Mutex;
|
||||||
use ::zbus::Connection;
|
use ::zbus::Connection;
|
||||||
use asusd::config::Config;
|
use asusd::config::Config;
|
||||||
use asusd::ctrl_anime::config::AnimeConfig;
|
|
||||||
use asusd::ctrl_anime::trait_impls::CtrlAnimeZbus;
|
use asusd::ctrl_anime::trait_impls::CtrlAnimeZbus;
|
||||||
use asusd::ctrl_anime::CtrlAnime;
|
use asusd::ctrl_anime::CtrlAnime;
|
||||||
use asusd::ctrl_aura::manager::AuraManager;
|
use asusd::ctrl_aura::manager::AuraManager;
|
||||||
use asusd::ctrl_fancurves::CtrlFanCurveZbus;
|
use asusd::ctrl_fancurves::CtrlFanCurveZbus;
|
||||||
use asusd::ctrl_platform::CtrlPlatform;
|
use asusd::ctrl_platform::CtrlPlatform;
|
||||||
use asusd::ctrl_slash::config::SlashConfig;
|
|
||||||
use asusd::ctrl_slash::trait_impls::CtrlSlashZbus;
|
use asusd::ctrl_slash::trait_impls::CtrlSlashZbus;
|
||||||
use asusd::ctrl_slash::CtrlSlash;
|
use asusd::ctrl_slash::CtrlSlash;
|
||||||
use asusd::{print_board_info, start_tasks, CtrlTask, DBUS_NAME};
|
use asusd::{print_board_info, start_tasks, CtrlTask, DBUS_NAME};
|
||||||
use config_traits::{StdConfig, StdConfigLoad, StdConfigLoad2, StdConfigLoad3};
|
use config_traits::{StdConfig, StdConfigLoad3};
|
||||||
use log::{error, info};
|
use log::{error, info};
|
||||||
use zbus::fdo::ObjectManager;
|
use zbus::fdo::ObjectManager;
|
||||||
|
|
||||||
@@ -98,7 +96,7 @@ async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
match CtrlAnime::new(AnimeConfig::new().load()) {
|
match CtrlAnime::new() {
|
||||||
Ok(ctrl) => {
|
Ok(ctrl) => {
|
||||||
let zbus = CtrlAnimeZbus(Arc::new(Mutex::new(ctrl)));
|
let zbus = CtrlAnimeZbus(Arc::new(Mutex::new(ctrl)));
|
||||||
let sig_ctx = CtrlAnimeZbus::signal_context(&connection)?;
|
let sig_ctx = CtrlAnimeZbus::signal_context(&connection)?;
|
||||||
@@ -109,7 +107,7 @@ async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
match CtrlSlash::new(SlashConfig::new().load()) {
|
match CtrlSlash::new() {
|
||||||
Ok(ctrl) => {
|
Ok(ctrl) => {
|
||||||
let zbus = CtrlSlashZbus(Arc::new(Mutex::new(ctrl)));
|
let zbus = CtrlSlashZbus(Arc::new(Mutex::new(ctrl)));
|
||||||
// Currently, the Slash has no need for a loop watching power events, however,
|
// Currently, the Slash has no need for a loop watching power events, however,
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "config-traits"
|
name = "config-traits"
|
||||||
license = "MPL-2.0"
|
license.workspace = true
|
||||||
authors = ["Luke D Jones <luke@ljones.dev>"]
|
|
||||||
edition = "2021"
|
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
|
readme.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_derive.workspace = true
|
|
||||||
serde_json.workspace = true
|
|
||||||
toml.workspace = true
|
|
||||||
ron.workspace = true
|
ron.workspace = true
|
||||||
|
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
|
|||||||
@@ -3,10 +3,7 @@
|
|||||||
//! updating them from previous versions where fields or names are changed in
|
//! updating them from previous versions where fields or names are changed in
|
||||||
//! some way.
|
//! some way.
|
||||||
//!
|
//!
|
||||||
//! The end canonical file format is `.ron` as this supports rust types well,
|
//! The end canonical file format is `.ron` as this supports rust types well
|
||||||
//! and includes the ability to add commenting, and is less verbose than `json`.
|
|
||||||
//! Currently the crate will also try to parse from `json` and `toml` if the
|
|
||||||
//! `ron` parsing fails, then update to `ron` format.
|
|
||||||
|
|
||||||
use std::fs::{self, create_dir, File, OpenOptions};
|
use std::fs::{self, create_dir, File, OpenOptions};
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
@@ -221,21 +218,9 @@ macro_rules! std_config_load {
|
|||||||
if let Ok(data) = ron::from_str(&buf) {
|
if let Ok(data) = ron::from_str(&buf) {
|
||||||
self = data;
|
self = data;
|
||||||
log::info!("Parsed RON for {:?}", std::any::type_name::<Self>());
|
log::info!("Parsed RON for {:?}", std::any::type_name::<Self>());
|
||||||
} else if let Ok(data) = serde_json::from_str(&buf) {
|
} $(else if let Ok(data) = ron::from_str::<$generic>(&buf) {
|
||||||
self = data;
|
|
||||||
log::info!("Parsed JSON for {:?}", std::any::type_name::<Self>());
|
|
||||||
} else if let Ok(data) = toml::from_str(&buf) {
|
|
||||||
self = data;
|
|
||||||
log::info!("Parsed TOML for {:?}", std::any::type_name::<Self>());
|
|
||||||
} $(else if let Ok(data) = ron::from_str::<$generic>(&buf) {
|
|
||||||
self = data.into();
|
self = data.into();
|
||||||
log::info!("New version failed, trying previous: Parsed RON for {:?}", std::any::type_name::<$generic>());
|
log::info!("New version failed, trying previous: Parsed RON for {:?}", std::any::type_name::<$generic>());
|
||||||
} else if let Ok(data) = serde_json::from_str::<$generic>(&buf) {
|
|
||||||
self = data.into();
|
|
||||||
log::info!("New version failed, trying previous: Parsed JSON for {:?}", std::any::type_name::<$generic>());
|
|
||||||
} else if let Ok(data) = toml::from_str::<$generic>(&buf) {
|
|
||||||
self = data.into();
|
|
||||||
log::info!("Newvious version failed, trying previous: Parsed TOML for {:?}", std::any::type_name::<$generic>());
|
|
||||||
})* else {
|
})* else {
|
||||||
self.rename_file_old();
|
self.rename_file_old();
|
||||||
self = Self::new();
|
self = Self::new();
|
||||||
|
|||||||
+6
-2
@@ -1,7 +1,11 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cpuctl"
|
name = "cpuctl"
|
||||||
license = "MPL-2.0"
|
license.workspace = true
|
||||||
edition = "2021"
|
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
|
readme.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
+6
-1
@@ -1,7 +1,12 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "dmi_id"
|
name = "dmi_id"
|
||||||
edition = "2021"
|
license.workspace = true
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
|
readme.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rog_anime"
|
name = "rog_anime"
|
||||||
license = "MPL-2.0"
|
license.workspace = true
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
readme = "README.md"
|
readme.workspace = true
|
||||||
authors = ["Luke <luke@ljones.dev>"]
|
authors.workspace = true
|
||||||
repository = "https://gitlab.com/asus-linux/asus-nb-ctrl"
|
repository.workspace = true
|
||||||
homepage = "https://gitlab.com/asus-linux/asus-nb-ctrl"
|
homepage.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
documentation = "https://docs.rs/rog-anime"
|
documentation = "https://docs.rs/rog-anime"
|
||||||
description = "Types useful for translating images and other data for display on the ASUS AniMe Matrix display"
|
description = "Types useful for translating images and other data for display on the ASUS AniMe Matrix display"
|
||||||
keywords = ["ROG", "ASUS", "AniMe"]
|
keywords = ["ROG", "ASUS", "AniMe"]
|
||||||
edition = "2021"
|
|
||||||
exclude = ["data"]
|
exclude = ["data"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
@@ -39,3 +39,6 @@ dmi_id = { path = "../dmi-id", optional = true }
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cargo-husky.workspace = true
|
cargo-husky.workspace = true
|
||||||
|
|
||||||
|
[package.metadata.cargo-machete]
|
||||||
|
ignored = ["serde"]
|
||||||
|
|||||||
@@ -323,6 +323,15 @@
|
|||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
device_name: "G713P",
|
||||||
|
product_id: "",
|
||||||
|
layout_name: "ga401q",
|
||||||
|
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
||||||
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
|
advanced_type: None,
|
||||||
|
power_zones: [Keyboard],
|
||||||
|
),
|
||||||
(
|
(
|
||||||
device_name: "G713QM",
|
device_name: "G713QM",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
|
|||||||
@@ -1,19 +1,21 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rog-control-center"
|
name = "rog-control-center"
|
||||||
license = "MPL-2.0"
|
license.workspace = true
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
authors = ["Luke D. Jones <luke@ljones.dev>"]
|
readme.workspace = true
|
||||||
edition = "2021"
|
authors.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
#default = ["mocking"]
|
#default = ["mocking"]
|
||||||
#mocking = []
|
#mocking = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
nix = { version = "^0.28.0", features = ["fs"] }
|
||||||
betrayer = { git = "https://github.com/flukejones/betrayer.git", features = [
|
tempfile = "3.3.0"
|
||||||
"winit",
|
betrayer = { version = "0.2.0" }
|
||||||
] }
|
|
||||||
|
|
||||||
asusd = { path = "../asusd" }
|
asusd = { path = "../asusd" }
|
||||||
config-traits = { path = "../config-traits" }
|
config-traits = { path = "../config-traits" }
|
||||||
@@ -22,7 +24,7 @@ rog_dbus = { path = "../rog-dbus" }
|
|||||||
rog_aura = { path = "../rog-aura" }
|
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" }
|
||||||
supergfxctl = { git = "https://gitlab.com/asus-linux/supergfxctl.git", default-features = false }
|
supergfxctl = { git = "https://gitlab.com/asus-linux/supergfxctl.git", rev = "4eb6e97c22b68ae8d1e80500709b0c0580776ad3", default-features = false }
|
||||||
dmi_id = { path = "../dmi-id" }
|
dmi_id = { path = "../dmi-id" }
|
||||||
|
|
||||||
gumdrop.workspace = true
|
gumdrop.workspace = true
|
||||||
@@ -31,36 +33,24 @@ env_logger.workspace = true
|
|||||||
|
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
ron.workspace = true
|
|
||||||
serde_json.workspace = true
|
|
||||||
serde_derive.workspace = true
|
serde_derive.workspace = true
|
||||||
zbus.workspace = true
|
zbus.workspace = true
|
||||||
dirs.workspace = true
|
dirs.workspace = true
|
||||||
notify-rust.workspace = true
|
notify-rust.workspace = true
|
||||||
concat-idents.workspace = true
|
concat-idents.workspace = true
|
||||||
|
|
||||||
png_pong.workspace = true
|
|
||||||
|
|
||||||
versions.workspace = true
|
versions.workspace = true
|
||||||
|
|
||||||
nix = "^0.26.1"
|
|
||||||
tempfile = "3.3.0"
|
|
||||||
|
|
||||||
i-slint-backend-selector = { git = "https://github.com/slint-ui/slint.git" }
|
|
||||||
i-slint-core = { git = "https://github.com/slint-ui/slint.git" }
|
|
||||||
i-slint-backend-winit = { git = "https://github.com/slint-ui/slint.git" }
|
|
||||||
winit = "*"
|
|
||||||
|
|
||||||
[dependencies.slint]
|
[dependencies.slint]
|
||||||
git = "https://github.com/slint-ui/slint.git"
|
git = "https://github.com/slint-ui/slint.git"
|
||||||
default-features = false
|
default-features = false
|
||||||
features = [
|
features = [
|
||||||
"std",
|
|
||||||
"gettext",
|
"gettext",
|
||||||
"compat-1-0",
|
"compat-1-2",
|
||||||
"backend-winit-wayland",
|
|
||||||
"backend-linuxkms",
|
"backend-linuxkms",
|
||||||
"renderer-femtovg",
|
"backend-winit-wayland",
|
||||||
|
"renderer-winit-femtovg",
|
||||||
|
# "renderer-skia-opengl",
|
||||||
]
|
]
|
||||||
|
|
||||||
[build-dependencies.slint-build]
|
[build-dependencies.slint-build]
|
||||||
|
|||||||
@@ -7,11 +7,20 @@ fn main() {
|
|||||||
// write_locales();
|
// write_locales();
|
||||||
|
|
||||||
let root = env!("CARGO_MANIFEST_DIR");
|
let root = env!("CARGO_MANIFEST_DIR");
|
||||||
let mut path = PathBuf::from_str(root).unwrap();
|
let mut main = PathBuf::from_str(root).unwrap();
|
||||||
path.push("ui/main_window.slint");
|
main.push("ui/main_window.slint");
|
||||||
|
|
||||||
|
let mut include = PathBuf::from_str(root).unwrap();
|
||||||
|
include.push("ui");
|
||||||
|
|
||||||
|
slint_build::print_rustc_flags().unwrap();
|
||||||
|
// slint_build::compile("ui/main_window.slint").unwrap();
|
||||||
slint_build::compile_with_config(
|
slint_build::compile_with_config(
|
||||||
path,
|
main,
|
||||||
CompilerConfiguration::new().with_style("cosmic-dark".into()),
|
CompilerConfiguration::new()
|
||||||
|
// .embed_resources(EmbedResourcesKind::EmbedFiles)
|
||||||
|
.with_include_paths(vec![include])
|
||||||
|
.with_style("fluent-dark".into()),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ async fn main() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
thread_local! { pub static UI: std::cell::RefCell<Option<MainWindow>> = Default::default()};
|
thread_local! { pub static UI: std::cell::RefCell<Option<MainWindow>> = Default::default()};
|
||||||
i_slint_backend_selector::with_platform(|_| Ok(())).unwrap();
|
// i_slint_backend_selector::with_platform(|_| Ok(())).unwrap();
|
||||||
|
|
||||||
let mut do_once = !startup_in_background;
|
let mut do_once = !startup_in_background;
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ async fn main() -> Result<()> {
|
|||||||
sleep(Duration::from_millis(50));
|
sleep(Duration::from_millis(50));
|
||||||
|
|
||||||
let config_copy = config.clone();
|
let config_copy = config.clone();
|
||||||
i_slint_core::api::invoke_from_event_loop(move || {
|
slint::invoke_from_event_loop(move || {
|
||||||
UI.with(|ui| {
|
UI.with(|ui| {
|
||||||
let mut ui = ui.borrow_mut();
|
let mut ui = ui.borrow_mut();
|
||||||
if let Some(ui) = ui.as_mut() {
|
if let Some(ui) = ui.as_mut() {
|
||||||
@@ -193,7 +193,7 @@ async fn main() -> Result<()> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
i_slint_core::api::invoke_from_event_loop(move || {
|
slint::invoke_from_event_loop(move || {
|
||||||
UI.with(|ui| {
|
UI.with(|ui| {
|
||||||
let mut ui = ui.take();
|
let mut ui = ui.take();
|
||||||
if let Some(ui) = ui.borrow_mut() {
|
if let Some(ui) = ui.borrow_mut() {
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ pub fn start_notifications(config: Arc<Mutex<Config>>) -> Result<()> {
|
|||||||
let mut ac = String::new();
|
let mut ac = String::new();
|
||||||
let mut bat = String::new();
|
let mut bat = String::new();
|
||||||
if let Ok(config) = config_copy.lock() {
|
if let Ok(config) = config_copy.lock() {
|
||||||
ac = config.ac_command.clone();
|
ac.clone_from(&config.ac_command);
|
||||||
bat = config.bat_command.clone();
|
bat.clone_from(&config.bat_command);
|
||||||
}
|
}
|
||||||
|
|
||||||
if p == 0 && p != last_state {
|
if p == 0 && p != last_state {
|
||||||
|
|||||||
@@ -136,7 +136,11 @@ pub fn init_tray(_supported_properties: Vec<Properties>, config: Arc<Mutex<Confi
|
|||||||
.with_tooltip(TRAY_LABEL)
|
.with_tooltip(TRAY_LABEL)
|
||||||
.with_menu(build_menu())
|
.with_menu(build_menu())
|
||||||
.build(do_action)
|
.build(do_action)
|
||||||
.map_err(|e| log::error!("Tray unable to be initialised: {e:?}"))
|
.map_err(|e| {
|
||||||
|
log::error!(
|
||||||
|
"Tray unable to be initialised: {e:?}. Do you have a system tray enabled?"
|
||||||
|
)
|
||||||
|
})
|
||||||
{
|
{
|
||||||
info!("Tray started");
|
info!("Tray started");
|
||||||
let rog_blue = read_icon(&PathBuf::from("asus_notif_blue.png"));
|
let rog_blue = read_icon(&PathBuf::from("asus_notif_blue.png"));
|
||||||
@@ -151,41 +155,45 @@ pub fn init_tray(_supported_properties: Vec<Properties>, config: Arc<Mutex<Confi
|
|||||||
gpu_integrated,
|
gpu_integrated,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let mut has_supergfx = true;
|
||||||
let conn = zbus::blocking::Connection::system().unwrap();
|
let conn = zbus::blocking::Connection::system().unwrap();
|
||||||
let gfx_proxy = GfxProxy::new(&conn).unwrap();
|
if let Ok(gfx_proxy) = GfxProxy::new(&conn) {
|
||||||
let mut supergfx_active = false;
|
let mut supergfx_active = false;
|
||||||
if gfx_proxy.mode().is_ok() {
|
if gfx_proxy.mode().is_ok() {
|
||||||
supergfx_active = true;
|
supergfx_active = true;
|
||||||
if let Ok(version) = gfx_proxy.version() {
|
if let Ok(version) = gfx_proxy.version() {
|
||||||
if let Some(version) = Versioning::new(&version) {
|
if let Some(version) = Versioning::new(&version) {
|
||||||
let curr_gfx = Versioning::new("5.0.3-RC4").unwrap();
|
let curr_gfx = Versioning::new("5.2.0").unwrap();
|
||||||
warn!("supergfxd version = {version}");
|
warn!("supergfxd version = {version}");
|
||||||
if version < curr_gfx {
|
if version < curr_gfx {
|
||||||
// Don't allow mode changing if too old a version
|
// Don't allow mode changing if too old a version
|
||||||
warn!("supergfxd found but is too old to use");
|
warn!("supergfxd found but is too old to use");
|
||||||
// tray.gfx_proxy_is_active = false;
|
has_supergfx = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
|
|
||||||
info!("Started ROGTray");
|
info!("Started ROGTray");
|
||||||
let mut last_power = GfxPower::Unknown;
|
let mut last_power = GfxPower::Unknown;
|
||||||
loop {
|
loop {
|
||||||
if let Ok(lock) = config.try_lock() {
|
sleep(Duration::from_millis(1000));
|
||||||
if !lock.enable_tray_icon {
|
if let Ok(lock) = config.try_lock() {
|
||||||
return;
|
if !lock.enable_tray_icon {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if has_supergfx {
|
||||||
if let Ok(mode) = gfx_proxy.mode() {
|
if let Ok(mode) = gfx_proxy.mode() {
|
||||||
if let Ok(power) = gfx_proxy.power() {
|
if let Ok(power) = gfx_proxy.power() {
|
||||||
if last_power != power {
|
if last_power != power {
|
||||||
set_tray_icon_and_tip(mode, power, &mut tray, supergfx_active);
|
set_tray_icon_and_tip(mode, power, &mut tray, supergfx_active);
|
||||||
last_power = power;
|
last_power = power;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sleep(Duration::from_millis(500));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
|
use log::info;
|
||||||
use rog_aura::keyboard::LaptopAuraPower;
|
use rog_aura::keyboard::LaptopAuraPower;
|
||||||
use rog_dbus::zbus_aura::AuraProxy;
|
use rog_dbus::zbus_aura::AuraProxy;
|
||||||
use slint::{ComponentHandle, Model, RgbaColor, SharedString};
|
use slint::{ComponentHandle, Model, RgbaColor, SharedString};
|
||||||
@@ -92,7 +93,12 @@ pub fn setup_aura_page(ui: &MainWindow, _states: Arc<Mutex<Config>>) {
|
|||||||
|
|
||||||
let handle = ui.as_weak();
|
let handle = ui.as_weak();
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let aura = find_aura_iface().await.unwrap();
|
let aura = if let Ok(aura) = find_aura_iface().await {
|
||||||
|
aura
|
||||||
|
} else {
|
||||||
|
info!("This device appears to have no aura interfaces");
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
set_ui_props_async!(handle, aura, AuraPageData, brightness);
|
set_ui_props_async!(handle, aura, AuraPageData, brightness);
|
||||||
set_ui_props_async!(handle, aura, AuraPageData, led_mode);
|
set_ui_props_async!(handle, aura, AuraPageData, led_mode);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"POT-Creation-Date: 2024-05-05 08:22+0000\n"
|
"POT-Creation-Date: 2024-05-08 04:26+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
|||||||
+6
-6
@@ -1,13 +1,13 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rog_dbus"
|
name = "rog_dbus"
|
||||||
|
license.workspace = true
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
license = "MPL-2.0"
|
readme.workspace = true
|
||||||
readme = "README.md"
|
authors.workspace = true
|
||||||
authors = ["Luke <luke@ljones.dev>"]
|
repository.workspace = true
|
||||||
repository = "https://gitlab.com/asus-linux/asus-nb-ctrl"
|
homepage.workspace = true
|
||||||
homepage = "https://gitlab.com/asus-linux/asus-nb-ctrl"
|
edition.workspace = true
|
||||||
description = "dbus interface methods for asusctl"
|
description = "dbus interface methods for asusctl"
|
||||||
edition = "2021"
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
asusd = { path = "../asusd" }
|
asusd = { path = "../asusd" }
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rog_platform"
|
name = "rog_platform"
|
||||||
license = "MPL-2.0"
|
license.workspace = true
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
edition = "2021"
|
readme.workspace = true
|
||||||
|
authors.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_derive.workspace = true
|
|
||||||
zbus.workspace = true
|
zbus.workspace = true
|
||||||
concat-idents.workspace = true
|
concat-idents.workspace = true
|
||||||
udev.workspace = true
|
udev.workspace = true
|
||||||
@@ -18,4 +21,3 @@ rusb.workspace = true
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cargo-husky.workspace = true
|
cargo-husky.workspace = true
|
||||||
rog_aura = { path = "../rog-aura" }
|
|
||||||
@@ -27,7 +27,7 @@ impl USBRaw {
|
|||||||
device: &Device<rusb::GlobalContext>,
|
device: &Device<rusb::GlobalContext>,
|
||||||
) -> Result<DeviceHandle<rusb::GlobalContext>> {
|
) -> Result<DeviceHandle<rusb::GlobalContext>> {
|
||||||
// We don't expect this ID to ever change
|
// We don't expect this ID to ever change
|
||||||
let mut device = device.open()?;
|
let device = device.open()?;
|
||||||
device.reset()?;
|
device.reset()?;
|
||||||
device.set_auto_detach_kernel_driver(true)?;
|
device.set_auto_detach_kernel_driver(true)?;
|
||||||
device.claim_interface(0)?;
|
device.claim_interface(0)?;
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rog_profiles"
|
name = "rog_profiles"
|
||||||
license = "MPL-2.0"
|
license.workspace = true
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
authors = ["Luke D. Jones <luke@ljones.dev>"]
|
readme.workspace = true
|
||||||
edition = "2021"
|
authors.workspace = true
|
||||||
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["dbus"]
|
default = ["dbus"]
|
||||||
@@ -21,3 +24,6 @@ zbus = { workspace = true, optional = true }
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cargo-husky.workspace = true
|
cargo-husky.workspace = true
|
||||||
|
|
||||||
|
[package.metadata.cargo-machete]
|
||||||
|
ignored = ["serde"]
|
||||||
|
|||||||
+9
-14
@@ -1,14 +1,15 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rog_slash"
|
name = "rog_slash"
|
||||||
license = "MPL-2.0"
|
license.workspace = true
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
authors = ["Luke <luke@ljones.dev>"]
|
readme.workspace = true
|
||||||
repository = "https://gitlab.com/asus-linux/asus-nb-ctrl"
|
authors.workspace = true
|
||||||
homepage = "https://gitlab.com/asus-linux/asus-nb-ctrl"
|
repository.workspace = true
|
||||||
|
homepage.workspace = true
|
||||||
|
edition.workspace = true
|
||||||
documentation = "https://docs.rs/rog-slash"
|
documentation = "https://docs.rs/rog-slash"
|
||||||
description = "ASUS Slash display"
|
description = "ASUS Slash display"
|
||||||
keywords = ["ROG", "ASUS", "AniMe", "Slash"]
|
keywords = ["ROG", "ASUS", "AniMe", "Slash"]
|
||||||
edition = "2021"
|
|
||||||
exclude = ["data"]
|
exclude = ["data"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
@@ -21,20 +22,14 @@ name = "rog_slash"
|
|||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
png_pong.workspace = true
|
|
||||||
pix.workspace = true
|
|
||||||
gif.workspace = true
|
|
||||||
log.workspace = true
|
|
||||||
|
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_derive.workspace = true
|
serde_derive.workspace = true
|
||||||
|
|
||||||
glam.workspace = true
|
|
||||||
typeshare.workspace = true
|
typeshare.workspace = true
|
||||||
|
|
||||||
zbus = { workspace = true, optional = true }
|
zbus = { workspace = true, optional = true }
|
||||||
|
|
||||||
dmi_id = { path = "../dmi-id", optional = true }
|
dmi_id = { path = "../dmi-id", optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
cargo-husky.workspace = true
|
cargo-husky.workspace = true
|
||||||
|
|
||||||
|
[package.metadata.cargo-machete]
|
||||||
|
ignored = ["serde"]
|
||||||
|
|||||||
+6
-12
@@ -1,14 +1,12 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rog_simulators"
|
name = "rog_simulators"
|
||||||
license = "MPL-2.0"
|
license.workspace = true
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
readme = "README.md"
|
readme.workspace = true
|
||||||
authors = ["Luke <luke@ljones.dev>"]
|
authors.workspace = true
|
||||||
repository = "https://gitlab.com/asus-linux/asus-nb-ctrl"
|
repository.workspace = true
|
||||||
homepage = "https://gitlab.com/asus-linux/asus-nb-ctrl"
|
homepage.workspace = true
|
||||||
documentation = "https://docs.rs/rog-anime"
|
edition.workspace = true
|
||||||
edition = "2021"
|
|
||||||
exclude = ["data"]
|
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "anime_sim"
|
name = "anime_sim"
|
||||||
@@ -17,11 +15,7 @@ path = "src/simulator.rs"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
|
|
||||||
glam.workspace = true
|
|
||||||
|
|
||||||
uhid-virt = "^0.0.7"
|
uhid-virt = "^0.0.7"
|
||||||
|
|
||||||
rog_anime = { path = "../rog-anime", features = ["dbus"] }
|
rog_anime = { path = "../rog-anime", features = ["dbus"] }
|
||||||
|
|
||||||
[dependencies.sdl2]
|
[dependencies.sdl2]
|
||||||
|
|||||||
Reference in New Issue
Block a user