split out types, dbus

This commit is contained in:
Luke
2021-02-03 22:17:44 +13:00
parent 161e3c4d3b
commit 0af68baf7b
52 changed files with 166 additions and 131 deletions

106
Cargo.lock generated
View File

@@ -21,56 +21,27 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
[[package]]
name = "asus-nb"
version = "2.2.1"
dependencies = [
"gumdrop",
"rog_fan_curve",
"serde",
"serde_derive",
"serde_json",
"tinybmp",
"yansi-term",
"zbus",
"zbus_macros",
"zvariant",
]
[[package]]
name = "asus-nb-ctrl"
version = "2.2.2"
dependencies = [
"asus-nb",
"env_logger",
"gumdrop",
"intel-pstate",
"log",
"rog_fan_curve",
"rusb",
"serde",
"serde_derive",
"serde_json",
"sysfs-class",
"toml",
"udev",
"yansi-term",
"zbus",
"zvariant",
]
[[package]] [[package]]
name = "asus-notify" name = "asus-notify"
version = "2.0.4" version = "2.0.4"
dependencies = [ dependencies = [
"asus-nb", "daemon",
"asus-nb-ctrl",
"notify-rust", "notify-rust",
"serde", "rog_dbus",
"serde_derive",
"serde_json", "serde_json",
"zbus", ]
"zvariant",
[[package]]
name = "asusctl"
version = "2.0.4"
dependencies = [
"daemon",
"gumdrop",
"rog_dbus",
"rog_types",
"serde_json",
"tinybmp",
"yansi-term",
] ]
[[package]] [[package]]
@@ -214,6 +185,27 @@ dependencies = [
"lazy_static", "lazy_static",
] ]
[[package]]
name = "daemon"
version = "2.2.2"
dependencies = [
"env_logger",
"intel-pstate",
"log",
"rog_dbus",
"rog_fan_curve",
"rog_types",
"rusb",
"serde",
"serde_derive",
"serde_json",
"sysfs-class",
"toml",
"udev",
"zbus",
"zvariant",
]
[[package]] [[package]]
name = "derivative" name = "derivative"
version = "2.2.0" version = "2.2.0"
@@ -482,9 +474,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.84" version = "0.2.85"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cca32fa0182e8c0989459524dc356b8f2b5c10f1b9eb521b7d182c03cf8c5ff" checksum = "7ccac4b00700875e6a07c6cde370d44d32fa01c5a65cdd2fca6858c479d28bb3"
[[package]] [[package]]
name = "libudev-sys" name = "libudev-sys"
@@ -792,6 +784,18 @@ version = "0.6.22"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581"
[[package]]
name = "rog_dbus"
version = "2.2.1"
dependencies = [
"rog_fan_curve",
"rog_types",
"serde_json",
"zbus",
"zbus_macros",
"zvariant",
]
[[package]] [[package]]
name = "rog_fan_curve" name = "rog_fan_curve"
version = "0.1.7" version = "0.1.7"
@@ -801,6 +805,16 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "rog_types"
version = "2.2.1"
dependencies = [
"gumdrop",
"rog_fan_curve",
"serde",
"serde_derive",
]
[[package]] [[package]]
name = "rusb" name = "rusb"
version = "0.7.0" version = "0.7.0"

View File

@@ -1,5 +1,5 @@
[workspace] [workspace]
members = ["asus-notify", "asus-nb-ctrl", "asus-nb"] members = ["asusctl", "asus-notify", "daemon", "rog-types", "rog-dbus"]
[profile.release] [profile.release]
lto = true lto = true

View File

@@ -8,13 +8,9 @@ edition = "2018"
[dependencies] [dependencies]
# serialisation # serialisation
serde = "^1.0"
serde_derive = "^1.0"
serde_json = "^1.0" serde_json = "^1.0"
asus-nb = { path = "../asus-nb" } rog_dbus = { path = "../rog-dbus" }
asus-nb-ctrl = { path = "../asus-nb-ctrl" } daemon = { path = "../daemon" }
zbus = "^1.8"
zvariant = "^2.4"
[dependencies.notify-rust] [dependencies.notify-rust]
version = "^4.0" version = "^4.0"

