mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f14d1ad61e | |||
| 85d4e9cabd | |||
| e47a9cffd7 | |||
| ca93dc7215 | |||
| 1cba693469 | |||
| 166149b351 | |||
| 1b11b6d8fb | |||
| 02568299df | |||
| acdc93596c | |||
| 22e26adfb6 | |||
| 4730e645ba | |||
| d203fab70d | |||
| 792fae3ed7 | |||
| e443ab00c9 | |||
| aee54f5756 | |||
| 00904e9603 | |||
| b1212585e2 |
+24
-5
@@ -1,12 +1,31 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
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/),
|
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [v6.0.11]
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Renamed `Strobe` effect to `RainbowCycle` to prevent confusion over what it is
|
||||||
|
- Ranamed `Rainbow` effect to `RainbowWave`
|
||||||
|
- Cleaned up serde crate deps
|
||||||
|
- Fixed AniMe on GA402XZ
|
||||||
|
- Update some of the G713 device aura features
|
||||||
|
- Update some of the G513 device aura features
|
||||||
|
|
||||||
|
## [v6.0.10]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Add the GA401I model to aura_support.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Aura support return a default aura definition instead of nothing
|
||||||
|
- Minor updates in aura controller to ensure configs are updated if the support file changes
|
||||||
|
- Don't panic if -ENODEV on fan_curve enable
|
||||||
|
- Adjust the G513Q support to match what is on the asus website.
|
||||||
|
- Adjust init sequence of anime to prevent accidental use of Slash as Anime
|
||||||
|
- Enable notifs and tray icon without supergfx
|
||||||
|
|
||||||
## [v6.0.9]
|
## [v6.0.9]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
Generated
+286
-354
File diff suppressed because it is too large
Load Diff
+3
-6
@@ -1,5 +1,5 @@
|
|||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "6.0.9"
|
version = "6.0.11"
|
||||||
rust-version = "1.77"
|
rust-version = "1.77"
|
||||||
license = "MPL-2.0"
|
license = "MPL-2.0"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
@@ -50,8 +50,7 @@ mio = "0.8.11"
|
|||||||
zbus = "4.2"
|
zbus = "4.2"
|
||||||
logind-zbus = { version = "4.0.3" } #, default-features = false, features = ["non_blocking"] }
|
logind-zbus = { version = "4.0.3" } #, default-features = false, features = ["non_blocking"] }
|
||||||
|
|
||||||
serde = "^1.0"
|
serde = { version = "^1.0", features = ["serde_derive"] }
|
||||||
serde_derive = "^1.0"
|
|
||||||
ron = "*"
|
ron = "*"
|
||||||
typeshare = "1.0.0"
|
typeshare = "1.0.0"
|
||||||
|
|
||||||
@@ -71,9 +70,7 @@ gif = "^0.12.0"
|
|||||||
|
|
||||||
versions = "6.2"
|
versions = "6.2"
|
||||||
|
|
||||||
notify-rust = { git = "https://github.com/flukejones/notify-rust.git", rev = "54176413b81189a3e4edbdc20a0b4f7e2e35c063", default-features = false, features = [
|
notify-rust = { version = "4.11.0", features = ["z", "async"] }
|
||||||
"z",
|
|
||||||
] }
|
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
# thin = 57s, asusd = 9.0M
|
# thin = 57s, asusd = 9.0M
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
VERSION := $(shell /usr/bin/grep -Pm1 'version = "(\d.\d.\d)"' Cargo.toml | cut -d'"' -f2)
|
VERSION := $(shell /usr/bin/grep -Pm1 'version = "(\d+.\d+.\d+)"' Cargo.toml | cut -d'"' -f2)
|
||||||
|
|
||||||
INSTALL = install
|
INSTALL = install
|
||||||
INSTALL_PROGRAM = ${INSTALL} -D -m 0755
|
INSTALL_PROGRAM = ${INSTALL} -D -m 0755
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use std::error::Error;
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
|
|
||||||
use rog_anime::usb::get_anime_type;
|
use rog_anime::usb::get_maybe_anime_type;
|
||||||
use rog_anime::{AnimeDiagonal, AnimeType};
|
use rog_anime::{AnimeDiagonal, AnimeType};
|
||||||
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
||||||
use zbus::blocking::Connection;
|
use zbus::blocking::Connection;
|
||||||
@@ -26,7 +26,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
AnimeType::GA401,
|
AnimeType::GA401,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let anime_type = get_anime_type()?;
|
let anime_type = get_maybe_anime_type()?;
|
||||||
|
|
||||||
proxy.write(matrix.into_data_buffer(anime_type)?).unwrap();
|
proxy.write(matrix.into_data_buffer(anime_type)?).unwrap();
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use rog_anime::usb::get_anime_type;
|
use rog_anime::usb::get_maybe_anime_type;
|
||||||
use rog_anime::{AnimeDiagonal, AnimeType};
|
use rog_anime::{AnimeDiagonal, AnimeType};
|
||||||
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
||||||
use zbus::blocking::Connection;
|
use zbus::blocking::Connection;
|
||||||
@@ -29,7 +29,7 @@ fn main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let anime_type = get_anime_type().unwrap();
|
let anime_type = get_maybe_anime_type().unwrap();
|
||||||
proxy
|
proxy
|
||||||
.write(matrix.into_data_buffer(anime_type).unwrap())
|
.write(matrix.into_data_buffer(anime_type).unwrap())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use std::env;
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
|
|
||||||
use rog_anime::usb::get_anime_type;
|
use rog_anime::usb::get_maybe_anime_type;
|
||||||
use rog_anime::{ActionData, ActionLoader, Sequences};
|
use rog_anime::{ActionData, ActionLoader, Sequences};
|
||||||
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
||||||
use zbus::blocking::Connection;
|
use zbus::blocking::Connection;
|
||||||
@@ -19,7 +19,7 @@ fn main() {
|
|||||||
|
|
||||||
let path = Path::new(&args[1]);
|
let path = Path::new(&args[1]);
|
||||||
let brightness = args[2].parse::<f32>().unwrap();
|
let brightness = args[2].parse::<f32>().unwrap();
|
||||||
let anime_type = get_anime_type().unwrap();
|
let anime_type = get_maybe_anime_type().unwrap();
|
||||||
let mut seq = Sequences::new(anime_type);
|
let mut seq = Sequences::new(anime_type);
|
||||||
seq.insert(
|
seq.insert(
|
||||||
0,
|
0,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
|
|
||||||
use rog_anime::usb::get_anime_type;
|
use rog_anime::usb::get_maybe_anime_type;
|
||||||
use rog_anime::{AnimeDataBuffer, AnimeGrid};
|
use rog_anime::{AnimeDataBuffer, AnimeGrid};
|
||||||
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
||||||
use zbus::blocking::Connection;
|
use zbus::blocking::Connection;
|
||||||
@@ -14,7 +14,7 @@ fn main() {
|
|||||||
let conn = Connection::system().unwrap();
|
let conn = Connection::system().unwrap();
|
||||||
let proxy = AnimeProxyBlocking::new(&conn).unwrap();
|
let proxy = AnimeProxyBlocking::new(&conn).unwrap();
|
||||||
|
|
||||||
let anime_type = get_anime_type().unwrap();
|
let anime_type = get_maybe_anime_type().unwrap();
|
||||||
let mut matrix = AnimeGrid::new(anime_type);
|
let mut matrix = AnimeGrid::new(anime_type);
|
||||||
let tmp = matrix.get_mut();
|
let tmp = matrix.get_mut();
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use rog_anime::usb::get_anime_type;
|
use rog_anime::usb::get_maybe_anime_type;
|
||||||
use rog_anime::AnimeDataBuffer;
|
use rog_anime::AnimeDataBuffer;
|
||||||
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
||||||
use zbus::blocking::Connection;
|
use zbus::blocking::Connection;
|
||||||
@@ -9,7 +9,7 @@ use zbus::blocking::Connection;
|
|||||||
fn main() {
|
fn main() {
|
||||||
let conn = Connection::system().unwrap();
|
let conn = Connection::system().unwrap();
|
||||||
let proxy = AnimeProxyBlocking::new(&conn).unwrap();
|
let proxy = AnimeProxyBlocking::new(&conn).unwrap();
|
||||||
let anime_type = get_anime_type().unwrap();
|
let anime_type = get_maybe_anime_type().unwrap();
|
||||||
let mut matrix = AnimeDataBuffer::new(anime_type);
|
let mut matrix = AnimeDataBuffer::new(anime_type);
|
||||||
matrix.data_mut()[1] = 100; // start = 1
|
matrix.data_mut()[1] = 100; // start = 1
|
||||||
for n in matrix.data_mut()[2..32].iter_mut() {
|
for n in matrix.data_mut()[2..32].iter_mut() {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use std::error::Error;
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
|
|
||||||
use rog_anime::usb::get_anime_type;
|
use rog_anime::usb::get_maybe_anime_type;
|
||||||
use rog_anime::{AnimeDataBuffer, AnimeImage, Vec2};
|
use rog_anime::{AnimeDataBuffer, AnimeImage, Vec2};
|
||||||
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
||||||
use zbus::blocking::Connection;
|
use zbus::blocking::Connection;
|
||||||
@@ -20,7 +20,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let anime_type = get_anime_type()?;
|
let anime_type = get_maybe_anime_type()?;
|
||||||
let matrix = AnimeImage::from_png(
|
let matrix = AnimeImage::from_png(
|
||||||
Path::new(&args[1]),
|
Path::new(&args[1]),
|
||||||
args[2].parse::<f32>().unwrap(),
|
args[2].parse::<f32>().unwrap(),
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ use std::process::exit;
|
|||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use rog_anime::usb::get_anime_type;
|
use rog_anime::usb::get_maybe_anime_type;
|
||||||
use rog_anime::{AnimeDataBuffer, AnimeImage, Vec2};
|
use rog_anime::{AnimeDataBuffer, AnimeImage, Vec2};
|
||||||
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
||||||
use zbus::blocking::Connection;
|
use zbus::blocking::Connection;
|
||||||
@@ -23,7 +23,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let anime_type = get_anime_type()?;
|
let anime_type = get_maybe_anime_type()?;
|
||||||
let mut matrix = AnimeImage::from_png(
|
let mut matrix = AnimeImage::from_png(
|
||||||
Path::new(&args[1]),
|
Path::new(&args[1]),
|
||||||
args[2].parse::<f32>().unwrap(),
|
args[2].parse::<f32>().unwrap(),
|
||||||
|
|||||||
@@ -219,9 +219,9 @@ pub enum SetAuraBuiltin {
|
|||||||
#[options(help = "pulse between one or two colours")]
|
#[options(help = "pulse between one or two colours")]
|
||||||
Breathe(TwoColourSpeed), // 1
|
Breathe(TwoColourSpeed), // 1
|
||||||
#[options(help = "strobe through all colours")]
|
#[options(help = "strobe through all colours")]
|
||||||
Strobe(SingleSpeed), // 2
|
RainbowCycle(SingleSpeed), // 2
|
||||||
#[options(help = "rainbow cycling in one of four directions")]
|
#[options(help = "rainbow cycling in one of four directions")]
|
||||||
Rainbow(SingleSpeedDirection), // 3
|
RainbowWave(SingleSpeedDirection), // 3
|
||||||
#[options(help = "rain pattern mimicking raindrops")]
|
#[options(help = "rain pattern mimicking raindrops")]
|
||||||
Stars(TwoColourSpeed), // 4
|
Stars(TwoColourSpeed), // 4
|
||||||
#[options(help = "rain pattern of three preset colours")]
|
#[options(help = "rain pattern of three preset colours")]
|
||||||
@@ -312,14 +312,14 @@ impl From<&SetAuraBuiltin> for AuraEffect {
|
|||||||
data.mode = AuraModeNum::Breathe;
|
data.mode = AuraModeNum::Breathe;
|
||||||
data
|
data
|
||||||
}
|
}
|
||||||
SetAuraBuiltin::Strobe(x) => {
|
SetAuraBuiltin::RainbowCycle(x) => {
|
||||||
let mut data: AuraEffect = x.into();
|
let mut data: AuraEffect = x.into();
|
||||||
data.mode = AuraModeNum::Strobe;
|
data.mode = AuraModeNum::RainbowCycle;
|
||||||
data
|
data
|
||||||
}
|
}
|
||||||
SetAuraBuiltin::Rainbow(x) => {
|
SetAuraBuiltin::RainbowWave(x) => {
|
||||||
let mut data: AuraEffect = x.into();
|
let mut data: AuraEffect = x.into();
|
||||||
data.mode = AuraModeNum::Rainbow;
|
data.mode = AuraModeNum::RainbowWave;
|
||||||
data
|
data
|
||||||
}
|
}
|
||||||
SetAuraBuiltin::Stars(x) => {
|
SetAuraBuiltin::Stars(x) => {
|
||||||
|
|||||||
+5
-4
@@ -9,7 +9,7 @@ use aura_cli::{LedPowerCommand1, LedPowerCommand2};
|
|||||||
use dmi_id::DMIID;
|
use dmi_id::DMIID;
|
||||||
use fan_curve_cli::FanCurveCommand;
|
use fan_curve_cli::FanCurveCommand;
|
||||||
use gumdrop::{Opt, Options};
|
use gumdrop::{Opt, Options};
|
||||||
use rog_anime::usb::get_anime_type;
|
use rog_anime::usb::get_maybe_anime_type;
|
||||||
use rog_anime::{AnimTime, AnimeDataBuffer, AnimeDiagonal, AnimeGif, AnimeImage, AnimeType, Vec2};
|
use rog_anime::{AnimTime, AnimeDataBuffer, AnimeDiagonal, AnimeGif, AnimeImage, AnimeType, Vec2};
|
||||||
use rog_aura::keyboard::{AuraPowerState, LaptopAuraPower};
|
use rog_aura::keyboard::{AuraPowerState, LaptopAuraPower};
|
||||||
use rog_aura::{self, AuraDeviceType, AuraEffect, PowerZones};
|
use rog_aura::{self, AuraDeviceType, AuraEffect, PowerZones};
|
||||||
@@ -36,6 +36,8 @@ mod fan_curve_cli;
|
|||||||
mod slash_cli;
|
mod slash_cli;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
let self_version = env!("CARGO_PKG_VERSION");
|
||||||
|
println!("Starting version {self_version}");
|
||||||
let args: Vec<String> = args().skip(1).collect();
|
let args: Vec<String> = args().skip(1).collect();
|
||||||
|
|
||||||
let missing_argument_k = gumdrop::Error::missing_argument(Opt::Short('k'));
|
let missing_argument_k = gumdrop::Error::missing_argument(Opt::Short('k'));
|
||||||
@@ -57,7 +59,6 @@ fn main() {
|
|||||||
println!("\nError: {e}\n");
|
println!("\nError: {e}\n");
|
||||||
print_info();
|
print_info();
|
||||||
}) {
|
}) {
|
||||||
let self_version = env!("CARGO_PKG_VERSION");
|
|
||||||
let asusd_version = platform_proxy.version().unwrap();
|
let asusd_version = platform_proxy.version().unwrap();
|
||||||
if asusd_version != self_version {
|
if asusd_version != self_version {
|
||||||
println!("Version mismatch: asusctl = {self_version}, asusd = {asusd_version}");
|
println!("Version mismatch: asusctl = {self_version}, asusd = {asusd_version}");
|
||||||
@@ -364,8 +365,8 @@ fn handle_anime(conn: &Connection, cmd: &AnimeCommand) -> Result<(), Box<dyn std
|
|||||||
println!("Did Alice _really_ make it back from Wonderland?");
|
println!("Did Alice _really_ make it back from Wonderland?");
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut anime_type = get_anime_type()?;
|
let mut anime_type = get_maybe_anime_type()?;
|
||||||
if let AnimeType::Unknown = anime_type {
|
if let AnimeType::Unsupported = anime_type {
|
||||||
if let Some(model) = cmd.override_type {
|
if let Some(model) = cmd.override_type {
|
||||||
anime_type = model;
|
anime_type = model;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ smol.workspace = true
|
|||||||
|
|
||||||
# serialisation
|
# serialisation
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_derive.workspace = true
|
|
||||||
ron.workspace = true
|
ron.workspace = true
|
||||||
|
|
||||||
rog_anime = { path = "../rog-anime" }
|
rog_anime = { path = "../rog-anime" }
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use rog_anime::{ActionLoader, AnimTime, AnimeType, Fade, Sequences as AnimeSeque
|
|||||||
use rog_aura::effects::{AdvancedEffects as AuraSequences, Breathe, DoomFlicker, Effect, Static};
|
use rog_aura::effects::{AdvancedEffects as AuraSequences, Breathe, DoomFlicker, Effect, Static};
|
||||||
use rog_aura::keyboard::LedCode;
|
use rog_aura::keyboard::LedCode;
|
||||||
use rog_aura::{Colour, Speed};
|
use rog_aura::{Colour, Speed};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::error::Error;
|
use crate::error::Error;
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ use rog_anime::error::AnimeError;
|
|||||||
use rog_anime::{ActionData, ActionLoader, AnimTime, Fade, Sequences, Vec2};
|
use rog_anime::{ActionData, ActionLoader, AnimTime, Fade, Sequences, Vec2};
|
||||||
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
||||||
use ron::ser::PrettyConfig;
|
use ron::ser::PrettyConfig;
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use zbus::interface;
|
use zbus::interface;
|
||||||
use zbus::zvariant::{ObjectPath, Type};
|
use zbus::zvariant::{ObjectPath, Type};
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use std::sync::{Arc, Mutex};
|
|||||||
use asusd_user::config::*;
|
use asusd_user::config::*;
|
||||||
use asusd_user::ctrl_anime::{CtrlAnime, CtrlAnimeInner};
|
use asusd_user::ctrl_anime::{CtrlAnime, CtrlAnimeInner};
|
||||||
use config_traits::{StdConfig, StdConfigLoad};
|
use config_traits::{StdConfig, StdConfigLoad};
|
||||||
use rog_anime::usb::get_anime_type;
|
use rog_anime::usb::get_maybe_anime_type;
|
||||||
use rog_aura::aura_detection::LedSupportData;
|
use rog_aura::aura_detection::LedSupportData;
|
||||||
use rog_aura::keyboard::KeyLayout;
|
use rog_aura::keyboard::KeyLayout;
|
||||||
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
use rog_dbus::zbus_anime::AnimeProxyBlocking;
|
||||||
@@ -44,7 +44,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
// Set up the anime data and run loop/thread
|
// Set up the anime data and run loop/thread
|
||||||
if supported.contains(&"org.asuslinux.Anime".to_string()) {
|
if supported.contains(&"org.asuslinux.Anime".to_string()) {
|
||||||
if let Some(cfg) = config.active_anime {
|
if let Some(cfg) = config.active_anime {
|
||||||
let anime_type = get_anime_type()?;
|
let anime_type = get_maybe_anime_type()?;
|
||||||
let anime_config = ConfigAnime::new().set_name(cfg).load();
|
let anime_config = ConfigAnime::new().set_name(cfg).load();
|
||||||
let anime = anime_config.create(anime_type)?;
|
let anime = anime_config.create(anime_type)?;
|
||||||
let anime_config = Arc::new(Mutex::new(anime_config));
|
let anime_config = Arc::new(Mutex::new(anime_config));
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ logind-zbus.workspace = true
|
|||||||
|
|
||||||
# serialisation
|
# serialisation
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_derive.workspace = true
|
|
||||||
|
|
||||||
concat-idents.workspace = true
|
concat-idents.workspace = true
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
use config_traits::{StdConfig, StdConfigLoad1};
|
use config_traits::{StdConfig, StdConfigLoad1};
|
||||||
use rog_platform::cpu::CPUEPP;
|
use rog_platform::cpu::CPUEPP;
|
||||||
use rog_platform::platform::ThrottlePolicy;
|
use rog_platform::platform::ThrottlePolicy;
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
const CONFIG_FILE: &str = "asusd.ron";
|
const CONFIG_FILE: &str = "asusd.ron";
|
||||||
|
|
||||||
|
|||||||
@@ -1,69 +1,15 @@
|
|||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use config_traits::{StdConfig, StdConfigLoad2};
|
use config_traits::{StdConfig, StdConfigLoad};
|
||||||
use rog_anime::error::AnimeError;
|
use rog_anime::error::AnimeError;
|
||||||
use rog_anime::usb::Brightness;
|
use rog_anime::usb::Brightness;
|
||||||
use rog_anime::{
|
use rog_anime::{
|
||||||
ActionData, ActionLoader, AnimTime, Animations, AnimeType, DeviceState, Fade, Vec2,
|
ActionData, ActionLoader, AnimTime, Animations, AnimeType, DeviceState, Fade, Vec2,
|
||||||
};
|
};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
const CONFIG_FILE: &str = "anime.ron";
|
const CONFIG_FILE: &str = "anime.ron";
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize)]
|
|
||||||
pub struct AnimeConfigV460 {
|
|
||||||
pub system: Vec<ActionLoader>,
|
|
||||||
pub boot: Vec<ActionLoader>,
|
|
||||||
pub wake: Vec<ActionLoader>,
|
|
||||||
pub sleep: Vec<ActionLoader>,
|
|
||||||
pub shutdown: Vec<ActionLoader>,
|
|
||||||
pub brightness: f32,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<AnimeConfigV460> for AnimeConfig {
|
|
||||||
fn from(c: AnimeConfigV460) -> AnimeConfig {
|
|
||||||
AnimeConfig {
|
|
||||||
system: c.system,
|
|
||||||
boot: c.boot,
|
|
||||||
wake: c.wake,
|
|
||||||
shutdown: c.shutdown,
|
|
||||||
..Default::default()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize, Debug)]
|
|
||||||
pub struct AnimeConfigV472 {
|
|
||||||
pub model_override: Option<AnimeType>,
|
|
||||||
pub system: Vec<ActionLoader>,
|
|
||||||
pub boot: Vec<ActionLoader>,
|
|
||||||
pub wake: Vec<ActionLoader>,
|
|
||||||
pub sleep: Vec<ActionLoader>,
|
|
||||||
pub shutdown: Vec<ActionLoader>,
|
|
||||||
pub brightness: f32,
|
|
||||||
pub display_enabled: bool,
|
|
||||||
pub display_brightness: Brightness,
|
|
||||||
pub builtin_anims_enabled: bool,
|
|
||||||
pub builtin_anims: Animations,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<AnimeConfigV472> for AnimeConfig {
|
|
||||||
fn from(c: AnimeConfigV472) -> AnimeConfig {
|
|
||||||
AnimeConfig {
|
|
||||||
system: c.system,
|
|
||||||
boot: c.boot,
|
|
||||||
wake: c.wake,
|
|
||||||
shutdown: c.shutdown,
|
|
||||||
model_override: c.model_override,
|
|
||||||
display_enabled: c.display_enabled,
|
|
||||||
display_brightness: c.display_brightness,
|
|
||||||
builtin_anims_enabled: c.builtin_anims_enabled,
|
|
||||||
builtin_anims: c.builtin_anims,
|
|
||||||
..Default::default()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize, Default)]
|
#[derive(Deserialize, Serialize, Default)]
|
||||||
pub struct AnimeConfigCached {
|
pub struct AnimeConfigCached {
|
||||||
pub system: Vec<ActionData>,
|
pub system: Vec<ActionData>,
|
||||||
@@ -108,7 +54,6 @@ impl AnimeConfigCached {
|
|||||||
/// Config for base system actions for the anime display
|
/// Config for base system actions for the anime display
|
||||||
#[derive(Deserialize, Serialize, Debug, Clone)]
|
#[derive(Deserialize, Serialize, Debug, Clone)]
|
||||||
pub struct AnimeConfig {
|
pub struct AnimeConfig {
|
||||||
pub model_override: Option<AnimeType>,
|
|
||||||
pub system: Vec<ActionLoader>,
|
pub system: Vec<ActionLoader>,
|
||||||
pub boot: Vec<ActionLoader>,
|
pub boot: Vec<ActionLoader>,
|
||||||
pub wake: Vec<ActionLoader>,
|
pub wake: Vec<ActionLoader>,
|
||||||
@@ -127,7 +72,6 @@ pub struct AnimeConfig {
|
|||||||
impl Default for AnimeConfig {
|
impl Default for AnimeConfig {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
AnimeConfig {
|
AnimeConfig {
|
||||||
model_override: None,
|
|
||||||
system: Vec::new(),
|
system: Vec::new(),
|
||||||
boot: Vec::new(),
|
boot: Vec::new(),
|
||||||
wake: Vec::new(),
|
wake: Vec::new(),
|
||||||
@@ -159,7 +103,7 @@ impl StdConfig for AnimeConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StdConfigLoad2<AnimeConfigV460, AnimeConfigV472> for AnimeConfig {}
|
impl StdConfigLoad for AnimeConfig {}
|
||||||
|
|
||||||
impl From<&AnimeConfig> for DeviceState {
|
impl From<&AnimeConfig> for DeviceState {
|
||||||
fn from(config: &AnimeConfig) -> Self {
|
fn from(config: &AnimeConfig) -> Self {
|
||||||
|
|||||||
@@ -8,11 +8,11 @@ use std::sync::Arc;
|
|||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
|
|
||||||
use ::zbus::export::futures_util::lock::Mutex;
|
use ::zbus::export::futures_util::lock::Mutex;
|
||||||
use config_traits::{StdConfig, StdConfigLoad2};
|
use config_traits::{StdConfig, StdConfigLoad};
|
||||||
use log::{error, info, warn};
|
use log::{error, info, warn};
|
||||||
use rog_anime::error::AnimeError;
|
use rog_anime::error::AnimeError;
|
||||||
use rog_anime::usb::{
|
use rog_anime::usb::{
|
||||||
get_anime_type, pkt_flush, pkt_set_brightness, pkt_set_enable_display,
|
get_maybe_anime_type, pkt_flush, pkt_set_brightness, pkt_set_enable_display,
|
||||||
pkt_set_enable_powersave_anim, pkts_for_init, Brightness,
|
pkt_set_enable_powersave_anim, pkts_for_init, Brightness,
|
||||||
};
|
};
|
||||||
use rog_anime::{ActionData, AnimeDataBuffer, AnimePacketType, AnimeType};
|
use rog_anime::{ActionData, AnimeDataBuffer, AnimePacketType, AnimeType};
|
||||||
@@ -64,6 +64,12 @@ pub struct CtrlAnime {
|
|||||||
impl CtrlAnime {
|
impl CtrlAnime {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new() -> Result<CtrlAnime, RogError> {
|
pub fn new() -> Result<CtrlAnime, RogError> {
|
||||||
|
let anime_type = get_maybe_anime_type()?;
|
||||||
|
if matches!(anime_type, AnimeType::Unsupported) {
|
||||||
|
info!("No Anime Matrix capable laptop found");
|
||||||
|
return Err(RogError::Anime(AnimeError::NoDevice));
|
||||||
|
}
|
||||||
|
|
||||||
let usb = USBRaw::new(0x193b).ok();
|
let usb = USBRaw::new(0x193b).ok();
|
||||||
let hid = HidRaw::new("193b").ok();
|
let hid = HidRaw::new("193b").ok();
|
||||||
let node = if usb.is_some() {
|
let node = if usb.is_some() {
|
||||||
@@ -91,13 +97,6 @@ impl CtrlAnime {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
let mut config = AnimeConfig::new().load();
|
let mut config = AnimeConfig::new().load();
|
||||||
let mut anime_type = get_anime_type()?;
|
|
||||||
if let AnimeType::Unknown = anime_type {
|
|
||||||
if let Some(model) = config.model_override {
|
|
||||||
warn!("Overriding the Animatrix type as {model:?}");
|
|
||||||
anime_type = model;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
info!("Device has an AniMe Matrix display: {anime_type:?}");
|
info!("Device has an AniMe Matrix display: {anime_type:?}");
|
||||||
let mut cache = AnimeConfigCached::default();
|
let mut cache = AnimeConfigCached::default();
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ use rog_aura::keyboard::LaptopAuraPower;
|
|||||||
use rog_aura::{
|
use rog_aura::{
|
||||||
AuraDeviceType, AuraEffect, AuraModeNum, AuraZone, Direction, LedBrightness, Speed, GRADIENT,
|
AuraDeviceType, AuraEffect, AuraModeNum, AuraZone, Direction, LedBrightness, Speed, GRADIENT,
|
||||||
};
|
};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
use crate::error::RogError;
|
||||||
|
|
||||||
#[derive(Deserialize, Serialize, Default, Debug, Clone)]
|
#[derive(Deserialize, Serialize, Default, Debug, Clone)]
|
||||||
// #[serde(default)]
|
// #[serde(default)]
|
||||||
@@ -130,6 +132,37 @@ impl AuraConfig {
|
|||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Create a default for the `current_mode` if multizone and no config
|
||||||
|
/// exists.
|
||||||
|
pub(super) fn create_multizone_default(
|
||||||
|
&mut self,
|
||||||
|
supported_data: &LedSupportData,
|
||||||
|
) -> Result<(), RogError> {
|
||||||
|
let mut default = vec![];
|
||||||
|
for (i, tmp) in supported_data.basic_zones.iter().enumerate() {
|
||||||
|
default.push(AuraEffect {
|
||||||
|
mode: self.current_mode,
|
||||||
|
zone: *tmp,
|
||||||
|
colour1: *GRADIENT.get(i).unwrap_or(&GRADIENT[0]),
|
||||||
|
colour2: *GRADIENT.get(GRADIENT.len() - i).unwrap_or(&GRADIENT[6]),
|
||||||
|
speed: Speed::Med,
|
||||||
|
direction: Direction::Left,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if default.is_empty() {
|
||||||
|
return Err(RogError::AuraEffectNotSupported);
|
||||||
|
}
|
||||||
|
|
||||||
|
if let Some(multizones) = self.multizone.as_mut() {
|
||||||
|
multizones.insert(self.current_mode, default);
|
||||||
|
} else {
|
||||||
|
let mut tmp = BTreeMap::new();
|
||||||
|
tmp.insert(self.current_mode, default);
|
||||||
|
self.multizone = Some(tmp);
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use std::collections::{BTreeMap, HashSet};
|
use std::collections::HashSet;
|
||||||
|
|
||||||
use config_traits::{StdConfig, StdConfigLoad};
|
use config_traits::{StdConfig, StdConfigLoad};
|
||||||
use dmi_id::DMIID;
|
use dmi_id::DMIID;
|
||||||
@@ -7,9 +7,7 @@ use log::{debug, info, warn};
|
|||||||
use rog_aura::aura_detection::LedSupportData;
|
use rog_aura::aura_detection::LedSupportData;
|
||||||
use rog_aura::keyboard::{LedUsbPackets, UsbPackets};
|
use rog_aura::keyboard::{LedUsbPackets, UsbPackets};
|
||||||
use rog_aura::usb::{LED_APPLY, LED_SET};
|
use rog_aura::usb::{LED_APPLY, LED_SET};
|
||||||
use rog_aura::{
|
use rog_aura::{AuraDeviceType, AuraEffect, LedBrightness, LED_MSG_LEN};
|
||||||
AuraDeviceType, AuraEffect, Direction, LedBrightness, Speed, GRADIENT, LED_MSG_LEN,
|
|
||||||
};
|
|
||||||
use rog_platform::hid_raw::HidRaw;
|
use rog_platform::hid_raw::HidRaw;
|
||||||
use rog_platform::keyboard_led::KeyboardBacklight;
|
use rog_platform::keyboard_led::KeyboardBacklight;
|
||||||
use udev::Device;
|
use udev::Device;
|
||||||
@@ -180,7 +178,7 @@ impl CtrlKbdLed {
|
|||||||
info!("AuraControl found device at: {:?}", dev_node);
|
info!("AuraControl found device at: {:?}", dev_node);
|
||||||
let dev = HidRaw::from_device(device)?;
|
let dev = HidRaw::from_device(device)?;
|
||||||
let mut controller = Self::from_hidraw(dev, dbus_path.clone())?;
|
let mut controller = Self::from_hidraw(dev, dbus_path.clone())?;
|
||||||
controller.config = Self::init_config(&prod_id);
|
controller.config = Self::load_and_update_config(&prod_id);
|
||||||
interfaces.insert(dbus_path);
|
interfaces.insert(dbus_path);
|
||||||
return Ok(Some(controller));
|
return Ok(Some(controller));
|
||||||
}
|
}
|
||||||
@@ -225,7 +223,7 @@ impl CtrlKbdLed {
|
|||||||
led_node: LEDNode::KbdLed(kbd_backlight),
|
led_node: LEDNode::KbdLed(kbd_backlight),
|
||||||
supported_data: LedSupportData::get_data("tuf"),
|
supported_data: LedSupportData::get_data("tuf"),
|
||||||
per_key_mode_active: false,
|
per_key_mode_active: false,
|
||||||
config: Self::init_config("tuf"),
|
config: Self::load_and_update_config("tuf"),
|
||||||
dbus_path: dbus_path_for_tuf(),
|
dbus_path: dbus_path_for_tuf(),
|
||||||
};
|
};
|
||||||
devices.push(ctrl);
|
devices.push(ctrl);
|
||||||
@@ -244,7 +242,7 @@ impl CtrlKbdLed {
|
|||||||
/// The generated data from this function has a default config. This config
|
/// The generated data from this function has a default config. This config
|
||||||
/// should be overwritten. The reason for the default config is because
|
/// should be overwritten. The reason for the default config is because
|
||||||
/// of async issues between this and udev/hidraw
|
/// of async issues between this and udev/hidraw
|
||||||
pub fn from_hidraw(device: HidRaw, dbus_path: OwnedObjectPath) -> Result<Self, RogError> {
|
fn from_hidraw(device: HidRaw, dbus_path: OwnedObjectPath) -> Result<Self, RogError> {
|
||||||
let rgb_led = KeyboardBacklight::new()
|
let rgb_led = KeyboardBacklight::new()
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
log::error!(
|
log::error!(
|
||||||
@@ -274,7 +272,8 @@ impl CtrlKbdLed {
|
|||||||
Ok(ctrl)
|
Ok(ctrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init_config(prod_id: &str) -> AuraConfig {
|
/// Reload the config from disk then verify and update it if required
|
||||||
|
fn load_and_update_config(prod_id: &str) -> AuraConfig {
|
||||||
// New loads data from the DB also
|
// New loads data from the DB also
|
||||||
let mut config_init = AuraConfig::new(prod_id);
|
let mut config_init = AuraConfig::new(prod_id);
|
||||||
// config_init.set_filename(prod_id);
|
// config_init.set_filename(prod_id);
|
||||||
@@ -289,6 +288,12 @@ impl CtrlKbdLed {
|
|||||||
// Then replace just incase the initialised data contains new modes added
|
// Then replace just incase the initialised data contains new modes added
|
||||||
config_loaded.builtins = config_init.builtins;
|
config_loaded.builtins = config_init.builtins;
|
||||||
|
|
||||||
|
// Check the powerzones and replace, if the len is different then the support
|
||||||
|
// file was updated
|
||||||
|
if config_loaded.enabled.states.len() != config_init.enabled.states.len() {
|
||||||
|
config_loaded.enabled.states = config_init.enabled.states;
|
||||||
|
}
|
||||||
|
|
||||||
if let (Some(mut multizone_init), Some(multizone_loaded)) =
|
if let (Some(mut multizone_init), Some(multizone_loaded)) =
|
||||||
(config_init.multizone, config_loaded.multizone.as_mut())
|
(config_init.multizone, config_loaded.multizone.as_mut())
|
||||||
{
|
{
|
||||||
@@ -374,7 +379,8 @@ impl CtrlKbdLed {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_mode(&mut self, mode: &AuraEffect) -> Result<(), RogError> {
|
/// Write the AuraEffect to the device
|
||||||
|
pub fn write_effect_and_apply(&mut self, mode: &AuraEffect) -> Result<(), RogError> {
|
||||||
if let LEDNode::KbdLed(platform) = &self.led_node {
|
if let LEDNode::KbdLed(platform) = &self.led_node {
|
||||||
let buf = [
|
let buf = [
|
||||||
1,
|
1,
|
||||||
@@ -414,53 +420,25 @@ impl CtrlKbdLed {
|
|||||||
}
|
}
|
||||||
if create {
|
if create {
|
||||||
info!("No user-set config for zone founding, attempting a default");
|
info!("No user-set config for zone founding, attempting a default");
|
||||||
self.create_multizone_default()?;
|
self.config.create_multizone_default(&self.supported_data)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(multizones) = self.config.multizone.as_mut() {
|
if let Some(multizones) = self.config.multizone.as_mut() {
|
||||||
if let Some(set) = multizones.get(&mode) {
|
if let Some(set) = multizones.get(&mode) {
|
||||||
for mode in set.clone() {
|
for mode in set.clone() {
|
||||||
self.write_mode(&mode)?;
|
self.write_effect_and_apply(&mode)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let mode = self.config.current_mode;
|
let mode = self.config.current_mode;
|
||||||
if let Some(effect) = self.config.builtins.get(&mode).cloned() {
|
if let Some(effect) = self.config.builtins.get(&mode).cloned() {
|
||||||
self.write_mode(&effect)?;
|
self.write_effect_and_apply(&effect)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a default for the `current_mode` if multizone and no config
|
|
||||||
/// exists.
|
|
||||||
fn create_multizone_default(&mut self) -> Result<(), RogError> {
|
|
||||||
let mut default = vec![];
|
|
||||||
for (i, tmp) in self.supported_data.basic_zones.iter().enumerate() {
|
|
||||||
default.push(AuraEffect {
|
|
||||||
mode: self.config.current_mode,
|
|
||||||
zone: *tmp,
|
|
||||||
colour1: *GRADIENT.get(i).unwrap_or(&GRADIENT[0]),
|
|
||||||
colour2: *GRADIENT.get(GRADIENT.len() - i).unwrap_or(&GRADIENT[6]),
|
|
||||||
speed: Speed::Med,
|
|
||||||
direction: Direction::Left,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if default.is_empty() {
|
|
||||||
return Err(RogError::AuraEffectNotSupported);
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some(multizones) = self.config.multizone.as_mut() {
|
|
||||||
multizones.insert(self.config.current_mode, default);
|
|
||||||
} else {
|
|
||||||
let mut tmp = BTreeMap::new();
|
|
||||||
tmp.insert(self.config.current_mode, default);
|
|
||||||
self.config.multizone = Some(tmp);
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@@ -502,12 +480,18 @@ mod tests {
|
|||||||
};
|
};
|
||||||
|
|
||||||
assert!(controller.config.multizone.is_none());
|
assert!(controller.config.multizone.is_none());
|
||||||
assert!(controller.create_multizone_default().is_err());
|
assert!(controller
|
||||||
|
.config
|
||||||
|
.create_multizone_default(&controller.supported_data)
|
||||||
|
.is_err());
|
||||||
assert!(controller.config.multizone.is_none());
|
assert!(controller.config.multizone.is_none());
|
||||||
|
|
||||||
controller.supported_data.basic_zones.push(AuraZone::Key1);
|
controller.supported_data.basic_zones.push(AuraZone::Key1);
|
||||||
controller.supported_data.basic_zones.push(AuraZone::Key2);
|
controller.supported_data.basic_zones.push(AuraZone::Key2);
|
||||||
assert!(controller.create_multizone_default().is_ok());
|
assert!(controller
|
||||||
|
.config
|
||||||
|
.create_multizone_default(&controller.supported_data)
|
||||||
|
.is_ok());
|
||||||
assert!(controller.config.multizone.is_some());
|
assert!(controller.config.multizone.is_some());
|
||||||
|
|
||||||
let m = controller.config.multizone.unwrap();
|
let m = controller.config.multizone.unwrap();
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ impl CtrlAuraZbus {
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
ctrl.write_mode(&effect)?;
|
ctrl.write_effect_and_apply(&effect)?;
|
||||||
if ctrl.config.brightness == LedBrightness::Off {
|
if ctrl.config.brightness == LedBrightness::Off {
|
||||||
ctrl.config.brightness = LedBrightness::Med;
|
ctrl.config.brightness = LedBrightness::Med;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use rog_platform::platform::{RogPlatform, ThrottlePolicy};
|
|||||||
use rog_profiles::error::ProfileError;
|
use rog_profiles::error::ProfileError;
|
||||||
use rog_profiles::fan_curve_set::CurveData;
|
use rog_profiles::fan_curve_set::CurveData;
|
||||||
use rog_profiles::{find_fan_curve_node, FanCurvePU, FanCurveProfiles};
|
use rog_profiles::{find_fan_curve_node, FanCurvePU, FanCurveProfiles};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
use zbus::{interface, Connection, SignalContext};
|
use zbus::{interface, Connection, SignalContext};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use config_traits::{StdConfig, StdConfigLoad};
|
use config_traits::{StdConfig, StdConfigLoad};
|
||||||
use rog_slash::{DeviceState, SlashMode};
|
use rog_slash::{DeviceState, SlashMode};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
const CONFIG_FILE: &str = "slash.ron";
|
const CONFIG_FILE: &str = "slash.ron";
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,11 @@ pub mod config;
|
|||||||
pub mod trait_impls;
|
pub mod trait_impls;
|
||||||
|
|
||||||
use config_traits::{StdConfig, StdConfigLoad};
|
use config_traits::{StdConfig, StdConfigLoad};
|
||||||
|
use log::info;
|
||||||
use rog_platform::hid_raw::HidRaw;
|
use rog_platform::hid_raw::HidRaw;
|
||||||
use rog_platform::usb_raw::USBRaw;
|
use rog_platform::usb_raw::USBRaw;
|
||||||
use rog_slash::error::SlashError;
|
use rog_slash::error::SlashError;
|
||||||
use rog_slash::usb::{get_slash_type, pkt_set_mode, pkt_set_options, pkts_for_init};
|
use rog_slash::usb::{get_maybe_slash_type, pkt_set_mode, pkt_set_options, pkts_for_init};
|
||||||
use rog_slash::{SlashMode, SlashType};
|
use rog_slash::{SlashMode, SlashType};
|
||||||
|
|
||||||
use crate::ctrl_slash::config::SlashConfig;
|
use crate::ctrl_slash::config::SlashConfig;
|
||||||
@@ -39,8 +40,9 @@ pub struct CtrlSlash {
|
|||||||
impl CtrlSlash {
|
impl CtrlSlash {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn new() -> Result<CtrlSlash, RogError> {
|
pub fn new() -> Result<CtrlSlash, RogError> {
|
||||||
let slash_type = get_slash_type()?;
|
let slash_type = get_maybe_slash_type()?;
|
||||||
if matches!(slash_type, SlashType::Unknown | SlashType::Unsupported) {
|
if matches!(slash_type, SlashType::Unsupported) {
|
||||||
|
info!("No Slash capable laptop found");
|
||||||
return Err(RogError::Slash(SlashError::NoDevice));
|
return Err(RogError::Slash(SlashError::NoDevice));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +53,7 @@ impl CtrlSlash {
|
|||||||
} else if hid.is_some() {
|
} else if hid.is_some() {
|
||||||
unsafe { Node::Hid(hid.unwrap_unchecked()) }
|
unsafe { Node::Hid(hid.unwrap_unchecked()) }
|
||||||
} else {
|
} else {
|
||||||
return Err(RogError::NotSupported);
|
return Err(RogError::Slash(SlashError::NoDevice));
|
||||||
};
|
};
|
||||||
|
|
||||||
let ctrl = CtrlSlash {
|
let ctrl = CtrlSlash {
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ gif.workspace = true
|
|||||||
log.workspace = true
|
log.workspace = true
|
||||||
|
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_derive.workspace = true
|
|
||||||
|
|
||||||
glam.workspace = true
|
glam.workspace = true
|
||||||
typeshare.workspace = true
|
typeshare.workspace = true
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use std::thread::sleep;
|
|||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
use log::info;
|
use log::info;
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
use typeshare::typeshare;
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||||
@@ -62,7 +62,7 @@ pub enum AnimeType {
|
|||||||
GA401,
|
GA401,
|
||||||
GA402,
|
GA402,
|
||||||
GU604,
|
GU604,
|
||||||
Unknown,
|
Unsupported,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FromStr for AnimeType {
|
impl FromStr for AnimeType {
|
||||||
@@ -73,7 +73,7 @@ impl FromStr for AnimeType {
|
|||||||
"ga401" | "GA401" => Self::GA401,
|
"ga401" | "GA401" => Self::GA401,
|
||||||
"ga402" | "GA402" => Self::GA402,
|
"ga402" | "GA402" => Self::GA402,
|
||||||
"gu604" | "GU604" => Self::GU604,
|
"gu604" | "GU604" => Self::GU604,
|
||||||
_ => Self::Unknown,
|
_ => Self::Unsupported,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -165,7 +165,7 @@ impl TryFrom<AnimeDataBuffer> for AnimePacketType {
|
|||||||
|
|
||||||
let mut buffers = match anime.anime {
|
let mut buffers = match anime.anime {
|
||||||
AnimeType::GA401 => vec![[0; 640]; 2],
|
AnimeType::GA401 => vec![[0; 640]; 2],
|
||||||
AnimeType::GA402 | AnimeType::GU604 | AnimeType::Unknown => vec![[0; 640]; 3],
|
AnimeType::GA402 | AnimeType::GU604 | AnimeType::Unsupported => vec![[0; 640]; 3],
|
||||||
};
|
};
|
||||||
|
|
||||||
for (idx, chunk) in anime.data.as_slice().chunks(PANE_LEN).enumerate() {
|
for (idx, chunk) in anime.data.as_slice().chunks(PANE_LEN).enumerate() {
|
||||||
@@ -176,7 +176,7 @@ impl TryFrom<AnimeDataBuffer> for AnimePacketType {
|
|||||||
|
|
||||||
if matches!(
|
if matches!(
|
||||||
anime.anime,
|
anime.anime,
|
||||||
AnimeType::GA402 | AnimeType::GU604 | AnimeType::Unknown
|
AnimeType::GA402 | AnimeType::GU604 | AnimeType::Unsupported
|
||||||
) {
|
) {
|
||||||
buffers[2][..7].copy_from_slice(&USB_PREFIX3);
|
buffers[2][..7].copy_from_slice(&USB_PREFIX3);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use std::time::Duration;
|
|||||||
|
|
||||||
use glam::Vec2;
|
use glam::Vec2;
|
||||||
use log::error;
|
use log::error;
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::error::{AnimeError, Result};
|
use crate::error::{AnimeError, Result};
|
||||||
use crate::{AnimeDataBuffer, AnimeDiagonal, AnimeImage, AnimeType, Pixel};
|
use crate::{AnimeDataBuffer, AnimeDiagonal, AnimeImage, AnimeType, Pixel};
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use std::path::PathBuf;
|
|||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use glam::Vec2;
|
use glam::Vec2;
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::error::Result;
|
use crate::error::Result;
|
||||||
use crate::{AnimTime, AnimeDataBuffer, AnimeDiagonal, AnimeGif, AnimeImage, AnimeType};
|
use crate::{AnimTime, AnimeDataBuffer, AnimeDiagonal, AnimeGif, AnimeImage, AnimeType};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use dmi_id::DMIID;
|
use dmi_id::DMIID;
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
use typeshare::typeshare;
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||||
@@ -241,25 +241,25 @@ impl From<AnimShutdown> for i32 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// `get_anime_type` is very broad, matching on part of the laptop board name
|
/// `get_maybe_anime_type` is very broad, matching on part of the laptop board
|
||||||
/// only. For this reason `find_node()` must be used also to verify if the USB
|
/// name only. For this reason `find_node()` must be used also to verify if the
|
||||||
/// device is available.
|
/// USB device is available.
|
||||||
///
|
///
|
||||||
/// The currently known USB device is `19b6`.
|
/// The currently known USB device is `19b6`.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_anime_type() -> Result<AnimeType, AnimeError> {
|
pub fn get_maybe_anime_type() -> Result<AnimeType, AnimeError> {
|
||||||
let dmi = DMIID::new().map_err(|_| AnimeError::NoDevice)?; // TODO: better error
|
let dmi = DMIID::new().map_err(|_| AnimeError::NoDevice)?; // TODO: better error
|
||||||
let board_name = dmi.board_name;
|
let board_name = dmi.board_name;
|
||||||
|
|
||||||
if board_name.contains("GA401I") || board_name.contains("GA401Q") {
|
if board_name.contains("GA401I") || board_name.contains("GA401Q") {
|
||||||
return Ok(AnimeType::GA401);
|
return Ok(AnimeType::GA401);
|
||||||
} else if board_name.contains("GA402R") {
|
} else if board_name.contains("GA402R") || board_name.contains("GA402X") {
|
||||||
return Ok(AnimeType::GA402);
|
return Ok(AnimeType::GA402);
|
||||||
} else if board_name.contains("GU604V") {
|
} else if board_name.contains("GU604V") {
|
||||||
return Ok(AnimeType::GU604);
|
return Ok(AnimeType::GU604);
|
||||||
}
|
}
|
||||||
log::warn!("AniMe Matrix device found but not yet supported, will default to a GA402 layout");
|
log::warn!("AniMe Matrix device found but could be a slash");
|
||||||
Ok(AnimeType::Unknown)
|
Ok(AnimeType::Unsupported)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the two device initialization packets. These are required for device
|
/// Get the two device initialization packets. These are required for device
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ dbus = ["zbus"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_derive.workspace = true
|
|
||||||
zbus = { workspace = true, optional = true }
|
zbus = { workspace = true, optional = true }
|
||||||
dmi_id = { path = "../dmi-id" }
|
dmi_id = { path = "../dmi-id" }
|
||||||
|
|
||||||
|
|||||||
+129
-102
@@ -3,7 +3,7 @@
|
|||||||
device_name: "FA506I",
|
device_name: "FA506I",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "fa506i",
|
layout_name: "fa506i",
|
||||||
basic_modes: [Static, Breathe, Strobe, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
device_name: "FA506Q",
|
device_name: "FA506Q",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "fa506i",
|
layout_name: "fa506i",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
device_name: "FA507",
|
device_name: "FA507",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "fa507",
|
layout_name: "fa507",
|
||||||
basic_modes: [Static, Breathe, Strobe, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
device_name: "FX505",
|
device_name: "FX505",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "fx505d",
|
layout_name: "fx505d",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
device_name: "FX506",
|
device_name: "FX506",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "fa506i",
|
layout_name: "fa506i",
|
||||||
basic_modes: [Static, Breathe, Strobe, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
device_name: "FX507Z",
|
device_name: "FX507Z",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "fa506i",
|
layout_name: "fa506i",
|
||||||
basic_modes: [Static, Breathe, Strobe, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
device_name: "FX516P",
|
device_name: "FX516P",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "fa506i",
|
layout_name: "fa506i",
|
||||||
basic_modes: [Static, Breathe, Strobe],
|
basic_modes: [Static, Breathe, RainbowCycle],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
device_name: "FX705D",
|
device_name: "FX705D",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "fx505d",
|
layout_name: "fx505d",
|
||||||
basic_modes: [Static, Breathe, Strobe, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
device_name: "G512L",
|
device_name: "G512L",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g512",
|
layout_name: "g512",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard, Lightbar],
|
power_zones: [Keyboard, Lightbar],
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
device_name: "G512LI",
|
device_name: "G512LI",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g512",
|
layout_name: "g512",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard, Lightbar],
|
power_zones: [Keyboard, Lightbar],
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
device_name: "G513I",
|
device_name: "G513I",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g513i",
|
layout_name: "g513i",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: Zoned([ZonedKbLeft, ZonedKbLeftMid, ZonedKbRightMid, ZonedKbRight, LightbarRight, LightbarRightCorner, LightbarRightBottom, LightbarLeftBottom, LightbarLeftCorner, LightbarLeft]),
|
advanced_type: Zoned([ZonedKbLeft, ZonedKbLeftMid, ZonedKbRightMid, ZonedKbRight, LightbarRight, LightbarRightCorner, LightbarRightBottom, LightbarLeftBottom, LightbarLeftCorner, LightbarLeft]),
|
||||||
power_zones: [Keyboard, Lightbar],
|
power_zones: [Keyboard, Lightbar],
|
||||||
@@ -101,44 +101,44 @@
|
|||||||
(
|
(
|
||||||
device_name: "G513Q",
|
device_name: "G513Q",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g513i-per-key",
|
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
|
||||||
basic_zones: [],
|
|
||||||
advanced_type: PerKey,
|
|
||||||
power_zones: [Keyboard],
|
|
||||||
),
|
|
||||||
(
|
|
||||||
device_name: "G513QE",
|
|
||||||
product_id: "",
|
|
||||||
layout_name: "g513i",
|
layout_name: "g513i",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard, Lightbar],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
device_name: "G513QY",
|
device_name: "G513QR",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g513i-per-key",
|
layout_name: "g513i-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard, Lightbar],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
device_name: "G513RC",
|
device_name: "G513RC",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g513i",
|
layout_name: "g513i",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: Zoned([ZonedKbLeft, ZonedKbLeftMid, ZonedKbRightMid, ZonedKbRight, LightbarRight, LightbarRightCorner, LightbarRightBottom, LightbarLeftBottom, LightbarLeftCorner, LightbarLeft]),
|
advanced_type: Zoned([ZonedKbLeft, ZonedKbLeftMid, ZonedKbRightMid, ZonedKbRight, LightbarRight, LightbarRightCorner, LightbarRightBottom, LightbarLeftBottom, LightbarLeftCorner, LightbarLeft]),
|
||||||
power_zones: [Keyboard, Lightbar],
|
power_zones: [Keyboard, Lightbar],
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
device_name: "G513RM",
|
||||||
|
product_id: "",
|
||||||
|
layout_name: "g513i",
|
||||||
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
|
advanced_type: None,
|
||||||
|
power_zones: [Keyboard, Lightbar],
|
||||||
|
),
|
||||||
(
|
(
|
||||||
device_name: "G513RS",
|
device_name: "G513RS",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g513i-per-key",
|
layout_name: "g513i-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard, Lightbar],
|
power_zones: [Keyboard, Lightbar],
|
||||||
@@ -147,7 +147,7 @@
|
|||||||
device_name: "G513RW",
|
device_name: "G513RW",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g513i-per-key",
|
layout_name: "g513i-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard, Lightbar],
|
power_zones: [Keyboard, Lightbar],
|
||||||
@@ -156,7 +156,7 @@
|
|||||||
device_name: "G531",
|
device_name: "G531",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g513i-per-key",
|
layout_name: "g513i-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -165,7 +165,7 @@
|
|||||||
device_name: "G531GD",
|
device_name: "G531GD",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -174,7 +174,7 @@
|
|||||||
device_name: "G531GT",
|
device_name: "G531GT",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
device_name: "G531GU",
|
device_name: "G531GU",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -192,7 +192,7 @@
|
|||||||
device_name: "G531GV",
|
device_name: "G531GV",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -201,7 +201,7 @@
|
|||||||
device_name: "G531GW",
|
device_name: "G531GW",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -210,7 +210,7 @@
|
|||||||
device_name: "G532",
|
device_name: "G532",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -219,16 +219,16 @@
|
|||||||
device_name: "G533Q",
|
device_name: "G533Q",
|
||||||
product_id: "1866",
|
product_id: "1866",
|
||||||
layout_name: "g533q-per-key",
|
layout_name: "g533q-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard, Lightbar],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
device_name: "G533Z",
|
device_name: "G533Z",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g533q-per-key",
|
layout_name: "g533q-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -237,7 +237,7 @@
|
|||||||
device_name: "G614J",
|
device_name: "G614J",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g634j-per-key",
|
layout_name: "g634j-per-key",
|
||||||
basic_modes: [Static, Breathe, Pulse, Strobe, Rainbow],
|
basic_modes: [Static, Breathe, Pulse, RainbowCycle, RainbowWave],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard, Lightbar],
|
power_zones: [Keyboard, Lightbar],
|
||||||
@@ -246,7 +246,7 @@
|
|||||||
device_name: "G634J",
|
device_name: "G634J",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g634j-per-key",
|
layout_name: "g634j-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard, Lightbar, Logo, RearGlow],
|
power_zones: [Keyboard, Lightbar, Logo, RearGlow],
|
||||||
@@ -255,7 +255,7 @@
|
|||||||
device_name: "G712LI",
|
device_name: "G712LI",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gl503",
|
layout_name: "gl503",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -264,7 +264,7 @@
|
|||||||
device_name: "G712LV",
|
device_name: "G712LV",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -273,7 +273,7 @@
|
|||||||
device_name: "G712LW",
|
device_name: "G712LW",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -282,43 +282,61 @@
|
|||||||
device_name: "G713IC",
|
device_name: "G713IC",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: PerKey,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard, Lightbar],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
device_name: "G713P",
|
device_name: "G713P",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
device_name: "G713QM",
|
device_name: "G713QC",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard, Lightbar],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
device_name: "G713QE",
|
||||||
|
product_id: "",
|
||||||
|
layout_name: "gx502",
|
||||||
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
|
advanced_type: None,
|
||||||
|
power_zones: [Keyboard, Lightbar],
|
||||||
|
),
|
||||||
|
(
|
||||||
|
device_name: "G713QM",
|
||||||
|
product_id: "",
|
||||||
|
layout_name: "gx502",
|
||||||
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
|
basic_zones: [],
|
||||||
|
advanced_type: PerKey,
|
||||||
|
power_zones: [Keyboard, Lightbar],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
device_name: "G713QR",
|
device_name: "G713QR",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard, Lightbar],
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
device_name: "G713RC",
|
device_name: "G713RC",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: Zoned([ZonedKbLeft, ZonedKbLeftMid, ZonedKbRightMid, ZonedKbRight, LightbarRight, LightbarRightCorner, LightbarRightBottom, LightbarLeftBottom, LightbarLeftCorner, LightbarLeft]),
|
advanced_type: Zoned([ZonedKbLeft, ZonedKbLeftMid, ZonedKbRightMid, ZonedKbRight, LightbarRight, LightbarRightCorner, LightbarRightBottom, LightbarLeftBottom, LightbarLeftCorner, LightbarLeft]),
|
||||||
power_zones: [Keyboard, Lightbar],
|
power_zones: [Keyboard, Lightbar],
|
||||||
@@ -327,7 +345,7 @@
|
|||||||
device_name: "G713RM",
|
device_name: "G713RM",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -336,7 +354,7 @@
|
|||||||
device_name: "G713RS",
|
device_name: "G713RS",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -345,7 +363,7 @@
|
|||||||
device_name: "G713RW",
|
device_name: "G713RW",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4, BarLeft, BarRight],
|
basic_zones: [Key1, Key2, Key3, Key4, BarLeft, BarRight],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard, Lightbar],
|
power_zones: [Keyboard, Lightbar],
|
||||||
@@ -354,7 +372,7 @@
|
|||||||
device_name: "G731",
|
device_name: "G731",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g533q",
|
layout_name: "g533q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -363,7 +381,7 @@
|
|||||||
device_name: "G731GT",
|
device_name: "G731GT",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g533q",
|
layout_name: "g533q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -372,7 +390,7 @@
|
|||||||
device_name: "G731GU",
|
device_name: "G731GU",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g533q",
|
layout_name: "g533q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -381,7 +399,7 @@
|
|||||||
device_name: "G731GV",
|
device_name: "G731GV",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g533q",
|
layout_name: "g533q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -390,7 +408,7 @@
|
|||||||
device_name: "G731GW",
|
device_name: "G731GW",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g533q",
|
layout_name: "g533q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -399,7 +417,7 @@
|
|||||||
device_name: "G733C",
|
device_name: "G733C",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g513i-per-key",
|
layout_name: "g513i-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard, Lightbar, Logo, Lid],
|
power_zones: [Keyboard, Lightbar, Logo, Lid],
|
||||||
@@ -408,7 +426,7 @@
|
|||||||
device_name: "G733PZ",
|
device_name: "G733PZ",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g733pz-per-key",
|
layout_name: "g733pz-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard, Lightbar],
|
power_zones: [Keyboard, Lightbar],
|
||||||
@@ -417,7 +435,7 @@
|
|||||||
device_name: "G733Q",
|
device_name: "G733Q",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -426,7 +444,7 @@
|
|||||||
device_name: "G733Z",
|
device_name: "G733Z",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g513i-per-key",
|
layout_name: "g513i-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -435,7 +453,7 @@
|
|||||||
device_name: "G814J",
|
device_name: "G814J",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g814ji-per-key",
|
layout_name: "g814ji-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard, Lightbar],
|
power_zones: [Keyboard, Lightbar],
|
||||||
@@ -444,11 +462,20 @@
|
|||||||
device_name: "G834J",
|
device_name: "G834J",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g814ji-per-key",
|
layout_name: "g814ji-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard, Lightbar, Logo, RearGlow],
|
power_zones: [Keyboard, Lightbar, Logo, RearGlow],
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
device_name: "GA401I",
|
||||||
|
product_id: "",
|
||||||
|
layout_name: "ga401q",
|
||||||
|
basic_modes: [Static, Breathe, Pulse],
|
||||||
|
basic_zones: [],
|
||||||
|
advanced_type: None,
|
||||||
|
power_zones: [Keyboard],
|
||||||
|
),
|
||||||
(
|
(
|
||||||
device_name: "GA401Q",
|
device_name: "GA401Q",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
@@ -462,7 +489,7 @@
|
|||||||
device_name: "GA402N",
|
device_name: "GA402N",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Pulse, Rainbow, Strobe],
|
basic_modes: [Static, Breathe, Pulse, RainbowWave, RainbowCycle],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -471,7 +498,7 @@
|
|||||||
device_name: "GA402R",
|
device_name: "GA402R",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Pulse, Rainbow],
|
basic_modes: [Static, Breathe, Pulse, RainbowWave],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -480,7 +507,7 @@
|
|||||||
device_name: "GA402X",
|
device_name: "GA402X",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Pulse, Rainbow],
|
basic_modes: [Static, Breathe, Pulse, RainbowWave],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -489,7 +516,7 @@
|
|||||||
device_name: "GA402XV",
|
device_name: "GA402XV",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Comet],
|
basic_modes: [Static, Breathe, RainbowCycle, Comet],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -507,7 +534,7 @@
|
|||||||
device_name: "GA503Q",
|
device_name: "GA503Q",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Pulse, Rainbow, Strobe],
|
basic_modes: [Static, Breathe, Pulse, RainbowWave, RainbowCycle],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -525,7 +552,7 @@
|
|||||||
device_name: "GA503R",
|
device_name: "GA503R",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Pulse, Rainbow, Strobe],
|
basic_modes: [Static, Breathe, Pulse, RainbowWave, RainbowCycle],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -534,7 +561,7 @@
|
|||||||
device_name: "GL503",
|
device_name: "GL503",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gl503",
|
layout_name: "gl503",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -543,7 +570,7 @@
|
|||||||
device_name: "GL503V",
|
device_name: "GL503V",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gl503",
|
layout_name: "gl503",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -552,7 +579,7 @@
|
|||||||
device_name: "GL504G",
|
device_name: "GL504G",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gl503",
|
layout_name: "gl503",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4, Logo, BarLeft, BarRight],
|
basic_zones: [Key1, Key2, Key3, Key4, Logo, BarLeft, BarRight],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -561,7 +588,7 @@
|
|||||||
device_name: "GL531",
|
device_name: "GL531",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g512",
|
layout_name: "g512",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -570,7 +597,7 @@
|
|||||||
device_name: "GL553V",
|
device_name: "GL553V",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "g533q",
|
layout_name: "g533q",
|
||||||
basic_modes: [Static, Breathe, Strobe],
|
basic_modes: [Static, Breathe, RainbowCycle],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -579,7 +606,7 @@
|
|||||||
device_name: "GL703G",
|
device_name: "GL703G",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gl503",
|
layout_name: "gl503",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -588,7 +615,7 @@
|
|||||||
device_name: "GM501G",
|
device_name: "GM501G",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "fa507",
|
layout_name: "fa507",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -597,7 +624,7 @@
|
|||||||
device_name: "GU502",
|
device_name: "GU502",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -606,7 +633,7 @@
|
|||||||
device_name: "GU502L",
|
device_name: "GU502L",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -615,7 +642,7 @@
|
|||||||
device_name: "GU502LU",
|
device_name: "GU502LU",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -624,7 +651,7 @@
|
|||||||
device_name: "GU603H",
|
device_name: "GU603H",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: Zoned([SingleZone]),
|
advanced_type: Zoned([SingleZone]),
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -633,7 +660,7 @@
|
|||||||
device_name: "GU603V",
|
device_name: "GU603V",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: Zoned([SingleZone]),
|
advanced_type: Zoned([SingleZone]),
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -642,7 +669,7 @@
|
|||||||
device_name: "GU603Z",
|
device_name: "GU603Z",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: Zoned([SingleZone]),
|
advanced_type: Zoned([SingleZone]),
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -651,7 +678,7 @@
|
|||||||
device_name: "GU604V",
|
device_name: "GU604V",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: Zoned([SingleZone]),
|
advanced_type: Zoned([SingleZone]),
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -660,7 +687,7 @@
|
|||||||
device_name: "GU605M",
|
device_name: "GU605M",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: Zoned([SingleZone]),
|
advanced_type: Zoned([SingleZone]),
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -696,7 +723,7 @@
|
|||||||
device_name: "GV601R",
|
device_name: "GV601R",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -714,7 +741,7 @@
|
|||||||
device_name: "GV604V",
|
device_name: "GV604V",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "ga401q",
|
layout_name: "ga401q",
|
||||||
basic_modes: [Static, Breathe, Strobe, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -723,7 +750,7 @@
|
|||||||
device_name: "GX502",
|
device_name: "GX502",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx502",
|
layout_name: "gx502",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -732,7 +759,7 @@
|
|||||||
device_name: "GX531",
|
device_name: "GX531",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx531-per-key",
|
layout_name: "gx531-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [Key1, Key2, Key3, Key4],
|
basic_zones: [Key1, Key2, Key3, Key4],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -741,7 +768,7 @@
|
|||||||
device_name: "GX550L",
|
device_name: "GX550L",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx531-per-key",
|
layout_name: "gx531-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -750,7 +777,7 @@
|
|||||||
device_name: "GX551Q",
|
device_name: "GX551Q",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx531-per-key",
|
layout_name: "gx531-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Pulse],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Pulse],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -759,7 +786,7 @@
|
|||||||
device_name: "GX650P",
|
device_name: "GX650P",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx531-per-key",
|
layout_name: "gx531-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -768,7 +795,7 @@
|
|||||||
device_name: "GX650R",
|
device_name: "GX650R",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx531-per-key",
|
layout_name: "gx531-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -777,7 +804,7 @@
|
|||||||
device_name: "GX701",
|
device_name: "GX701",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx531-per-key",
|
layout_name: "gx531-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: PerKey,
|
advanced_type: PerKey,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -786,7 +813,7 @@
|
|||||||
device_name: "GX703H",
|
device_name: "GX703H",
|
||||||
product_id: "",
|
product_id: "",
|
||||||
layout_name: "gx531-per-key",
|
layout_name: "gx531-per-key",
|
||||||
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
basic_modes: [Static, Breathe, RainbowCycle, RainbowWave, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
|
||||||
basic_zones: [],
|
basic_zones: [],
|
||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
@@ -845,4 +872,4 @@
|
|||||||
advanced_type: None,
|
advanced_type: None,
|
||||||
power_zones: [Keyboard],
|
power_zones: [Keyboard],
|
||||||
),
|
),
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use std::env;
|
|||||||
|
|
||||||
use dmi_id::DMIID;
|
use dmi_id::DMIID;
|
||||||
use log::{error, info, warn};
|
use log::{error, info, warn};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::keyboard::AdvancedAuraType;
|
use crate::keyboard::AdvancedAuraType;
|
||||||
use crate::{AuraModeNum, AuraZone, PowerZones};
|
use crate::{AuraModeNum, AuraZone, PowerZones};
|
||||||
@@ -70,11 +70,9 @@ impl LedSupportData {
|
|||||||
// product_family");
|
// product_family");
|
||||||
|
|
||||||
if let Some(data) = LedSupportFile::load_from_supoprt_db() {
|
if let Some(data) = LedSupportFile::load_from_supoprt_db() {
|
||||||
if let Some(data) = data.match_device(&dmi.board_name, product_id) {
|
return data.match_device(&dmi.board_name, product_id);
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
info!("Using generic LED control for keyboard brightness only");
|
info!("Using generic LED control for keyboard brightness only. No aura_support file found");
|
||||||
let mut data = LedSupportData::default();
|
let mut data = LedSupportData::default();
|
||||||
data.power_zones.push(PowerZones::Keyboard);
|
data.power_zones.push(PowerZones::Keyboard);
|
||||||
data
|
data
|
||||||
@@ -91,7 +89,7 @@ impl LedSupportFile {
|
|||||||
|
|
||||||
/// The list is stored in ordered format, so the iterator must be reversed
|
/// The list is stored in ordered format, so the iterator must be reversed
|
||||||
/// to ensure we match to *whole names* first before doing a glob match
|
/// to ensure we match to *whole names* first before doing a glob match
|
||||||
fn match_device(&self, device_name: &str, product_id: &str) -> Option<LedSupportData> {
|
fn match_device(&self, device_name: &str, product_id: &str) -> LedSupportData {
|
||||||
for config in self.0.iter().rev() {
|
for config in self.0.iter().rev() {
|
||||||
if device_name.contains(&config.device_name) {
|
if device_name.contains(&config.device_name) {
|
||||||
info!("Matched to {}", config.device_name);
|
info!("Matched to {}", config.device_name);
|
||||||
@@ -99,20 +97,27 @@ impl LedSupportFile {
|
|||||||
info!("Checking product ID");
|
info!("Checking product ID");
|
||||||
if config.product_id == product_id {
|
if config.product_id == product_id {
|
||||||
info!("Matched to {}", config.product_id);
|
info!("Matched to {}", config.product_id);
|
||||||
return Some(config.clone());
|
return config.clone();
|
||||||
} else {
|
} else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Some(config.clone());
|
return config.clone();
|
||||||
} else {
|
|
||||||
warn!(
|
|
||||||
"the aura_support.ron file has no entry for this model: {device_name}, \
|
|
||||||
{product_id}"
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None
|
warn!(
|
||||||
|
"the aura_support.ron file has no entry for this model: {device_name}, {product_id}. \
|
||||||
|
Using a default"
|
||||||
|
);
|
||||||
|
LedSupportData {
|
||||||
|
device_name: device_name.to_owned(),
|
||||||
|
product_id: product_id.to_owned(),
|
||||||
|
layout_name: "Default".to_owned(),
|
||||||
|
basic_modes: vec![AuraModeNum::Static],
|
||||||
|
basic_zones: vec![],
|
||||||
|
advanced_type: AdvancedAuraType::None,
|
||||||
|
power_zones: vec![PowerZones::Keyboard],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Load `LedSupportFile` from the `aura_support.ron` file at
|
/// Load `LedSupportFile` from the `aura_support.ron` file at
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
use typeshare::typeshare;
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
use zbus::zvariant::{OwnedValue, Type, Value};
|
use zbus::zvariant::{OwnedValue, Type, Value};
|
||||||
@@ -261,8 +261,8 @@ pub enum AuraModeNum {
|
|||||||
#[default]
|
#[default]
|
||||||
Static = 0,
|
Static = 0,
|
||||||
Breathe = 1,
|
Breathe = 1,
|
||||||
Strobe = 2,
|
RainbowCycle = 2,
|
||||||
Rainbow = 3,
|
RainbowWave = 3,
|
||||||
Star = 4,
|
Star = 4,
|
||||||
Rain = 5,
|
Rain = 5,
|
||||||
Highlight = 6,
|
Highlight = 6,
|
||||||
@@ -290,8 +290,8 @@ impl From<&AuraModeNum> for &str {
|
|||||||
match mode {
|
match mode {
|
||||||
AuraModeNum::Static => "Static",
|
AuraModeNum::Static => "Static",
|
||||||
AuraModeNum::Breathe => "Breathe",
|
AuraModeNum::Breathe => "Breathe",
|
||||||
AuraModeNum::Strobe => "Strobe",
|
AuraModeNum::RainbowCycle => "RainbowCycle",
|
||||||
AuraModeNum::Rainbow => "Rainbow",
|
AuraModeNum::RainbowWave => "RainbowWave",
|
||||||
AuraModeNum::Star => "Stars",
|
AuraModeNum::Star => "Stars",
|
||||||
AuraModeNum::Rain => "Rain",
|
AuraModeNum::Rain => "Rain",
|
||||||
AuraModeNum::Highlight => "Highlight",
|
AuraModeNum::Highlight => "Highlight",
|
||||||
@@ -307,8 +307,8 @@ impl From<&str> for AuraModeNum {
|
|||||||
fn from(mode: &str) -> Self {
|
fn from(mode: &str) -> Self {
|
||||||
match mode {
|
match mode {
|
||||||
"Breathe" => AuraModeNum::Breathe,
|
"Breathe" => AuraModeNum::Breathe,
|
||||||
"Strobe" => AuraModeNum::Strobe,
|
"RainbowCycle" => AuraModeNum::RainbowCycle,
|
||||||
"Rainbow" => AuraModeNum::Rainbow,
|
"RainbowWave" => AuraModeNum::RainbowWave,
|
||||||
"Stars" => AuraModeNum::Star,
|
"Stars" => AuraModeNum::Star,
|
||||||
"Rain" => AuraModeNum::Rain,
|
"Rain" => AuraModeNum::Rain,
|
||||||
"Highlight" => AuraModeNum::Highlight,
|
"Highlight" => AuraModeNum::Highlight,
|
||||||
@@ -326,8 +326,8 @@ impl From<u8> for AuraModeNum {
|
|||||||
fn from(mode: u8) -> Self {
|
fn from(mode: u8) -> Self {
|
||||||
match mode {
|
match mode {
|
||||||
1 => AuraModeNum::Breathe,
|
1 => AuraModeNum::Breathe,
|
||||||
2 => AuraModeNum::Strobe,
|
2 => AuraModeNum::RainbowCycle,
|
||||||
3 => AuraModeNum::Rainbow,
|
3 => AuraModeNum::RainbowWave,
|
||||||
4 => AuraModeNum::Star,
|
4 => AuraModeNum::Star,
|
||||||
5 => AuraModeNum::Rain,
|
5 => AuraModeNum::Rain,
|
||||||
6 => AuraModeNum::Highlight,
|
6 => AuraModeNum::Highlight,
|
||||||
@@ -532,10 +532,10 @@ impl AuraEffect {
|
|||||||
| AuraModeNum::Comet
|
| AuraModeNum::Comet
|
||||||
| AuraModeNum::Flash => AuraParameters::new(true, true, false, false, false),
|
| AuraModeNum::Flash => AuraParameters::new(true, true, false, false, false),
|
||||||
AuraModeNum::Breathe => AuraParameters::new(true, true, true, true, false),
|
AuraModeNum::Breathe => AuraParameters::new(true, true, true, true, false),
|
||||||
AuraModeNum::Strobe | AuraModeNum::Rain => {
|
AuraModeNum::RainbowCycle | AuraModeNum::Rain => {
|
||||||
AuraParameters::new(true, false, false, true, false)
|
AuraParameters::new(true, false, false, true, false)
|
||||||
}
|
}
|
||||||
AuraModeNum::Rainbow => AuraParameters::new(true, false, false, true, true),
|
AuraModeNum::RainbowWave => AuraParameters::new(true, false, false, true, true),
|
||||||
AuraModeNum::Star => AuraParameters::new(true, true, true, true, true),
|
AuraModeNum::Star => AuraParameters::new(true, true, true, true, true),
|
||||||
AuraModeNum::Laser | AuraModeNum::Ripple => {
|
AuraModeNum::Laser | AuraModeNum::Ripple => {
|
||||||
AuraParameters::new(true, true, false, true, false)
|
AuraParameters::new(true, true, false, true, false)
|
||||||
@@ -710,7 +710,7 @@ mod tests {
|
|||||||
];
|
];
|
||||||
assert_eq!(<[u8; LED_MSG_LEN]>::from(&st)[..9], capture[..9]);
|
assert_eq!(<[u8; LED_MSG_LEN]>::from(&st)[..9], capture[..9]);
|
||||||
|
|
||||||
st.mode = AuraModeNum::Rainbow;
|
st.mode = AuraModeNum::RainbowWave;
|
||||||
let capture = [
|
let capture = [
|
||||||
0x5d, 0xb3, 0x07, 0x03, 0xff, 0x00, 0xcd, 0xe1, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
0x5d, 0xb3, 0x07, 0x03, 0xff, 0x00, 0xcd, 0xe1, 0x01, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||||
0x0, 0x0,
|
0x0, 0x0,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
mod doom;
|
mod doom;
|
||||||
pub use doom::*;
|
pub use doom::*;
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ env_logger.workspace = true
|
|||||||
|
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_derive.workspace = true
|
|
||||||
zbus.workspace = true
|
zbus.workspace = true
|
||||||
dirs.workspace = true
|
dirs.workspace = true
|
||||||
notify-rust.workspace = true
|
notify-rust.workspace = true
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::fs::create_dir;
|
use std::fs::create_dir;
|
||||||
|
|
||||||
use config_traits::{StdConfig, StdConfigLoad1};
|
use config_traits::{StdConfig, StdConfigLoad1};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::notify::EnabledNotifications;
|
use crate::notify::EnabledNotifications;
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ use std::process::Command;
|
|||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use log::{error, info, warn};
|
use log::{debug, error, info, warn};
|
||||||
use notify_rust::{Hint, Notification, NotificationHandle, Urgency};
|
use notify_rust::{Hint, Notification, Timeout, Urgency};
|
||||||
use rog_dbus::zbus_platform::PlatformProxy;
|
use rog_dbus::zbus_platform::PlatformProxy;
|
||||||
use rog_platform::platform::GpuMode;
|
use rog_platform::platform::GpuMode;
|
||||||
use rog_platform::power::AsusPower;
|
use rog_platform::power::AsusPower;
|
||||||
@@ -51,12 +51,16 @@ fn start_dpu_status_mon(config: Arc<Mutex<Config>>) {
|
|||||||
let mut found_dgpu = false; // just for logging
|
let mut found_dgpu = false; // just for logging
|
||||||
for dev in dev {
|
for dev in dev {
|
||||||
if dev.is_dgpu() {
|
if dev.is_dgpu() {
|
||||||
|
info!(
|
||||||
|
"Found dGPU: {}, starting status notifications",
|
||||||
|
dev.pci_id()
|
||||||
|
);
|
||||||
let enabled_notifications_copy = config.clone();
|
let enabled_notifications_copy = config.clone();
|
||||||
// Plain old thread is perfectly fine since most of this is potentially blocking
|
// Plain old thread is perfectly fine since most of this is potentially blocking
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
let mut last_status = GfxPower::Unknown;
|
let mut last_status = GfxPower::Unknown;
|
||||||
loop {
|
loop {
|
||||||
std::thread::sleep(Duration::from_millis(1000));
|
std::thread::sleep(Duration::from_millis(1500));
|
||||||
if let Ok(status) = dev.get_runtime_status() {
|
if let Ok(status) = dev.get_runtime_status() {
|
||||||
if status != GfxPower::Unknown && status != last_status {
|
if status != GfxPower::Unknown && status != last_status {
|
||||||
if let Ok(config) = enabled_notifications_copy.lock() {
|
if let Ok(config) = enabled_notifications_copy.lock() {
|
||||||
@@ -68,7 +72,11 @@ fn start_dpu_status_mon(config: Arc<Mutex<Config>>) {
|
|||||||
}
|
}
|
||||||
// Required check because status cycles through
|
// Required check because status cycles through
|
||||||
// active/unknown/suspended
|
// active/unknown/suspended
|
||||||
do_gpu_status_notif("dGPU status changed:", &status).ok();
|
do_gpu_status_notif("dGPU status changed:", &status)
|
||||||
|
.show()
|
||||||
|
.unwrap()
|
||||||
|
.on_close(|_| ());
|
||||||
|
debug!("dGPU status changed: {:?}", &status);
|
||||||
}
|
}
|
||||||
last_status = status;
|
last_status = status;
|
||||||
}
|
}
|
||||||
@@ -138,6 +146,13 @@ pub fn start_notifications(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let enabled_notifications_copy = config.clone();
|
||||||
|
let no_supergfx = move |e: &zbus::Error| {
|
||||||
|
error!("zbus signal: receive_notify_gfx_status: {e}");
|
||||||
|
warn!("Attempting to start plain dgpu status monitor");
|
||||||
|
start_dpu_status_mon(enabled_notifications_copy.clone());
|
||||||
|
};
|
||||||
|
|
||||||
// GPU MUX Mode notif
|
// GPU MUX Mode notif
|
||||||
let enabled_notifications_copy = config.clone();
|
let enabled_notifications_copy = config.clone();
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
@@ -176,68 +191,69 @@ pub fn start_notifications(
|
|||||||
let enabled_notifications_copy = config.clone();
|
let enabled_notifications_copy = config.clone();
|
||||||
// GPU Mode change/action notif
|
// GPU Mode change/action notif
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
if let Err(e) = {
|
let conn = zbus::Connection::system().await.map_err(|e| {
|
||||||
let conn = zbus::Connection::system().await?;
|
no_supergfx(&e);
|
||||||
let proxy = SuperProxy::builder(&conn).build().await?;
|
e
|
||||||
let _ = proxy.mode().await?;
|
})?;
|
||||||
|
let proxy = SuperProxy::builder(&conn).build().await.map_err(|e| {
|
||||||
|
no_supergfx(&e);
|
||||||
|
e
|
||||||
|
})?;
|
||||||
|
let _ = proxy.mode().await.map_err(|e| {
|
||||||
|
no_supergfx(&e);
|
||||||
|
e
|
||||||
|
})?;
|
||||||
|
|
||||||
let proxy_copy = proxy.clone();
|
let proxy_copy = proxy.clone();
|
||||||
if let Ok(mut p) = proxy.receive_notify_action().await {
|
let mut p = proxy.receive_notify_action().await?;
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
info!("Started zbus signal thread: receive_notify_action");
|
info!("Started zbus signal thread: receive_notify_action");
|
||||||
while let Some(e) = p.next().await {
|
while let Some(e) = p.next().await {
|
||||||
if let Ok(out) = e.args() {
|
if let Ok(out) = e.args() {
|
||||||
let action = out.action();
|
let action = out.action();
|
||||||
let mode = convert_gfx_mode(proxy.mode().await.unwrap_or_default());
|
let mode = convert_gfx_mode(proxy.mode().await.unwrap_or_default());
|
||||||
match action {
|
match action {
|
||||||
supergfxctl::actions::UserActionRequired::Reboot => {
|
supergfxctl::actions::UserActionRequired::Reboot => {
|
||||||
do_mux_notification(
|
do_mux_notification("Graphics mode change requires reboot", &mode)
|
||||||
"Graphics mode change requires reboot",
|
|
||||||
&mode,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
_ => do_gfx_action_notif(<&str>::from(action), *action, mode),
|
|
||||||
}
|
|
||||||
.map_err(|e| {
|
|
||||||
error!("zbus signal: do_gfx_action_notif: {e}");
|
|
||||||
e
|
|
||||||
})
|
|
||||||
.ok();
|
|
||||||
}
|
}
|
||||||
|
_ => do_gfx_action_notif(<&str>::from(action), *action, mode),
|
||||||
}
|
}
|
||||||
});
|
.map_err(|e| {
|
||||||
};
|
error!("zbus signal: do_gfx_action_notif: {e}");
|
||||||
|
e
|
||||||
|
})
|
||||||
|
.ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if let Ok(mut p) = proxy_copy.receive_notify_gfx_status().await {
|
let mut p = proxy_copy.receive_notify_gfx_status().await?;
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
info!("Started zbus signal thread: receive_notify_gfx_status");
|
info!("Started zbus signal thread: receive_notify_gfx_status");
|
||||||
let mut last_status = GfxPower::Unknown;
|
let mut last_status = GfxPower::Unknown;
|
||||||
while let Some(e) = p.next().await {
|
while let Some(e) = p.next().await {
|
||||||
if let Ok(out) = e.args() {
|
if let Ok(out) = e.args() {
|
||||||
let status = out.status;
|
let status = out.status;
|
||||||
if status != GfxPower::Unknown && status != last_status {
|
if status != GfxPower::Unknown && status != last_status {
|
||||||
if let Ok(config) = enabled_notifications_copy.lock() {
|
if let Ok(config) = enabled_notifications_copy.lock() {
|
||||||
if !config.notifications.receive_notify_gfx_status
|
if !config.notifications.receive_notify_gfx_status
|
||||||
|| !config.notifications.enabled
|
|| !config.notifications.enabled
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
}
|
|
||||||
// Required check because status cycles through
|
|
||||||
// active/unknown/suspended
|
|
||||||
do_gpu_status_notif("dGPU status changed:", &status).ok();
|
|
||||||
}
|
}
|
||||||
last_status = status;
|
|
||||||
}
|
}
|
||||||
|
// Required check because status cycles through
|
||||||
|
// active/unknown/suspended
|
||||||
|
do_gpu_status_notif("dGPU status changed:", &status)
|
||||||
|
.show_async()
|
||||||
|
.await
|
||||||
|
.unwrap()
|
||||||
|
.on_close(|_| ());
|
||||||
}
|
}
|
||||||
});
|
last_status = status;
|
||||||
};
|
}
|
||||||
Ok::<(), zbus::Error>(())
|
}
|
||||||
} {
|
});
|
||||||
error!("zbus signal: receive_notify_gfx_status: {e}");
|
|
||||||
info!("Attempting to start plain dgpu status monitor");
|
|
||||||
start_dpu_status_mon(config.clone());
|
|
||||||
}
|
|
||||||
Ok::<(), zbus::Error>(())
|
Ok::<(), zbus::Error>(())
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -261,19 +277,15 @@ where
|
|||||||
T: Display,
|
T: Display,
|
||||||
{
|
{
|
||||||
let mut notif = Notification::new();
|
let mut notif = Notification::new();
|
||||||
|
|
||||||
notif
|
notif
|
||||||
.summary(NOTIF_HEADER)
|
.appname(NOTIF_HEADER)
|
||||||
.body(&format!("{message} {data}"))
|
.summary(&format!("{message} {data}"))
|
||||||
.timeout(-1)
|
.timeout(Timeout::Milliseconds(3000))
|
||||||
//.hint(Hint::Resident(true))
|
|
||||||
.hint(Hint::Category("device".into()));
|
.hint(Hint::Category("device".into()));
|
||||||
|
|
||||||
notif
|
notif
|
||||||
}
|
}
|
||||||
|
|
||||||
fn do_gpu_status_notif(message: &str, data: &GfxPower) -> Result<NotificationHandle> {
|
fn do_gpu_status_notif(message: &str, data: &GfxPower) -> Notification {
|
||||||
// eww
|
|
||||||
let mut notif = base_notification(message, &<&str>::from(data).to_owned());
|
let mut notif = base_notification(message, &<&str>::from(data).to_owned());
|
||||||
let icon = match data {
|
let icon = match data {
|
||||||
GfxPower::Suspended => "asus_notif_blue",
|
GfxPower::Suspended => "asus_notif_blue",
|
||||||
@@ -283,7 +295,7 @@ fn do_gpu_status_notif(message: &str, data: &GfxPower) -> Result<NotificationHan
|
|||||||
GfxPower::Unknown => "gpu-integrated",
|
GfxPower::Unknown => "gpu-integrated",
|
||||||
};
|
};
|
||||||
notif.icon(icon);
|
notif.icon(icon);
|
||||||
Ok(Notification::show(¬if)?)
|
notif
|
||||||
}
|
}
|
||||||
|
|
||||||
fn do_gfx_action_notif(message: &str, action: GfxUserAction, mode: GpuMode) -> Result<()> {
|
fn do_gfx_action_notif(message: &str, action: GfxUserAction, mode: GpuMode) -> Result<()> {
|
||||||
@@ -294,13 +306,12 @@ fn do_gfx_action_notif(message: &str, action: GfxUserAction, mode: GpuMode) -> R
|
|||||||
|
|
||||||
let mut notif = Notification::new();
|
let mut notif = Notification::new();
|
||||||
notif
|
notif
|
||||||
.summary(NOTIF_HEADER)
|
.appname(NOTIF_HEADER)
|
||||||
.body(&format!("Changing to {mode}. {message}"))
|
.summary(&format!("Changing to {mode}. {message}"))
|
||||||
.timeout(2000)
|
|
||||||
//.hint(Hint::Resident(true))
|
//.hint(Hint::Resident(true))
|
||||||
.hint(Hint::Category("device".into()))
|
.hint(Hint::Category("device".into()))
|
||||||
.urgency(Urgency::Critical)
|
.urgency(Urgency::Critical)
|
||||||
.timeout(-1)
|
.timeout(Timeout::Never)
|
||||||
.icon("dialog-warning")
|
.icon("dialog-warning")
|
||||||
.hint(Hint::Transient(true));
|
.hint(Hint::Transient(true));
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ use std::time::Duration;
|
|||||||
use betrayer::{Icon, Menu, MenuItem, TrayEvent, TrayIcon, TrayIconBuilder};
|
use betrayer::{Icon, Menu, MenuItem, TrayEvent, TrayIcon, TrayIconBuilder};
|
||||||
use log::{debug, error, info, warn};
|
use log::{debug, error, info, warn};
|
||||||
use rog_platform::platform::Properties;
|
use rog_platform::platform::Properties;
|
||||||
use supergfxctl::pci_device::{GfxMode, GfxPower};
|
use supergfxctl::pci_device::{Device, GfxMode, GfxPower};
|
||||||
use supergfxctl::zbus_proxy::DaemonProxyBlocking as GfxProxy;
|
use supergfxctl::zbus_proxy::DaemonProxyBlocking as GfxProxy;
|
||||||
use versions::Versioning;
|
use versions::Versioning;
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ fn build_menu() -> Menu<TrayAction> {
|
|||||||
Menu::new([
|
Menu::new([
|
||||||
MenuItem::separator(),
|
MenuItem::separator(),
|
||||||
MenuItem::button("Open", TrayAction::Open),
|
MenuItem::button("Open", TrayAction::Open),
|
||||||
MenuItem::button("Quit", TrayAction::Quit),
|
MenuItem::button("Quit App", TrayAction::Quit),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -126,6 +126,20 @@ fn set_tray_icon_and_tip(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn find_dgpu() -> Option<Device> {
|
||||||
|
use supergfxctl::pci_device::Device;
|
||||||
|
let dev = Device::find().unwrap_or_default();
|
||||||
|
for dev in dev {
|
||||||
|
if dev.is_dgpu() {
|
||||||
|
info!("Found dGPU: {}", dev.pci_id());
|
||||||
|
// Plain old thread is perfectly fine since most of this is potentially blocking
|
||||||
|
return Some(dev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
warn!("Did not find a dGPU on this system, dGPU status won't be avilable");
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
/// The tray is controlled somewhat by `Arc<Mutex<SystemState>>`
|
/// The tray is controlled somewhat by `Arc<Mutex<SystemState>>`
|
||||||
pub fn init_tray(_supported_properties: Vec<Properties>, config: Arc<Mutex<Config>>) {
|
pub fn init_tray(_supported_properties: Vec<Properties>, config: Arc<Mutex<Config>>) {
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
@@ -155,27 +169,30 @@ pub fn init_tray(_supported_properties: Vec<Properties>, config: Arc<Mutex<Confi
|
|||||||
gpu_integrated,
|
gpu_integrated,
|
||||||
});
|
});
|
||||||
|
|
||||||
let mut has_supergfx = true;
|
let mut has_supergfx = false;
|
||||||
let conn = zbus::blocking::Connection::system().unwrap();
|
let conn = zbus::blocking::Connection::system().unwrap();
|
||||||
if let Ok(gfx_proxy) = GfxProxy::new(&conn) {
|
if let Ok(gfx_proxy) = GfxProxy::new(&conn) {
|
||||||
let mut supergfx_active = false;
|
match gfx_proxy.mode() {
|
||||||
if gfx_proxy.mode().is_ok() {
|
Ok(_) => {
|
||||||
supergfx_active = true;
|
has_supergfx = true;
|
||||||
if let Ok(version) = gfx_proxy.version() {
|
if let Ok(version) = gfx_proxy.version() {
|
||||||
if let Some(version) = Versioning::new(&version) {
|
if let Some(version) = Versioning::new(&version) {
|
||||||
let curr_gfx = Versioning::new("5.2.0").unwrap();
|
let curr_gfx = Versioning::new("5.2.0").unwrap();
|
||||||
warn!("supergfxd version = {version}");
|
warn!("supergfxd version = {version}");
|
||||||
if version < curr_gfx {
|
if version < curr_gfx {
|
||||||
// Don't allow mode changing if too old a version
|
// Don't allow mode changing if too old a version
|
||||||
warn!("supergfxd found but is too old to use");
|
warn!("supergfxd found but is too old to use");
|
||||||
has_supergfx = false;
|
has_supergfx = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
Err(e) => warn!("Couldn't get mode form supergfxd: {e:?}"),
|
||||||
|
}
|
||||||
|
|
||||||
info!("Started ROGTray");
|
info!("Started ROGTray");
|
||||||
let mut last_power = GfxPower::Unknown;
|
let mut last_power = GfxPower::Unknown;
|
||||||
|
let dev = find_dgpu();
|
||||||
loop {
|
loop {
|
||||||
sleep(Duration::from_millis(1000));
|
sleep(Duration::from_millis(1000));
|
||||||
if let Ok(lock) = config.try_lock() {
|
if let Ok(lock) = config.try_lock() {
|
||||||
@@ -187,11 +204,23 @@ pub fn init_tray(_supported_properties: Vec<Properties>, config: Arc<Mutex<Confi
|
|||||||
if let Ok(mode) = gfx_proxy.mode() {
|
if let Ok(mode) = gfx_proxy.mode() {
|
||||||
if let Ok(power) = gfx_proxy.power() {
|
if let Ok(power) = gfx_proxy.power() {
|
||||||
if last_power != power {
|
if last_power != power {
|
||||||
set_tray_icon_and_tip(mode, power, &mut tray, supergfx_active);
|
set_tray_icon_and_tip(mode, power, &mut tray, has_supergfx);
|
||||||
last_power = power;
|
last_power = power;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if let Some(dev) = dev.as_ref() {
|
||||||
|
if let Ok(power) = dev.get_runtime_status() {
|
||||||
|
if last_power != power {
|
||||||
|
set_tray_icon_and_tip(
|
||||||
|
GfxMode::Hybrid,
|
||||||
|
power,
|
||||||
|
&mut tray,
|
||||||
|
has_supergfx,
|
||||||
|
);
|
||||||
|
last_power = power;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"POT-Creation-Date: 2024-05-17 23:21+0000\n"
|
"POT-Creation-Date: 2024-06-09 00:20+0000\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
@@ -334,37 +334,37 @@ msgstr ""
|
|||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:188
|
#: rog-control-center/ui/pages/system.slint:188
|
||||||
msgctxt "ppt_pl1_spl"
|
msgctxt "ppt_pl1_spl"
|
||||||
msgid "ppt_pl1_spl"
|
msgid "PL1, sustained power limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:198
|
#: rog-control-center/ui/pages/system.slint:198
|
||||||
msgctxt "ppt_pl2_sppt"
|
msgctxt "ppt_pl2_sppt"
|
||||||
msgid "ppt_pl2_sppt"
|
msgid "PL2, turbo power limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:208
|
#: rog-control-center/ui/pages/system.slint:208
|
||||||
msgctxt "ppt_fppt"
|
msgctxt "ppt_fppt"
|
||||||
msgid "ppt_fppt"
|
msgid "FPPT, Fast Power Limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:218
|
#: rog-control-center/ui/pages/system.slint:218
|
||||||
msgctxt "ppt_apu_sppt"
|
msgctxt "ppt_apu_sppt"
|
||||||
msgid "ppt_apu_sppt"
|
msgid "SPPT, APU slow power limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:228
|
#: rog-control-center/ui/pages/system.slint:228
|
||||||
msgctxt "ppt_platform_sppt"
|
msgctxt "ppt_platform_sppt"
|
||||||
msgid "ppt_platform_sppt"
|
msgid "Slow package power tracking limit"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:238
|
#: rog-control-center/ui/pages/system.slint:238
|
||||||
msgctxt "nv_dynamic_boost"
|
msgctxt "nv_dynamic_boost"
|
||||||
msgid "nv_dynamic_boost"
|
msgid "dGPU boost overclock"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:248
|
#: rog-control-center/ui/pages/system.slint:248
|
||||||
msgctxt "nv_temp_target"
|
msgctxt "nv_temp_target"
|
||||||
msgid "nv_temp_target"
|
msgid "dGPU temperature max"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/pages/system.slint:294
|
#: rog-control-center/ui/pages/system.slint:294
|
||||||
@@ -412,46 +412,6 @@ msgctxt "PageSystem"
|
|||||||
msgid "Throttle Policy on AC"
|
msgid "Throttle Policy on AC"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/widgets/aura_power.slint:33
|
|
||||||
msgctxt "AuraPowerGroup"
|
|
||||||
msgid "Boot"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rog-control-center/ui/widgets/aura_power.slint:43
|
|
||||||
msgctxt "AuraPowerGroup"
|
|
||||||
msgid "Awake"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rog-control-center/ui/widgets/aura_power.slint:53
|
|
||||||
msgctxt "AuraPowerGroup"
|
|
||||||
msgid "Sleep"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rog-control-center/ui/widgets/aura_power.slint:63
|
|
||||||
msgctxt "AuraPowerGroup"
|
|
||||||
msgid "Shutdown"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rog-control-center/ui/widgets/aura_power.slint:102
|
|
||||||
msgctxt "AuraPowerGroupOld"
|
|
||||||
msgid "Zone Selection"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rog-control-center/ui/widgets/aura_power.slint:114
|
|
||||||
msgctxt "AuraPowerGroupOld"
|
|
||||||
msgid "Boot"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rog-control-center/ui/widgets/aura_power.slint:124
|
|
||||||
msgctxt "AuraPowerGroupOld"
|
|
||||||
msgid "Awake"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rog-control-center/ui/widgets/aura_power.slint:134
|
|
||||||
msgctxt "AuraPowerGroupOld"
|
|
||||||
msgid "Sleep"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: rog-control-center/ui/types/aura_types.slint:49
|
#: rog-control-center/ui/types/aura_types.slint:49
|
||||||
msgctxt "Aura power zone"
|
msgctxt "Aura power zone"
|
||||||
msgid "Logo"
|
msgid "Logo"
|
||||||
@@ -642,6 +602,46 @@ msgctxt "Aura speed"
|
|||||||
msgid "High"
|
msgid "High"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: rog-control-center/ui/widgets/aura_power.slint:33
|
||||||
|
msgctxt "AuraPowerGroup"
|
||||||
|
msgid "Boot"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: rog-control-center/ui/widgets/aura_power.slint:43
|
||||||
|
msgctxt "AuraPowerGroup"
|
||||||
|
msgid "Awake"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: rog-control-center/ui/widgets/aura_power.slint:53
|
||||||
|
msgctxt "AuraPowerGroup"
|
||||||
|
msgid "Sleep"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: rog-control-center/ui/widgets/aura_power.slint:63
|
||||||
|
msgctxt "AuraPowerGroup"
|
||||||
|
msgid "Shutdown"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: rog-control-center/ui/widgets/aura_power.slint:102
|
||||||
|
msgctxt "AuraPowerGroupOld"
|
||||||
|
msgid "Zone Selection"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: rog-control-center/ui/widgets/aura_power.slint:114
|
||||||
|
msgctxt "AuraPowerGroupOld"
|
||||||
|
msgid "Boot"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: rog-control-center/ui/widgets/aura_power.slint:124
|
||||||
|
msgctxt "AuraPowerGroupOld"
|
||||||
|
msgid "Awake"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: rog-control-center/ui/widgets/aura_power.slint:134
|
||||||
|
msgctxt "AuraPowerGroupOld"
|
||||||
|
msgid "Sleep"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: rog-control-center/ui/main_window.slint:51
|
#: rog-control-center/ui/main_window.slint:51
|
||||||
msgctxt "MainWindow"
|
msgctxt "MainWindow"
|
||||||
msgid "ROG"
|
msgid "ROG"
|
||||||
@@ -679,6 +679,6 @@ msgstr ""
|
|||||||
|
|
||||||
#: rog-control-center/ui/main_window.slint:70
|
#: rog-control-center/ui/main_window.slint:70
|
||||||
msgctxt "MainWindow"
|
msgctxt "MainWindow"
|
||||||
msgid "Quit"
|
msgid "Quit App"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export component MainWindow inherits Window {
|
|||||||
Text {
|
Text {
|
||||||
vertical-alignment: center;
|
vertical-alignment: center;
|
||||||
horizontal-alignment: center;
|
horizontal-alignment: center;
|
||||||
text: @tr("Quit");
|
text: @tr("Quit App");
|
||||||
}
|
}
|
||||||
|
|
||||||
TouchArea {
|
TouchArea {
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ export component PageSystem inherits Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.available.ppt-pl1-spl: SystemSlider {
|
if SystemPageData.available.ppt-pl1-spl: SystemSlider {
|
||||||
text: @tr("ppt_pl1_spl" => "ppt_pl1_spl");
|
text: @tr("ppt_pl1_spl" => "PL1, sustained power limit");
|
||||||
minimum: 5;
|
minimum: 5;
|
||||||
maximum: 250;
|
maximum: 250;
|
||||||
value <=> SystemPageData.ppt_pl1_spl;
|
value <=> SystemPageData.ppt_pl1_spl;
|
||||||
@@ -195,7 +195,7 @@ export component PageSystem inherits Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.available.ppt-pl2-sppt: SystemSlider {
|
if SystemPageData.available.ppt-pl2-sppt: SystemSlider {
|
||||||
text: @tr("ppt_pl2_sppt" => "ppt_pl2_sppt");
|
text: @tr("ppt_pl2_sppt" => "PL2, turbo power limit");
|
||||||
minimum: 5;
|
minimum: 5;
|
||||||
maximum: 250;
|
maximum: 250;
|
||||||
value <=> SystemPageData.ppt_pl2_sppt;
|
value <=> SystemPageData.ppt_pl2_sppt;
|
||||||
@@ -205,7 +205,7 @@ export component PageSystem inherits Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.available.ppt-fppt: SystemSlider {
|
if SystemPageData.available.ppt-fppt: SystemSlider {
|
||||||
text: @tr("ppt_fppt" => "ppt_fppt");
|
text: @tr("ppt_fppt" => "FPPT, Fast Power Limit");
|
||||||
minimum: 5;
|
minimum: 5;
|
||||||
maximum: 250;
|
maximum: 250;
|
||||||
value <=> SystemPageData.ppt_fppt;
|
value <=> SystemPageData.ppt_fppt;
|
||||||
@@ -215,7 +215,7 @@ export component PageSystem inherits Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.available.ppt-apu-sppt: SystemSlider {
|
if SystemPageData.available.ppt-apu-sppt: SystemSlider {
|
||||||
text: @tr("ppt_apu_sppt" => "ppt_apu_sppt");
|
text: @tr("ppt_apu_sppt" => "SPPT, APU slow power limit");
|
||||||
minimum: 5;
|
minimum: 5;
|
||||||
maximum: 130;
|
maximum: 130;
|
||||||
value <=> SystemPageData.ppt_apu_sppt;
|
value <=> SystemPageData.ppt_apu_sppt;
|
||||||
@@ -225,7 +225,7 @@ export component PageSystem inherits Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.available.ppt-platform-sppt: SystemSlider {
|
if SystemPageData.available.ppt-platform-sppt: SystemSlider {
|
||||||
text: @tr("ppt_platform_sppt" => "ppt_platform_sppt");
|
text: @tr("ppt_platform_sppt" => "Slow package power tracking limit");
|
||||||
maximum: 130;
|
maximum: 130;
|
||||||
minimum: 5;
|
minimum: 5;
|
||||||
value <=> SystemPageData.ppt_platform_sppt;
|
value <=> SystemPageData.ppt_platform_sppt;
|
||||||
@@ -235,7 +235,7 @@ export component PageSystem inherits Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.available.nv-dynamic-boost: SystemSlider {
|
if SystemPageData.available.nv-dynamic-boost: SystemSlider {
|
||||||
text: @tr("nv_dynamic_boost" => "nv_dynamic_boost");
|
text: @tr("nv_dynamic_boost" => "dGPU boost overclock");
|
||||||
minimum: 5;
|
minimum: 5;
|
||||||
maximum: 25;
|
maximum: 25;
|
||||||
value <=> SystemPageData.nv_dynamic_boost;
|
value <=> SystemPageData.nv_dynamic_boost;
|
||||||
@@ -245,7 +245,7 @@ export component PageSystem inherits Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if SystemPageData.available.nv-temp-target: SystemSlider {
|
if SystemPageData.available.nv-temp-target: SystemSlider {
|
||||||
text: @tr("nv_temp_target" => "nv_temp_target");
|
text: @tr("nv_temp_target" => "dGPU temperature max");
|
||||||
minimum: 75;
|
minimum: 75;
|
||||||
maximum: 87;
|
maximum: 87;
|
||||||
value <=> SystemPageData.nv_temp_target;
|
value <=> SystemPageData.nv_temp_target;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export component SystemSlider inherits RogItem {
|
|||||||
callback released(int);
|
callback released(int);
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
width: 30%;
|
width: 50%;
|
||||||
alignment: LayoutAlignment.space-between;
|
alignment: LayoutAlignment.space-between;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
Text {
|
Text {
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ dbus = ["zbus"]
|
|||||||
log.workspace = true
|
log.workspace = true
|
||||||
udev.workspace = true
|
udev.workspace = true
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_derive.workspace = true
|
|
||||||
typeshare.workspace = true
|
typeshare.workspace = true
|
||||||
rog_platform = { path = "../rog-platform" }
|
rog_platform = { path = "../rog-platform" }
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use log::trace;
|
use log::{error, trace};
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
use typeshare::typeshare;
|
||||||
use udev::Device;
|
use udev::Device;
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
@@ -185,7 +185,8 @@ impl CurveData {
|
|||||||
// Enable must be done *after* all points are written pwm3_enable
|
// Enable must be done *after* all points are written pwm3_enable
|
||||||
device
|
device
|
||||||
.set_attribute_value(format!("pwm{pwm_num}_enable"), enable.to_string())
|
.set_attribute_value(format!("pwm{pwm_num}_enable"), enable.to_string())
|
||||||
.unwrap();
|
.map_err(|e| error!("Failed to set pwm{pwm_num}_enable to {enable}: {e:?}"))
|
||||||
|
.ok();
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use error::ProfileError;
|
|||||||
use fan_curve_set::CurveData;
|
use fan_curve_set::CurveData;
|
||||||
use log::debug;
|
use log::debug;
|
||||||
use rog_platform::platform::ThrottlePolicy;
|
use rog_platform::platform::ThrottlePolicy;
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
use typeshare::typeshare;
|
||||||
pub use udev::Device;
|
pub use udev::Device;
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ path = "src/lib.rs"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
serde_derive.workspace = true
|
|
||||||
typeshare.workspace = true
|
typeshare.workspace = true
|
||||||
zbus = { workspace = true, optional = true }
|
zbus = { workspace = true, optional = true }
|
||||||
dmi_id = { path = "../dmi-id", optional = true }
|
dmi_id = { path = "../dmi-id", optional = true }
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use serde_derive::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use typeshare::typeshare;
|
use typeshare::typeshare;
|
||||||
#[cfg(feature = "dbus")]
|
#[cfg(feature = "dbus")]
|
||||||
use zbus::zvariant::Type;
|
use zbus::zvariant::Type;
|
||||||
@@ -12,7 +12,7 @@ use crate::error::SlashError;
|
|||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
pub enum SlashType {
|
pub enum SlashType {
|
||||||
GA403,
|
GA403,
|
||||||
Unknown,
|
GA605,
|
||||||
Unsupported,
|
Unsupported,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,7 +22,8 @@ impl FromStr for SlashType {
|
|||||||
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
|
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
|
||||||
Ok(match s {
|
Ok(match s {
|
||||||
"ga403" | "GA403" => Self::GA403,
|
"ga403" | "GA403" => Self::GA403,
|
||||||
_ => Self::Unknown,
|
"ga605" | "GA605" => Self::GA605,
|
||||||
|
_ => Self::Unsupported,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,12 +28,14 @@ pub type SlashUsbPacket = [u8; PACKET_SIZE];
|
|||||||
///
|
///
|
||||||
/// The currently known USB device is `193B`.
|
/// The currently known USB device is `193B`.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_slash_type() -> Result<SlashType, SlashError> {
|
pub fn get_maybe_slash_type() -> Result<SlashType, SlashError> {
|
||||||
let dmi = DMIID::new().map_err(|_| SlashError::NoDevice)?; // TODO: better error
|
let dmi = DMIID::new().map_err(|_| SlashError::NoDevice)?; // TODO: better error
|
||||||
let board_name = dmi.board_name;
|
let board_name = dmi.board_name;
|
||||||
|
|
||||||
if board_name.contains("GA403") {
|
if board_name.contains("GA403") {
|
||||||
return Ok(SlashType::GA403);
|
return Ok(SlashType::GA403);
|
||||||
|
} else if board_name.contains("GA605") {
|
||||||
|
return Ok(SlashType::GA605);
|
||||||
}
|
}
|
||||||
Ok(SlashType::Unsupported)
|
Ok(SlashType::Unsupported)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ impl AniMatrix {
|
|||||||
vertical: 2,
|
vertical: 2,
|
||||||
horizontal: 5,
|
horizontal: 5,
|
||||||
},
|
},
|
||||||
AnimeType::GA402 | AnimeType::Unknown => LedShape {
|
AnimeType::GA402 | AnimeType::Unsupported => LedShape {
|
||||||
vertical: 2,
|
vertical: 2,
|
||||||
horizontal: 5,
|
horizontal: 5,
|
||||||
},
|
},
|
||||||
@@ -56,7 +56,7 @@ impl AniMatrix {
|
|||||||
// Do a hard mapping of each (derived from wireshardk captures)
|
// Do a hard mapping of each (derived from wireshardk captures)
|
||||||
let rows = match model {
|
let rows = match model {
|
||||||
AnimeType::GA401 => GA401.to_vec(),
|
AnimeType::GA401 => GA401.to_vec(),
|
||||||
AnimeType::GA402 | AnimeType::Unknown => GA402.to_vec(),
|
AnimeType::GA402 | AnimeType::Unsupported => GA402.to_vec(),
|
||||||
AnimeType::GU604 => GU604.to_vec(),
|
AnimeType::GU604 => GU604.to_vec(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user