mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
prep new release
This commit is contained in:
@@ -4,12 +4,16 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
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 4.1.0]
|
## [Unreleased ]
|
||||||
|
|
||||||
|
## [4.1.0] - 2022-06-20
|
||||||
### Changed
|
### Changed
|
||||||
- Huge refactor to use zbus 2.2 + zvariant 3.0 in system-daemon. More work required.
|
- Huge refactor to use zbus 2.2 + zvariant 3.0 in system-daemon. More work required.
|
||||||
- Daemons with tasks not use `smol` for async ops.
|
- Daemons with tasks not use `smol` for async ops.
|
||||||
- Fixes to fan-curve settings from CLI (Author: Armas Span)
|
- Fixes to fan-curve settings from CLI (Author: Armas Span)
|
||||||
- Add brightness to anime zbus notification
|
- Add brightness to anime zbus notification
|
||||||
|
- Adjust how threads in AniMe matrix controller work
|
||||||
|
- Use proper power-state packet for keyboard LED's (Author: Martin Piffault)
|
||||||
### Added
|
### Added
|
||||||
- Support for GA402R LED modes
|
- Support for GA402R LED modes
|
||||||
- Support for GU502LV LED modes
|
- Support for GU502LV LED modes
|
||||||
@@ -17,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Support for G513IC LED modes (Author: dada513)
|
- Support for G513IC LED modes (Author: dada513)
|
||||||
- Support for G513QM LED modes (Author: Martin Piffault)
|
- Support for G513QM LED modes (Author: Martin Piffault)
|
||||||
- Add side-LED toggle support (Author: Martin Piffault)
|
- Add side-LED toggle support (Author: Martin Piffault)
|
||||||
- Support reloading keyboard brightness and mode on wake (from sleep/hiber)
|
- Support reloading keyboard mode on wake (from sleep/hiber)
|
||||||
- Support reloading charge-level on wake (from sleep/hiber)
|
- Support reloading charge-level on wake (from sleep/hiber)
|
||||||
- Support running AniMe animation blocks on wake/sleep and boot/shutdown events
|
- Support running AniMe animation blocks on wake/sleep and boot/shutdown events
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use crate::laptops::LaptopLedData;
|
use crate::laptops::LaptopLedData;
|
||||||
use log::{error, info, warn};
|
use log::{error, info, warn};
|
||||||
use rog_aura::{AuraEffect, AuraModeNum, AuraZone, LedBrightness};
|
use rog_aura::{AuraEffect, AuraModeNum, AuraZone, LedBrightness, LedPowerStates};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde_derive::{Deserialize, Serialize};
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::fs::{File, OpenOptions};
|
use std::fs::{File, OpenOptions};
|
||||||
@@ -8,30 +8,6 @@ use std::io::{Read, Write};
|
|||||||
|
|
||||||
pub static AURA_CONFIG_PATH: &str = "/etc/asusd/aura.conf";
|
pub static AURA_CONFIG_PATH: &str = "/etc/asusd/aura.conf";
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize)]
|
|
||||||
pub struct AuraConfigV320 {
|
|
||||||
pub brightness: u32,
|
|
||||||
pub current_mode: AuraModeNum,
|
|
||||||
pub builtins: BTreeMap<AuraModeNum, AuraEffect>,
|
|
||||||
pub multizone: Option<AuraMultiZone>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl AuraConfigV320 {
|
|
||||||
pub(crate) fn into_current(self) -> AuraConfig {
|
|
||||||
AuraConfig {
|
|
||||||
brightness: <LedBrightness>::from(self.brightness),
|
|
||||||
current_mode: self.current_mode,
|
|
||||||
builtins: self.builtins,
|
|
||||||
multizone: self.multizone,
|
|
||||||
boot_anim_enabled: true,
|
|
||||||
sleep_anim_enabled: true,
|
|
||||||
all_leds_enabled: true,
|
|
||||||
keys_leds_enabled: true,
|
|
||||||
side_leds_enabled: true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize)]
|
#[derive(Deserialize, Serialize)]
|
||||||
pub struct AuraConfigV352 {
|
pub struct AuraConfigV352 {
|
||||||
pub brightness: LedBrightness,
|
pub brightness: LedBrightness,
|
||||||
@@ -47,11 +23,13 @@ impl AuraConfigV352 {
|
|||||||
current_mode: self.current_mode,
|
current_mode: self.current_mode,
|
||||||
builtins: self.builtins,
|
builtins: self.builtins,
|
||||||
multizone: self.multizone,
|
multizone: self.multizone,
|
||||||
boot_anim_enabled: true,
|
power_states: LedPowerStates {
|
||||||
sleep_anim_enabled: true,
|
boot_anim: true,
|
||||||
all_leds_enabled: true,
|
sleep_anim: true,
|
||||||
keys_leds_enabled: true,
|
all_leds: true,
|
||||||
side_leds_enabled: true,
|
keys_leds: true,
|
||||||
|
side_leds: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -74,11 +52,13 @@ impl AuraConfigV407 {
|
|||||||
current_mode: self.current_mode,
|
current_mode: self.current_mode,
|
||||||
builtins: self.builtins,
|
builtins: self.builtins,
|
||||||
multizone: self.multizone,
|
multizone: self.multizone,
|
||||||
boot_anim_enabled: true,
|
power_states: LedPowerStates {
|
||||||
sleep_anim_enabled: self.sleep_anim_enabled,
|
boot_anim: true,
|
||||||
all_leds_enabled: self.awake_enabled,
|
sleep_anim: self.sleep_anim_enabled,
|
||||||
keys_leds_enabled: self.awake_enabled,
|
all_leds: self.awake_enabled,
|
||||||
side_leds_enabled: self.side_leds_enabled,
|
keys_leds: self.awake_enabled,
|
||||||
|
side_leds: self.side_leds_enabled,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -89,11 +69,7 @@ pub struct AuraConfig {
|
|||||||
pub current_mode: AuraModeNum,
|
pub current_mode: AuraModeNum,
|
||||||
pub builtins: BTreeMap<AuraModeNum, AuraEffect>,
|
pub builtins: BTreeMap<AuraModeNum, AuraEffect>,
|
||||||
pub multizone: Option<AuraMultiZone>,
|
pub multizone: Option<AuraMultiZone>,
|
||||||
pub boot_anim_enabled: bool,
|
pub power_states: LedPowerStates,
|
||||||
pub sleep_anim_enabled: bool,
|
|
||||||
pub all_leds_enabled: bool,
|
|
||||||
pub keys_leds_enabled: bool,
|
|
||||||
pub side_leds_enabled: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for AuraConfig {
|
impl Default for AuraConfig {
|
||||||
@@ -103,11 +79,13 @@ impl Default for AuraConfig {
|
|||||||
current_mode: AuraModeNum::Static,
|
current_mode: AuraModeNum::Static,
|
||||||
builtins: BTreeMap::new(),
|
builtins: BTreeMap::new(),
|
||||||
multizone: None,
|
multizone: None,
|
||||||
boot_anim_enabled: true,
|
power_states: LedPowerStates {
|
||||||
sleep_anim_enabled: true,
|
boot_anim: true,
|
||||||
all_leds_enabled: true,
|
sleep_anim: true,
|
||||||
keys_leds_enabled: true,
|
all_leds: true,
|
||||||
side_leds_enabled: true,
|
keys_leds: true,
|
||||||
|
side_leds: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,11 +111,6 @@ impl AuraConfig {
|
|||||||
} else {
|
} else {
|
||||||
if let Ok(data) = serde_json::from_str(&buf) {
|
if let Ok(data) = serde_json::from_str(&buf) {
|
||||||
return data;
|
return data;
|
||||||
} else if let Ok(data) = serde_json::from_str::<AuraConfigV320>(&buf) {
|
|
||||||
let config = data.into_current();
|
|
||||||
config.write();
|
|
||||||
info!("Updated AuraConfig version");
|
|
||||||
return config;
|
|
||||||
} else if let Ok(data) = serde_json::from_str::<AuraConfigV352>(&buf) {
|
} else if let Ok(data) = serde_json::from_str::<AuraConfigV352>(&buf) {
|
||||||
let config = data.into_current();
|
let config = data.into_current();
|
||||||
config.write();
|
config.write();
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ impl CtrlKbdLed {
|
|||||||
match Self::find_led_node(prod) {
|
match Self::find_led_node(prod) {
|
||||||
Ok(node) => {
|
Ok(node) => {
|
||||||
led_node = Some(node);
|
led_node = Some(node);
|
||||||
info!("Found keyboard controller 0x{prod}");
|
info!("Looked for keyboard controller 0x{prod}: Found");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Err(err) => info!("Looked for keyboard controller 0x{prod}: {err}"),
|
Err(err) => info!("Looked for keyboard controller 0x{prod}: {err}"),
|
||||||
@@ -280,11 +280,11 @@ impl CtrlKbdLed {
|
|||||||
/// Set combination state for boot animation/sleep animation/all leds/keys leds/side leds LED active
|
/// Set combination state for boot animation/sleep animation/all leds/keys leds/side leds LED active
|
||||||
pub(super) fn set_power_states(&self, config: &AuraConfig) -> Result<(), RogError> {
|
pub(super) fn set_power_states(&self, config: &AuraConfig) -> Result<(), RogError> {
|
||||||
let bytes = leds_message(
|
let bytes = leds_message(
|
||||||
config.boot_anim_enabled,
|
config.power_states.boot_anim,
|
||||||
config.sleep_anim_enabled,
|
config.power_states.sleep_anim,
|
||||||
config.all_leds_enabled,
|
config.power_states.all_leds,
|
||||||
config.keys_leds_enabled,
|
config.power_states.keys_leds,
|
||||||
config.side_leds_enabled,
|
config.power_states.side_leds,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Quite ugly, must be a more idiomatic way to do
|
// Quite ugly, must be a more idiomatic way to do
|
||||||
|
|||||||
@@ -34,20 +34,14 @@ impl CtrlKbdLedZbus {
|
|||||||
) {
|
) {
|
||||||
let mut states = None;
|
let mut states = None;
|
||||||
if let Ok(mut ctrl) = self.0.try_lock() {
|
if let Ok(mut ctrl) = self.0.try_lock() {
|
||||||
ctrl.config.boot_anim_enabled = enabled;
|
ctrl.config.power_states.boot_anim = enabled;
|
||||||
ctrl.config.write();
|
ctrl.config.write();
|
||||||
|
|
||||||
ctrl.set_power_states(&ctrl.config)
|
ctrl.set_power_states(&ctrl.config)
|
||||||
.map_err(|err| warn!("{}", err))
|
.map_err(|err| warn!("{}", err))
|
||||||
.ok();
|
.ok();
|
||||||
|
|
||||||
states = Some(LedPowerStates {
|
states = Some(ctrl.config.power_states);
|
||||||
boot_anim: ctrl.config.boot_anim_enabled,
|
|
||||||
sleep_anim: ctrl.config.sleep_anim_enabled,
|
|
||||||
all_leds: ctrl.config.all_leds_enabled,
|
|
||||||
keys_leds: ctrl.config.keys_leds_enabled,
|
|
||||||
side_leds: ctrl.config.side_leds_enabled,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
// Need to pull state out like this due to MutexGuard
|
// Need to pull state out like this due to MutexGuard
|
||||||
if let Some(states) = states {
|
if let Some(states) = states {
|
||||||
@@ -65,20 +59,14 @@ impl CtrlKbdLedZbus {
|
|||||||
) {
|
) {
|
||||||
let mut states = None;
|
let mut states = None;
|
||||||
if let Ok(mut ctrl) = self.0.try_lock() {
|
if let Ok(mut ctrl) = self.0.try_lock() {
|
||||||
ctrl.config.sleep_anim_enabled = enabled;
|
ctrl.config.power_states.sleep_anim = enabled;
|
||||||
ctrl.config.write();
|
ctrl.config.write();
|
||||||
|
|
||||||
ctrl.set_power_states(&ctrl.config)
|
ctrl.set_power_states(&ctrl.config)
|
||||||
.map_err(|err| warn!("{}", err))
|
.map_err(|err| warn!("{}", err))
|
||||||
.ok();
|
.ok();
|
||||||
|
|
||||||
states = Some(LedPowerStates {
|
states = Some(ctrl.config.power_states);
|
||||||
boot_anim: ctrl.config.boot_anim_enabled,
|
|
||||||
sleep_anim: ctrl.config.sleep_anim_enabled,
|
|
||||||
all_leds: ctrl.config.all_leds_enabled,
|
|
||||||
keys_leds: ctrl.config.keys_leds_enabled,
|
|
||||||
side_leds: ctrl.config.side_leds_enabled,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if let Some(states) = states {
|
if let Some(states) = states {
|
||||||
Self::notify_power_states(&ctxt, &states)
|
Self::notify_power_states(&ctxt, &states)
|
||||||
@@ -95,22 +83,16 @@ impl CtrlKbdLedZbus {
|
|||||||
) {
|
) {
|
||||||
let mut states = None;
|
let mut states = None;
|
||||||
if let Ok(mut ctrl) = self.0.try_lock() {
|
if let Ok(mut ctrl) = self.0.try_lock() {
|
||||||
ctrl.config.all_leds_enabled = enabled;
|
ctrl.config.power_states.all_leds = enabled;
|
||||||
ctrl.config.keys_leds_enabled = enabled;
|
ctrl.config.power_states.keys_leds = enabled;
|
||||||
ctrl.config.side_leds_enabled = enabled;
|
ctrl.config.power_states.side_leds = enabled;
|
||||||
ctrl.config.write();
|
ctrl.config.write();
|
||||||
|
|
||||||
ctrl.set_power_states(&ctrl.config)
|
ctrl.set_power_states(&ctrl.config)
|
||||||
.map_err(|err| warn!("{}", err))
|
.map_err(|err| warn!("{}", err))
|
||||||
.ok();
|
.ok();
|
||||||
|
|
||||||
states = Some(LedPowerStates {
|
states = Some(ctrl.config.power_states);
|
||||||
boot_anim: ctrl.config.boot_anim_enabled,
|
|
||||||
sleep_anim: ctrl.config.sleep_anim_enabled,
|
|
||||||
all_leds: ctrl.config.all_leds_enabled,
|
|
||||||
keys_leds: ctrl.config.keys_leds_enabled,
|
|
||||||
side_leds: ctrl.config.side_leds_enabled,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
// Need to pull state out like this due to MutexGuard
|
// Need to pull state out like this due to MutexGuard
|
||||||
if let Some(states) = states {
|
if let Some(states) = states {
|
||||||
@@ -128,20 +110,14 @@ impl CtrlKbdLedZbus {
|
|||||||
) {
|
) {
|
||||||
let mut states = None;
|
let mut states = None;
|
||||||
if let Ok(mut ctrl) = self.0.try_lock() {
|
if let Ok(mut ctrl) = self.0.try_lock() {
|
||||||
ctrl.config.keys_leds_enabled = enabled;
|
ctrl.config.power_states.keys_leds = enabled;
|
||||||
ctrl.config.write();
|
ctrl.config.write();
|
||||||
|
|
||||||
ctrl.set_power_states(&ctrl.config)
|
ctrl.set_power_states(&ctrl.config)
|
||||||
.map_err(|err| warn!("{}", err))
|
.map_err(|err| warn!("{}", err))
|
||||||
.ok();
|
.ok();
|
||||||
|
|
||||||
states = Some(LedPowerStates {
|
states = Some(ctrl.config.power_states);
|
||||||
boot_anim: ctrl.config.boot_anim_enabled,
|
|
||||||
sleep_anim: ctrl.config.sleep_anim_enabled,
|
|
||||||
all_leds: ctrl.config.all_leds_enabled,
|
|
||||||
keys_leds: ctrl.config.keys_leds_enabled,
|
|
||||||
side_leds: ctrl.config.side_leds_enabled,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
// Need to pull state out like this due to MutexGuard
|
// Need to pull state out like this due to MutexGuard
|
||||||
if let Some(states) = states {
|
if let Some(states) = states {
|
||||||
@@ -159,20 +135,14 @@ impl CtrlKbdLedZbus {
|
|||||||
) {
|
) {
|
||||||
let mut states = None;
|
let mut states = None;
|
||||||
if let Ok(mut ctrl) = self.0.try_lock() {
|
if let Ok(mut ctrl) = self.0.try_lock() {
|
||||||
ctrl.config.side_leds_enabled = enabled;
|
ctrl.config.power_states.side_leds = enabled;
|
||||||
ctrl.config.write();
|
ctrl.config.write();
|
||||||
|
|
||||||
ctrl.set_power_states(&ctrl.config)
|
ctrl.set_power_states(&ctrl.config)
|
||||||
.map_err(|err| warn!("{}", err))
|
.map_err(|err| warn!("{}", err))
|
||||||
.ok();
|
.ok();
|
||||||
|
|
||||||
states = Some(LedPowerStates {
|
states = Some(ctrl.config.power_states);
|
||||||
boot_anim: ctrl.config.boot_anim_enabled,
|
|
||||||
sleep_anim: ctrl.config.sleep_anim_enabled,
|
|
||||||
all_leds: ctrl.config.all_leds_enabled,
|
|
||||||
keys_leds: ctrl.config.keys_leds_enabled,
|
|
||||||
side_leds: ctrl.config.side_leds_enabled,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
// Need to pull state out like this due to MutexGuard
|
// Need to pull state out like this due to MutexGuard
|
||||||
if let Some(states) = states {
|
if let Some(states) = states {
|
||||||
@@ -258,7 +228,7 @@ impl CtrlKbdLedZbus {
|
|||||||
#[dbus_interface(property)]
|
#[dbus_interface(property)]
|
||||||
async fn boot_enabled(&self) -> bool {
|
async fn boot_enabled(&self) -> bool {
|
||||||
if let Ok(ctrl) = self.0.try_lock() {
|
if let Ok(ctrl) = self.0.try_lock() {
|
||||||
return ctrl.config.boot_anim_enabled;
|
return ctrl.config.power_states.boot_anim;
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
@@ -266,7 +236,7 @@ impl CtrlKbdLedZbus {
|
|||||||
#[dbus_interface(property)]
|
#[dbus_interface(property)]
|
||||||
async fn sleep_enabled(&self) -> bool {
|
async fn sleep_enabled(&self) -> bool {
|
||||||
if let Ok(ctrl) = self.0.try_lock() {
|
if let Ok(ctrl) = self.0.try_lock() {
|
||||||
return ctrl.config.sleep_anim_enabled;
|
return ctrl.config.power_states.sleep_anim;
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
@@ -274,7 +244,7 @@ impl CtrlKbdLedZbus {
|
|||||||
#[dbus_interface(property)]
|
#[dbus_interface(property)]
|
||||||
async fn all_leds_enabled(&self) -> bool {
|
async fn all_leds_enabled(&self) -> bool {
|
||||||
if let Ok(ctrl) = self.0.try_lock() {
|
if let Ok(ctrl) = self.0.try_lock() {
|
||||||
return ctrl.config.all_leds_enabled;
|
return ctrl.config.power_states.all_leds;
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
@@ -282,7 +252,7 @@ impl CtrlKbdLedZbus {
|
|||||||
#[dbus_interface(property)]
|
#[dbus_interface(property)]
|
||||||
async fn keys_leds_enabled(&self) -> bool {
|
async fn keys_leds_enabled(&self) -> bool {
|
||||||
if let Ok(ctrl) = self.0.try_lock() {
|
if let Ok(ctrl) = self.0.try_lock() {
|
||||||
return ctrl.config.keys_leds_enabled;
|
return ctrl.config.power_states.keys_leds;
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
@@ -290,7 +260,7 @@ impl CtrlKbdLedZbus {
|
|||||||
#[dbus_interface(property)]
|
#[dbus_interface(property)]
|
||||||
fn side_leds_enabled(&self) -> bool {
|
fn side_leds_enabled(&self) -> bool {
|
||||||
if let Ok(ctrl) = self.0.try_lock() {
|
if let Ok(ctrl) = self.0.try_lock() {
|
||||||
return ctrl.config.side_leds_enabled;
|
return ctrl.config.power_states.side_leds;
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user