View File

@@ -1,11 +1,13 @@
use asus_nb::core_dbus::{DbusProxies, Signals}; use daemon::{config::Profile};
use daemon::config::Profile;
use notify_rust::{Hint, Notification, NotificationHandle}; use notify_rust::{Hint, Notification, NotificationHandle};
use rog_dbus::{DbusProxies, Signals};
use std::error::Error; use std::error::Error;
use std::time::Duration; use std::time::Duration;
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("Version {}", env!("CARGO_PKG_VERSION")); println!("asus-notify version {}", env!("CARGO_PKG_VERSION"));
println!(" daemon version {}", daemon::VERSION);
println!(" rog-dbus version {}", rog_dbus::VERSION);
// let mut cfg = Config::read_new()?; // let mut cfg = Config::read_new()?;
// let mut last_profile = String::new(); // let mut last_profile = String::new();

21
asusctl/Cargo.toml Normal file
View File

@@ -0,0 +1,21 @@
[package]
name = "asusctl"
version = "2.0.4"
authors = ["Luke D Jones <luke@ljones.dev>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
# serialisation
serde_json = "^1.0"
rog_dbus = { path = "../rog-dbus" }
rog_types = { path = "../rog-types" }
daemon = { path = "../daemon" }
gumdrop = "^0.8"
yansi-term = "^0.1"
[dev-dependencies]
tinybmp = "^0.2.3"
rog_dbus = { path = "../rog-dbus" }

View File

@@ -1,11 +1,11 @@
use asus_nb::{ use rog_dbus::AuraDbusClient;
use rog_types::{
anime_matrix::{AniMeMatrix, AniMePacketType, HEIGHT, WIDTH}, anime_matrix::{AniMeMatrix, AniMePacketType, HEIGHT, WIDTH},
core_dbus::AuraDbusClient,
}; };
use tinybmp::{Bmp, Pixel}; use tinybmp::{Bmp, Pixel};
fn main() { fn main() {
let mut writer = AuraDbusClient::new().unwrap(); let (client, _) = AuraDbusClient::new().unwrap();
let bmp = let bmp =
Bmp::from_slice(include_bytes!("non-skewed_r.bmp")).expect("Failed to parse BMP image"); Bmp::from_slice(include_bytes!("non-skewed_r.bmp")).expect("Failed to parse BMP image");
@@ -40,5 +40,5 @@ fn main() {
// println!("{:?}", matrix[0].to_vec()); // println!("{:?}", matrix[0].to_vec());
// println!("{:?}", matrix[1].to_vec()); // println!("{:?}", matrix[1].to_vec());
//writer.set_anime_led_brightness(&mut matrix).unwrap(); //client.proxies().anime().set_brightness(&mut matrix).unwrap();
} }

View File

@@ -1,7 +1,7 @@
use asus_nb::{ use rog_types::{
core_dbus::AuraDbusClient,
fancy::{GX502Layout, Key, KeyColourArray, KeyLayout}, fancy::{GX502Layout, Key, KeyColourArray, KeyLayout},
}; };
use rog_dbus::AuraDbusClient;
use std::collections::LinkedList; use std::collections::LinkedList;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]

View File

@@ -1,7 +1,7 @@
use asus_nb::{ use rog_types::{
core_dbus::AuraDbusClient,
fancy::{GX502Layout, KeyColourArray, KeyLayout}, fancy::{GX502Layout, KeyColourArray, KeyLayout},
}; };
use rog_dbus::AuraDbusClient;
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
let (dbus, _) = AuraDbusClient::new()?; let (dbus, _) = AuraDbusClient::new()?;

View File

@@ -1,7 +1,7 @@
use asus_nb::{ use rog_types::{
core_dbus::AuraDbusClient,
fancy::{GX502Layout, Key, KeyColourArray, KeyLayout}, fancy::{GX502Layout, Key, KeyColourArray, KeyLayout},
}; };
use rog_dbus::AuraDbusClient;
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
let (dbus, _) = AuraDbusClient::new()?; let (dbus, _) = AuraDbusClient::new()?;

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -1,7 +1,7 @@
use asus_nb::{ use rog_types::{
core_dbus::AuraDbusClient,
fancy::{Key, KeyColourArray}, fancy::{Key, KeyColourArray},
}; };
use rog_dbus::AuraDbusClient;
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
let (dbus, _) = AuraDbusClient::new()?; let (dbus, _) = AuraDbusClient::new()?;

View File

@@ -1,7 +1,7 @@
use asus_nb::{ use rog_types::{
core_dbus::AuraDbusClient,
fancy::{GX502Layout, KeyColourArray, KeyLayout}, fancy::{GX502Layout, KeyColourArray, KeyLayout},
}; };
use rog_dbus::AuraDbusClient;
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
let (dbus, _) = AuraDbusClient::new()?; let (dbus, _) = AuraDbusClient::new()?;

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@@ -1,14 +1,10 @@
use asus_nb::{
cli_options::{AniMeActions, AniMeStatusValue, LedBrightness, SetAuraBuiltin},
core_dbus::AuraDbusClient,
profile::{ProfileCommand, ProfileEvent},
};
use daemon::{ctrl_fan_cpu::FanLevel, ctrl_gfx::vendors::GfxVendors}; use daemon::{ctrl_fan_cpu::FanLevel, ctrl_gfx::vendors::GfxVendors};
use gumdrop::{Opt, Options}; use gumdrop::{Opt, Options};
use log::LevelFilter; use rog_dbus::AuraDbusClient;
use std::{env::args, io::Write, process::Command}; use std::{env::args, process::Command};
use yansi_term::Colour::Green; use yansi_term::Colour::Green;
use yansi_term::Colour::Red; use yansi_term::Colour::Red;
use rog_types::{cli_options::{AniMeActions, AniMeStatusValue, LedBrightness, SetAuraBuiltin}, profile::{ProfileCommand, ProfileEvent}};
#[derive(Default, Options)] #[derive(Default, Options)]
struct CLIStart { struct CLIStart {
@@ -104,13 +100,6 @@ struct BiosCommand {
} }
fn main() -> Result<(), Box<dyn std::error::Error>> { fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut logger = env_logger::Builder::new();
logger
.target(env_logger::Target::Stdout)
.format(|buf, record| writeln!(buf, "{}: {}", record.level(), record.args()))
.filter(None, LevelFilter::Info)
.init();
let mut args: Vec<String> = args().collect(); let mut args: Vec<String> = args().collect();
args.remove(0); args.remove(0);
@@ -139,7 +128,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
} }
if parsed.version { if parsed.version {
println!("Version: {}", daemon::VERSION); println!(" asusctl version {}", env!("CARGO_PKG_VERSION"));
println!(" daemon version {}", daemon::VERSION);
println!(" rog-dbus version {}", rog_dbus::VERSION);
println!("rog-types version {}", rog_types::VERSION);
} }
let (dbus, _) = AuraDbusClient::new()?; let (dbus, _) = AuraDbusClient::new()?;

View File

@@ -1,5 +1,5 @@
[package] [package]
name = "asus-nb-ctrl" name = "daemon"
version = "2.2.2" version = "2.2.2"
license = "MPL-2.0" license = "MPL-2.0"
readme = "README.md" readme = "README.md"
@@ -13,21 +13,17 @@ edition = "2018"
name = "daemon" name = "daemon"
path = "src/lib.rs" path = "src/lib.rs"
[[bin]]
name = "asusctl"
path = "src/main.rs"
[[bin]] [[bin]]
name = "asusd" name = "asusd"
path = "src/daemon.rs" path = "src/daemon.rs"
[dependencies] [dependencies]
asus-nb = { path = "../asus-nb" } rog_types = { path = "../rog-types" }
rog_dbus = { path = "../rog-dbus" }
rusb = "^0.7" rusb = "^0.7"
udev = "^0.6" udev = "^0.6"
# cli and logging # cli and logging
gumdrop = "^0.8"
log = "^0.4" log = "^0.4"
env_logger = "^0.8" env_logger = "^0.8"
@@ -44,6 +40,4 @@ toml = "^0.5"
sysfs-class = "^0.1.2" # used for backlight control and baord ID sysfs-class = "^0.1.2" # used for backlight control and baord ID
rog_fan_curve = { version = "0.1", features = ["serde"] } rog_fan_curve = { version = "0.1", features = ["serde"] }
# cpu power management # cpu power management
intel-pstate = "^0.2" intel-pstate = "^0.2"
yansi-term = "^0.1"

View File

@@ -1,4 +1,4 @@
use asus_nb::aura_modes::AuraModes; use rog_types::aura_modes::AuraModes;
use log::{error, info, warn}; use log::{error, info, warn};
use rog_fan_curve::Curve; use rog_fan_curve::Curve;
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};

