Try better to capture TUF keyboard control

This commit is contained in:
Luke D. Jones
2024-12-25 10:31:43 +13:00
parent 1cad5afc0d
commit e2d3f99d91
2 changed files with 23 additions and 13 deletions

View File

@@ -291,6 +291,7 @@ impl DeviceManager {
// USB after, need to check if HID picked something up and if so, skip it // USB after, need to check if HID picked something up and if so, skip it
let mut do_anime = true; let mut do_anime = true;
let mut do_slash = true; let mut do_slash = true;
let mut do_kb_backlight = true;
for dev in devices.iter() { for dev in devices.iter() {
if matches!(dev.device, DeviceHandle::Slash(_)) { if matches!(dev.device, DeviceHandle::Slash(_)) {
do_slash = false; do_slash = false;
@@ -298,6 +299,9 @@ impl DeviceManager {
if matches!(dev.device, DeviceHandle::AniMe(_)) { if matches!(dev.device, DeviceHandle::AniMe(_)) {
do_anime = false; do_anime = false;
} }
if matches!(dev.device, DeviceHandle::Aura(_) | DeviceHandle::OldAura(_)) {
do_kb_backlight = false;
}
} }
if do_slash { if do_slash {
@@ -333,19 +337,25 @@ impl DeviceManager {
} }
} }
let board_name = DMIID::new().unwrap_or_default().board_name; if do_kb_backlight {
if board_name.contains("TUF") {
// TUF AURA LAPTOP DEVICE // TUF AURA LAPTOP DEVICE
info!("Seems to be a TUF laptop, try using sysfs backlight control"); let product_name = DMIID::new().unwrap_or_default().product_name;
if let Ok(dev_type) = DeviceHandle::maybe_laptop_aura(None, "tuf").await { let product_family = DMIID::new().unwrap_or_default().product_family;
if let DeviceHandle::Aura(aura) = dev_type.clone() { info!(
let path = dbus_path_for_tuf(); "No USB keyboard aura, system is {product_name}, try using sysfs backlight control"
let ctrl = AuraZbus::new(aura); );
ctrl.start_tasks(connection, path.clone()).await.unwrap(); if product_name.contains("TUF") || product_family.contains("TUF") {
devices.push(AsusDevice { info!("TUF laptop, try using sysfs backlight control");
device: dev_type, if let Ok(dev_type) = DeviceHandle::maybe_laptop_aura(None, "tuf").await {
dbus_path: path, if let DeviceHandle::Aura(aura) = dev_type.clone() {
}); let path = dbus_path_for_tuf();
let ctrl = AuraZbus::new(aura);
ctrl.start_tasks(connection, path.clone()).await.unwrap();
devices.push(AsusDevice {
device: dev_type,
dbus_path: path,
});
}
} }
} }
} }

View File

@@ -2,7 +2,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2024-12-24 08:49+0000\n" "POT-Creation-Date: 2024-12-24 08:50+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"