mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Remove around 14 transitive dependencies
This commit is contained in:
117
Cargo.lock
generated
117
Cargo.lock
generated
@@ -15,15 +15,6 @@ dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ansi_term"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
|
||||
dependencies = [
|
||||
"winapi 0.3.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "atty"
|
||||
version = "0.2.14"
|
||||
@@ -37,26 +28,22 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bindgen"
|
||||
version = "0.53.3"
|
||||
version = "0.54.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c72a978d268b1d70b0e963217e60fdabd9523a941457a6c42a7315d15c7e89e5"
|
||||
checksum = "66c0bb6167449588ff70803f4127f0684f9063097eca5016f37eb52b92c2cf36"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cexpr",
|
||||
"cfg-if",
|
||||
"clang-sys",
|
||||
"clap",
|
||||
"env_logger",
|
||||
"lazy_static",
|
||||
"lazycell",
|
||||
"log",
|
||||
"peeking_take_while",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
"rustc-hash",
|
||||
"shlex",
|
||||
"which",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -91,9 +78,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.55"
|
||||
version = "1.0.56"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b1be3409f94d7bdceeb5f5fac551039d9b3f00e25da7a74fc4d33400a0d96368"
|
||||
checksum = "77c1f1d60091c1b73e2b1f4560ab419204b178e625fa945ded7b660becd2bd46"
|
||||
|
||||
[[package]]
|
||||
name = "cexpr"
|
||||
@@ -118,22 +105,6 @@ checksum = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a"
|
||||
dependencies = [
|
||||
"glob",
|
||||
"libc",
|
||||
"libloading",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "2.33.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129"
|
||||
dependencies = [
|
||||
"ansi_term",
|
||||
"atty",
|
||||
"bitflags",
|
||||
"strsim",
|
||||
"textwrap",
|
||||
"unicode-width",
|
||||
"vec_map",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -474,16 +445,6 @@ dependencies = [
|
||||
"take_mut",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libloading"
|
||||
version = "0.5.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"winapi 0.3.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libusb1-sys"
|
||||
version = "0.3.7"
|
||||
@@ -743,7 +704,6 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"thiserror",
|
||||
"tinybmp",
|
||||
"yansi-term",
|
||||
]
|
||||
@@ -764,7 +724,6 @@ dependencies = [
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"sysfs-class",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"uhid-virt",
|
||||
]
|
||||
@@ -852,9 +811,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.55"
|
||||
version = "1.0.56"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec2c5d7e739bc07a3e73381a39d61fdb5f671c60c1df26a130690665803d8226"
|
||||
checksum = "3433e879a558dde8b5e8feb2a04899cf34fdde1fafb894687e52105fc1162ac3"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"ryu",
|
||||
@@ -884,12 +843,6 @@ dependencies = [
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "strsim"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.33"
|
||||
@@ -960,35 +913,6 @@ dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "textwrap"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
|
||||
dependencies = [
|
||||
"unicode-width",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08"
|
||||
dependencies = [
|
||||
"thiserror-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "1.0.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thread_local"
|
||||
version = "1.0.1"
|
||||
@@ -1037,9 +961,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "uhid-virt"
|
||||
version = "0.0.4"
|
||||
version = "0.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "057ecb2608f960fd97c220557339335bf7cef77ae77b71fb342d9555e396c00c"
|
||||
checksum = "7e317bfbb0281bb799f4802d62261a798443a88df4352f302269ad32b4cfc822"
|
||||
dependencies = [
|
||||
"enumflags2",
|
||||
"libc",
|
||||
@@ -1048,19 +972,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "uhidrs-sys"
|
||||
version = "1.0.0"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d78b2a68a0769dc3b501bcc9127f561220ff54b485b3dd9aa97718fda91dbdaa"
|
||||
checksum = "bfcc3b1a199338bcfe0e64b3c427ffab84514e7b23f9402d7fef9b38c0a9916e"
|
||||
dependencies = [
|
||||
"bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-width"
|
||||
version = "0.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-xid"
|
||||
version = "0.2.1"
|
||||
@@ -1073,27 +991,12 @@ version = "0.2.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"
|
||||
|
||||
[[package]]
|
||||
name = "vec_map"
|
||||
version = "0.8.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
|
||||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
version = "0.9.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
|
||||
|
||||
[[package]]
|
||||
name = "which"
|
||||
version = "3.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.2.8"
|
||||
|
||||
@@ -10,13 +10,12 @@ description = "A small library of effect types and conversions for ROG Aura"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
gumdrop = "^0.8.0"
|
||||
dbus = { version = "^0.8.2" }
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
serde_json = "1.0"
|
||||
thiserror = "^1.0.15"
|
||||
yansi-term = "0.1.2"
|
||||
gumdrop = "^0.8"
|
||||
dbus = { version = "^0.8" }
|
||||
serde = "^1.0"
|
||||
serde_derive = "^1.0"
|
||||
serde_json = "^1.0"
|
||||
yansi-term = "^0.1"
|
||||
|
||||
[dev-dependencies]
|
||||
tinybmp = "0.2.3"
|
||||
tinybmp = "^0.2.3"
|
||||
@@ -1,18 +1,20 @@
|
||||
use std::fmt::Debug;
|
||||
use thiserror::Error;
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum AuraError {
|
||||
#[error("unable to parse string to colour")]
|
||||
ParseColour,
|
||||
#[error("unable to parse string to speed")]
|
||||
ParseSpeed,
|
||||
#[error("unable to parse string to direction")]
|
||||
ParseDirection,
|
||||
#[error("unable to parse string to brightness")]
|
||||
ParseBrightness,
|
||||
#[error("could not poll the keyboard for input")]
|
||||
PollKeyboard,
|
||||
#[error("mode not supported")]
|
||||
NotSupported,
|
||||
}
|
||||
|
||||
impl fmt::Display for AuraError {
|
||||
// This trait requires `fmt` with this exact signature.
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
AuraError::ParseColour => write!(f, "Could not parse colour"),
|
||||
AuraError::ParseSpeed => write!(f, "Could not parse speed"),
|
||||
AuraError::ParseDirection => write!(f, "Could not parse direction"),
|
||||
AuraError::ParseBrightness => write!(f, "Could not parse brightness"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,19 +29,17 @@ env_logger = "^0.7.1"
|
||||
# async
|
||||
dbus = { version = "^0.8.2", features = ["futures"] }
|
||||
dbus-tokio = "^0.5.1"
|
||||
tokio = { version = "0.2.4", features = ["rt-threaded", "sync"] }
|
||||
tokio = { version = "^0.2.4", features = ["rt-threaded", "sync"] }
|
||||
|
||||
# serialisation
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
serde_json = "1.0"
|
||||
serde = "^1.0"
|
||||
serde_derive = "^1.0"
|
||||
serde_json = "^1.0"
|
||||
|
||||
# Device control
|
||||
sysfs-class = "^0.1.2" # used for backlight control and baord ID
|
||||
# cpu power management
|
||||
intel-pstate = "^0.2.1"
|
||||
# virtualisation of HID, mainly for outputting consumer key codes
|
||||
uhid-virt = "^0.0.4"
|
||||
#keycode = "0.3"
|
||||
|
||||
thiserror = "^1.0.15"
|
||||
uhid-virt = "^0.0.5"
|
||||
#keycode = "^0.3"
|
||||
@@ -62,7 +62,10 @@ pub async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
||||
laptop.led_endpoint(),
|
||||
laptop.supported_modes().to_owned(),
|
||||
);
|
||||
led_writer.reload_last_builtin(&config).await?;
|
||||
led_writer
|
||||
.reload_last_builtin(&config)
|
||||
.await
|
||||
.unwrap_or_else(|err| warn!("Reload settings: {}", err));
|
||||
|
||||
// Set up the mutexes
|
||||
let config = Arc::new(Mutex::new(config));
|
||||
@@ -107,7 +110,7 @@ pub async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
||||
animatrix_writer
|
||||
.do_command(AnimatrixCommand::WriteImage(image))
|
||||
.await
|
||||
.unwrap_or_else(|err| warn!("{:?}", err));
|
||||
.unwrap_or_else(|err| warn!("{}", err));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -141,7 +144,7 @@ pub async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
||||
laptop
|
||||
.run(&mut rogcore, &config1, bytes, aura_command_sender.clone())
|
||||
.await
|
||||
.unwrap_or_else(|err| warn!("{:?}", err));
|
||||
.unwrap_or_else(|err| warn!("{}", err));
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -192,13 +195,13 @@ pub async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
||||
led_writer
|
||||
.do_command(command, &mut config)
|
||||
.await
|
||||
.unwrap_or_else(|err| warn!("{:?}", err));
|
||||
.unwrap_or_else(|err| warn!("{}", err));
|
||||
}
|
||||
_ => {
|
||||
led_writer
|
||||
.do_command(command, &mut config)
|
||||
.await
|
||||
.unwrap_or_else(|err| warn!("{:?}", err));
|
||||
.unwrap_or_else(|err| warn!("{}", err));
|
||||
connection
|
||||
.send(
|
||||
effect_cancel_signal
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
use std::fmt::Debug;
|
||||
use thiserror::Error;
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum RogError {
|
||||
#[error("unable to parse string to fan mode")]
|
||||
ParseFanLevel,
|
||||
#[error("mode not supported")]
|
||||
NotSupported,
|
||||
}
|
||||
|
||||
impl fmt::Display for RogError {
|
||||
// This trait requires `fmt` with this exact signature.
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
RogError::ParseFanLevel => write!(f, "Parse error"),
|
||||
RogError::NotSupported => write!(f, "Not supported"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,10 @@ static LED_INIT5: [u8; 6] = [0x5e, 0x05, 0x20, 0x31, 0, 0x08];
|
||||
static LED_APPLY: [u8; 17] = [0x5d, 0xb4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||
static LED_SET: [u8; 17] = [0x5d, 0xb5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||
|
||||
use crate::config::Config;
|
||||
use crate::{config::Config, error::RogError};
|
||||
use log::{error, info, warn};
|
||||
use rog_client::{
|
||||
aura_brightness_bytes, aura_modes::AuraModes, error::AuraError, fancy::KeyColourArray,
|
||||
LED_MSG_LEN,
|
||||
aura_brightness_bytes, aura_modes::AuraModes, fancy::KeyColourArray, LED_MSG_LEN,
|
||||
};
|
||||
use rusb::DeviceHandle;
|
||||
use std::marker::PhantomData;
|
||||
@@ -60,7 +59,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
async fn initialise(&mut self) -> Result<(), AuraError> {
|
||||
async fn initialise(&mut self) -> Result<(), RogError> {
|
||||
if !self.initialised {
|
||||
self.write_bytes(&LED_INIT1).await?;
|
||||
self.write_bytes(LED_INIT2.as_bytes()).await?;
|
||||
@@ -76,14 +75,14 @@ where
|
||||
&mut self,
|
||||
mode: AuraModes,
|
||||
config: &mut Config,
|
||||
) -> Result<(), AuraError> {
|
||||
) -> Result<(), RogError> {
|
||||
self.initialise().await?;
|
||||
self.set_and_save(mode, config).await
|
||||
}
|
||||
|
||||
/// Should only be used if the bytes you are writing are verified correct
|
||||
#[inline]
|
||||
async fn write_bytes(&self, message: &[u8]) -> Result<(), AuraError> {
|
||||
async fn write_bytes(&self, message: &[u8]) -> Result<(), RogError> {
|
||||
match unsafe { self.handle.as_ref() }.write_interrupt(
|
||||
self.led_endpoint,
|
||||
message,
|
||||
@@ -102,7 +101,7 @@ where
|
||||
///
|
||||
/// `aura_effect_init` must be called any effect routine, and called only once.
|
||||
#[inline]
|
||||
async fn write_effect(&mut self, effect: Vec<Vec<u8>>) -> Result<(), AuraError> {
|
||||
async fn write_effect(&mut self, effect: Vec<Vec<u8>>) -> Result<(), RogError> {
|
||||
if self.flip_effect_write {
|
||||
for row in effect.iter().rev() {
|
||||
self.write_bytes(row).await?;
|
||||
@@ -120,11 +119,7 @@ where
|
||||
///
|
||||
/// This needs to be universal so that settings applied by dbus stick
|
||||
#[inline]
|
||||
async fn set_and_save(
|
||||
&mut self,
|
||||
mode: AuraModes,
|
||||
config: &mut Config,
|
||||
) -> Result<(), AuraError> {
|
||||
async fn set_and_save(&mut self, mode: AuraModes, config: &mut Config) -> Result<(), RogError> {
|
||||
match mode {
|
||||
AuraModes::RGB(v) => {
|
||||
if v[0].is_empty() {
|
||||
@@ -162,17 +157,17 @@ where
|
||||
}
|
||||
|
||||
warn!("Attempted to set unsupported mode");
|
||||
Err(AuraError::NotSupported)
|
||||
Err(RogError::NotSupported)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub async fn reload_last_builtin(&mut self, config: &Config) -> Result<(), AuraError> {
|
||||
pub async fn reload_last_builtin(&mut self, config: &Config) -> Result<(), RogError> {
|
||||
self.initialise().await?;
|
||||
// set current mode (if any)
|
||||
if self.supported_modes.len() > 1 {
|
||||
let mode = config
|
||||
.get_led_mode_data(config.current_mode)
|
||||
.ok_or(AuraError::NotSupported)?
|
||||
.ok_or(RogError::NotSupported)?
|
||||
.to_owned();
|
||||
let mode: [u8; LED_MSG_LEN] = mode.into();
|
||||
self.write_bytes(&mode).await?;
|
||||
|
||||
Reference in New Issue
Block a user