View File

@@ -13,7 +13,7 @@ const APPLY: u8 = 0xc4;
// The next byte can be 0x03 for "on" and 0x00 for "off" // The next byte can be 0x03 for "on" and 0x00 for "off"
const ON_OFF: u8 = 0x04; const ON_OFF: u8 = 0x04;
use asus_nb::error::AuraError; use rog_types::error::AuraError;
use log::{error, info, warn}; use log::{error, info, warn};
use rusb::{Device, DeviceHandle}; use rusb::{Device, DeviceHandle};
use std::convert::TryInto; use std::convert::TryInto;

View File

@@ -2,7 +2,7 @@ use crate::{
config::{Config, Profile}, config::{Config, Profile},
GetSupported, GetSupported,
}; };
use asus_nb::profile::ProfileEvent; use rog_types::profile::ProfileEvent;
use log::{info, warn}; use log::{info, warn};
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
use std::convert::TryInto; use std::convert::TryInto;

View File

@@ -9,7 +9,7 @@ use crate::{
error::RogError, error::RogError,
laptops::{match_laptop, HELP_ADDRESS}, laptops::{match_laptop, HELP_ADDRESS},
}; };
use asus_nb::{ use rog_types::{
aura_brightness_bytes, aura_brightness_bytes,
aura_modes::{AuraModes, PER_KEY}, aura_modes::{AuraModes, PER_KEY},
fancy::KeyColourArray, fancy::KeyColourArray,

View File

@@ -10,7 +10,7 @@ use daemon::{
ctrl_gfx::{gfx::CtrlGraphics, vendors::GfxVendors}, ctrl_gfx::{gfx::CtrlGraphics, vendors::GfxVendors},
}; };
use asus_nb::DBUS_NAME; use rog_dbus::DBUS_NAME;
use daemon::{CtrlTask, Reloadable, ZbusAdd}; use daemon::{CtrlTask, Reloadable, ZbusAdd};
use log::LevelFilter; use log::LevelFilter;
use log::{error, info, warn}; use log::{error, info, warn};
@@ -33,7 +33,10 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
.filter(None, LevelFilter::Info) .filter(None, LevelFilter::Info)
.init(); .init();
info!("Version: {}", daemon::VERSION); info!( "daemon version {}", daemon::VERSION);
info!(" rog-dbus version {}", rog_dbus::VERSION);
info!("rog-types version {}", rog_types::VERSION);
start_daemon()?; start_daemon()?;
Ok(()) Ok(())
} }

