mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
1cbffedaeb
Groundwork for 'advanced' aura modes Add single zone + Doom light flash Fix mocking for ROGCC Better prepare & change to mapping of keyboard layouts to models and functions Refactor and begin using new key layout stuff Enable first arg to rogcc to set layout in mocking feature mode Complete refactor of key layouts, and to RON serde
48 lines
1.1 KiB
Rust
48 lines
1.1 KiB
Rust
use std::convert::TryFrom;
|
|
|
|
use rog_anime::usb::get_anime_type;
|
|
use rog_anime::{AnimeDataBuffer, AnimeGrid};
|
|
use rog_dbus::RogDbusClientBlocking;
|
|
|
|
// In usable data:
|
|
// Top row start at 1, ends at 32
|
|
|
|
// 74w x 36h diagonal used by the windows app
|
|
|
|
fn main() {
|
|
let (client, _) = RogDbusClientBlocking::new().unwrap();
|
|
let anime_type = get_anime_type().unwrap();
|
|
let mut matrix = AnimeGrid::new(anime_type);
|
|
let tmp = matrix.get_mut();
|
|
|
|
let mut i = 0;
|
|
for (y, row) in tmp.iter_mut().enumerate() {
|
|
if y % 2 == 0 && i + 1 != row.len() - 1 {
|
|
i += 1;
|
|
}
|
|
row[row.len() - i] = 0x22;
|
|
if i > 5 {
|
|
row[row.len() - i + 5] = 0x22;
|
|
}
|
|
if i > 10 {
|
|
row[row.len() - i + 10] = 0x22;
|
|
}
|
|
|
|
if i > 15 {
|
|
row[row.len() - i + 15] = 0x22;
|
|
}
|
|
|
|
if i > 20 {
|
|
row[row.len() - i + 20] = 0x22;
|
|
}
|
|
|
|
if i > 25 {
|
|
row[row.len() - i + 25] = 0x22;
|
|
}
|
|
}
|
|
|
|
let matrix = <AnimeDataBuffer>::try_from(matrix).unwrap();
|
|
|
|
client.proxies().anime().write(matrix).unwrap();
|
|
}
|