mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f0c5c3af86 | |||
| 96b0f40886 | |||
| 4a5f029e53 |
@@ -6,5 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.0.2] - 2020-08-13
|
||||||
|
### Changed
|
||||||
|
- Bugfixes to led brightness watcher
|
||||||
|
- Bufixes to await/async tasks
|
||||||
|
|
||||||
|
## [1.0.1] - 2020-08-13
|
||||||
|
|
||||||
|
- Fix small deadlock with awaits
|
||||||
|
|
||||||
## [1.0.0] - 2020-08-13
|
## [1.0.0] - 2020-08-13
|
||||||
|
|
||||||
- Major fork and refactor to use asus-hid patch for ASUS N-Key device
|
- Major fork and refactor to use asus-hid patch for ASUS N-Key device
|
||||||
|
|||||||
Generated
+1
-1
@@ -30,7 +30,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "asus-nb-ctrl"
|
name = "asus-nb-ctrl"
|
||||||
version = "1.0.0"
|
version = "1.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"asus-nb",
|
"asus-nb",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "asus-nb-ctrl"
|
name = "asus-nb-ctrl"
|
||||||
version = "1.0.0"
|
version = "1.0.2"
|
||||||
license = "MPL-2.0"
|
license = "MPL-2.0"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = ["Luke <luke@ljones.dev>"]
|
authors = ["Luke <luke@ljones.dev>"]
|
||||||
|
|||||||
@@ -41,22 +41,19 @@ impl crate::Controller for CtrlFanAndCPU {
|
|||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
while let Some(mode) = recv.recv().await {
|
while let Some(mode) = recv.recv().await {
|
||||||
let mut config = config1.lock().await;
|
let mut config = config1.lock().await;
|
||||||
if let Ok(mut lock) = gate1.try_lock() {
|
let mut lock = gate1.lock().await;
|
||||||
lock.set_fan_mode(mode, &mut config)
|
lock.set_fan_mode(mode, &mut config)
|
||||||
.unwrap_or_else(|err| warn!("{:?}", err));
|
.unwrap_or_else(|err| warn!("{:?}", err));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
// need to watch file path
|
// need to watch file path
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
loop {
|
loop {
|
||||||
if let Ok(mut lock) = gate2.try_lock() {
|
tokio::time::delay_for(std::time::Duration::from_millis(100)).await;
|
||||||
let mut config = config.lock().await;
|
let mut lock = gate2.lock().await;
|
||||||
lock.fan_mode_check_change(&mut config)
|
let mut config = config.lock().await;
|
||||||
.unwrap_or_else(|err| warn!("{:?}", err));
|
lock.fan_mode_check_change(&mut config)
|
||||||
}
|
.unwrap_or_else(|err| warn!("{:?}", err));
|
||||||
|
|
||||||
tokio::time::delay_for(std::time::Duration::from_millis(500)).await;
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -76,11 +76,11 @@ impl crate::Controller for CtrlKbdBacklight {
|
|||||||
}),
|
}),
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
loop {
|
loop {
|
||||||
|
tokio::time::delay_for(std::time::Duration::from_millis(100)).await;
|
||||||
let mut lock = gate2.lock().await;
|
let mut lock = gate2.lock().await;
|
||||||
let mut config = config.lock().await;
|
let mut config = config.lock().await;
|
||||||
lock.let_bright_check_change(&mut config)
|
lock.let_bright_check_change(&mut config)
|
||||||
.unwrap_or_else(|err| warn!("{:?}", err));
|
.unwrap_or_else(|err| warn!("{:?}", err));
|
||||||
tokio::time::delay_for(std::time::Duration::from_millis(500)).await;
|
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
@@ -148,7 +148,7 @@ impl CtrlKbdBacklight {
|
|||||||
for device in enumerator.scan_devices()? {
|
for device in enumerator.scan_devices()? {
|
||||||
if let Some(parent) = device.parent_with_subsystem_devtype("usb", "usb_device")? {
|
if let Some(parent) = device.parent_with_subsystem_devtype("usb", "usb_device")? {
|
||||||
if parent.attribute_value("idProduct").unwrap() == id_product {
|
if parent.attribute_value("idProduct").unwrap() == id_product {
|
||||||
// && device.parent().unwrap().sysnum().unwrap() == 3
|
// && device.parent().unwrap().sysnum().unwrap() == 3
|
||||||
if let Some(dev_node) = device.devnode() {
|
if let Some(dev_node) = device.devnode() {
|
||||||
info!("Using device at: {:?} for LED control", dev_node);
|
info!("Using device at: {:?} for LED control", dev_node);
|
||||||
return Ok(dev_node.to_string_lossy().to_string());
|
return Ok(dev_node.to_string_lossy().to_string());
|
||||||
@@ -190,7 +190,7 @@ impl CtrlKbdBacklight {
|
|||||||
let mut buf = [0u8; 1];
|
let mut buf = [0u8; 1];
|
||||||
file.read_exact(&mut buf)?;
|
file.read_exact(&mut buf)?;
|
||||||
if let Some(num) = char::from(buf[0]).to_digit(10) {
|
if let Some(num) = char::from(buf[0]).to_digit(10) {
|
||||||
if config.power_profile != num as u8 {
|
if config.kbd_led_brightness != num as u8 {
|
||||||
config.read();
|
config.read();
|
||||||
config.kbd_led_brightness = num as u8;
|
config.kbd_led_brightness = num as u8;
|
||||||
config.write();
|
config.write();
|
||||||
|
|||||||
@@ -4,11 +4,15 @@ use daemon::{
|
|||||||
laptops::match_laptop,
|
laptops::match_laptop,
|
||||||
};
|
};
|
||||||
|
|
||||||
use dbus::{channel::Sender, nonblock::SyncConnection, tree::Signal};
|
use dbus::{
|
||||||
|
channel::Sender,
|
||||||
|
nonblock::{Process, SyncConnection},
|
||||||
|
tree::Signal,
|
||||||
|
};
|
||||||
|
use dbus_tokio::connection;
|
||||||
|
|
||||||
use asus_nb::{DBUS_IFACE, DBUS_NAME, DBUS_PATH};
|
use asus_nb::{DBUS_IFACE, DBUS_NAME, DBUS_PATH};
|
||||||
use daemon::Controller;
|
use daemon::Controller;
|
||||||
use dbus_tokio::connection;
|
|
||||||
use log::LevelFilter;
|
use log::LevelFilter;
|
||||||
use log::{error, info, warn};
|
use log::{error, info, warn};
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
@@ -161,6 +165,7 @@ pub async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connection.process_all();
|
||||||
for handle in handles {
|
for handle in handles {
|
||||||
handle.await?;
|
handle.await?;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ use std::sync::Arc;
|
|||||||
use tokio::sync::{mpsc::Receiver, Mutex};
|
use tokio::sync::{mpsc::Receiver, Mutex};
|
||||||
use tokio::task::JoinHandle;
|
use tokio::task::JoinHandle;
|
||||||
|
|
||||||
pub static VERSION: &str = "1.0.0";
|
pub static VERSION: &str = "1.0.2";
|
||||||
|
|
||||||
use ::dbus::{nonblock::SyncConnection, tree::Signal};
|
use ::dbus::{nonblock::SyncConnection, tree::Signal};
|
||||||
|
|
||||||
|
|||||||
@@ -18,4 +18,3 @@ impl fmt::Display for AuraError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user