View File

@@ -1,4 +1,4 @@
use asus_nb::aura_modes::{AuraModes, BREATHING, STATIC}; use rog_types::aura_modes::{AuraModes, BREATHING, STATIC};
use log::{info, warn}; use log::{info, warn};
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
use std::fs::OpenOptions; use std::fs::OpenOptions;

View File

@@ -1,24 +1,18 @@
[package] [package]
name = "asus-nb" name = "rog_dbus"
version = "2.2.1" version = "2.2.1"
license = "MPL-2.0" license = "MPL-2.0"
readme = "README.md" readme = "README.md"
authors = ["Luke <luke@ljones.dev>"] authors = ["Luke <luke@ljones.dev>"]
repository = "https://gitlab.com/asus-linux/asus-nb-ctrl" repository = "https://gitlab.com/asus-linux/asus-nb-ctrl"
homepage = "https://gitlab.com/asus-linux/asus-nb-ctrl" homepage = "https://gitlab.com/asus-linux/asus-nb-ctrl"
description = "A small library of effect types and conversions for ROG Aura" description = "dbus interface methods for asusctl"
edition = "2018" edition = "2018"
[dependencies] [dependencies]
gumdrop = "^0.8"
serde = "^1.0"
serde_derive = "^1.0"
serde_json = "^1.0" serde_json = "^1.0"
yansi-term = "^0.1" rog_types = { path = "../rog-types" }
rog_fan_curve = { version = "^0.1", features = ["serde"] } rog_fan_curve = { version = "^0.1", features = ["serde"] }
zbus = "^1.8" zbus = "^1.8"
zbus_macros = "^1.8" zbus_macros = "^1.8"
zvariant = "^2.4" zvariant = "^2.4"
[dev-dependencies]
tinybmp = "^0.2.3"

View File

@@ -1,7 +1,21 @@
use super::*; pub static DBUS_NAME: &str = "org.asuslinux.Daemon";
pub static DBUS_PATH: &str = "/org/asuslinux/Daemon";
pub static DBUS_IFACE: &str = "org.asuslinux.Daemon";
pub const LED_MSG_LEN: usize = 17;
pub mod zbus_anime;
pub mod zbus_charge;
pub mod zbus_gfx;
pub mod zbus_led;
pub mod zbus_profile;
pub mod zbus_rogbios;
pub mod zbus_supported;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use rog_types::aura_modes::AuraModes;
use zbus::{Connection, Result, SignalReceiver}; use zbus::{Connection, Result, SignalReceiver};
pub static VERSION: &str = env!("CARGO_PKG_VERSION");
pub struct DbusProxies<'a> { pub struct DbusProxies<'a> {
anime: zbus_anime::AnimeProxy<'a>, anime: zbus_anime::AnimeProxy<'a>,
charge: zbus_charge::ChargeProxy<'a>, charge: zbus_charge::ChargeProxy<'a>,

View File

@@ -21,7 +21,7 @@
use zbus::{dbus_proxy, Connection, Result}; use zbus::{dbus_proxy, Connection, Result};
use crate::anime_matrix::{AniMeMatrix, AniMePacketType, ANIME_PANE1_PREFIX, ANIME_PANE2_PREFIX}; use rog_types::anime_matrix::{AniMeMatrix, AniMePacketType, ANIME_PANE1_PREFIX, ANIME_PANE2_PREFIX};
#[dbus_proxy( #[dbus_proxy(
interface = "org.asuslinux.Daemon", interface = "org.asuslinux.Daemon",

View File

@@ -23,7 +23,7 @@ use std::sync::{Arc, Mutex};
use zbus::{dbus_proxy, Connection, Result}; use zbus::{dbus_proxy, Connection, Result};
use crate::{aura_modes::AuraModes, cli_options::LedBrightness, fancy::KeyColourArray}; use rog_types::{aura_modes::AuraModes, cli_options::LedBrightness, fancy::KeyColourArray};
const BLOCKING_TIME: u64 = 40; // 100ms = 10 FPS, max 50ms = 20 FPS, 40ms = 25 FPS const BLOCKING_TIME: u64 = 40; // 100ms = 10 FPS, max 50ms = 20 FPS, 40ms = 25 FPS

View File

@@ -21,10 +21,9 @@
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use rog_types::profile::ProfileEvent;
use zbus::{dbus_proxy, Connection, Result}; use zbus::{dbus_proxy, Connection, Result};
use crate::profile::ProfileEvent;
#[dbus_proxy( #[dbus_proxy(
interface = "org.asuslinux.Daemon", interface = "org.asuslinux.Daemon",
default_path = "/org/asuslinux/Profile" default_path = "/org/asuslinux/Profile"

16
rog-types/Cargo.toml Normal file
View File

@@ -0,0 +1,16 @@
[package]
name = "rog_types"
version = "2.2.1"
license = "MPL-2.0"
readme = "README.md"
authors = ["Luke <luke@ljones.dev>"]
repository = "https://gitlab.com/asus-linux/asus-nb-ctrl"
homepage = "https://gitlab.com/asus-linux/asus-nb-ctrl"
description = "A small library of effect types and conversions for ROG Aura"
edition = "2018"
[dependencies]
gumdrop = "^0.8"
serde = "^1.0"
serde_derive = "^1.0"
rog_fan_curve = { version = "^0.1", features = ["serde"] }

View File

@@ -4,7 +4,6 @@ pub type AniMeBufferType = [[u8; WIDTH]; HEIGHT];
pub type AniMePacketType = [[u8; 640]; 2]; pub type AniMePacketType = [[u8; 640]; 2];
const BLOCK_START: usize = 7; const BLOCK_START: usize = 7;
const BLOCK_END: usize = 634; const BLOCK_END: usize = 634;
use yansi_term::Colour::RGB;
pub const ANIME_PANE1_PREFIX: [u8; 7] = [0x5e, 0xc0, 0x02, 0x01, 0x00, 0x73, 0x02]; pub const ANIME_PANE1_PREFIX: [u8; 7] = [0x5e, 0xc0, 0x02, 0x01, 0x00, 0x73, 0x02];
pub const ANIME_PANE2_PREFIX: [u8; 7] = [0x5e, 0xc0, 0x02, 0x74, 0x02, 0x73, 0x02]; pub const ANIME_PANE2_PREFIX: [u8; 7] = [0x5e, 0xc0, 0x02, 0x74, 0x02, 0x73, 0x02];
@@ -58,8 +57,8 @@ impl AniMeMatrix {
} else { } else {
row.iter() row.iter()
}; };
for x in tmp { for _ in tmp {
print!(" {}", RGB(*x, *x, *x).paint("XY")); print!(" XY");
} }
println!(); println!();
@@ -81,9 +80,9 @@ impl AniMeMatrix {
if count % 2 == 0 { if count % 2 == 0 {
print!(" "); print!(" ");
} }
for (i, x) in row.iter().enumerate() { for (i, _) in row.iter().enumerate() {
if i >= index { if i >= index {
print!(" {}", RGB(*x, *x, *x).paint("XY")); print!(" XY");
} else { } else {
print!(" "); print!(" ");
} }

View File

@@ -14,21 +14,12 @@ pub mod cli_options;
/// Enables you to create fancy RGB effects /// Enables you to create fancy RGB effects
pub mod fancy; pub mod fancy;
/// The main dbus group for system controls, e.g, fan control, keyboard LED's
pub mod core_dbus;
/// Helper functions for the AniMe display /// Helper functions for the AniMe display
pub mod anime_matrix; pub mod anime_matrix;
pub mod error; pub mod error;
pub mod zbus_anime; pub static VERSION: &str = env!("CARGO_PKG_VERSION");
pub mod zbus_charge;
pub mod zbus_gfx;
pub mod zbus_led;
pub mod zbus_profile;
pub mod zbus_rogbios;
pub mod zbus_supported;
// static LED_INIT1: [u8; 2] = [0x5d, 0xb9]; // static LED_INIT1: [u8; 2] = [0x5d, 0xb9];
// static LED_INIT2: &str = "]ASUS Tech.Inc."; // ] == 0x5d // static LED_INIT2: &str = "]ASUS Tech.Inc."; // ] == 0x5d