rcc: run as app only on Ally

This commit is contained in:
Luke D. Jones
2024-04-04 09:58:40 +13:00
parent 00babaf949
commit a271ffbb10
3 changed files with 157 additions and 143 deletions

View File

@@ -353,6 +353,7 @@ mod tests {
use crate::ctrl_aura::controller::LEDNode; use crate::ctrl_aura::controller::LEDNode;
#[test] #[test]
#[ignore = "Unable to run in CI as the HIDRAW device is required"]
fn create_multizone_if_no_config() { fn create_multizone_if_no_config() {
// Checking to ensure set_mode errors when unsupported modes are tried // Checking to ensure set_mode errors when unsupported modes are tried
let config = AuraConfig::from_default_support(AuraDevice::X19b6, &LaptopLedData::default()); let config = AuraConfig::from_default_support(AuraDevice::X19b6, &LaptopLedData::default());
@@ -366,7 +367,10 @@ mod tests {
}; };
let mut controller = CtrlKbdLed { let mut controller = CtrlKbdLed {
led_prod: AuraDevice::X19b6, led_prod: AuraDevice::X19b6,
led_node: LEDNode::Rog(KeyboardLed::default(), HidRaw::new("id_product").unwrap()), led_node: LEDNode::Rog(
KeyboardLed::default(),
HidRaw::new(AuraDevice::X19b6.into()).unwrap(),
),
supported_data: supported_basic_modes, supported_data: supported_basic_modes,
per_key_mode_active: false, per_key_mode_active: false,
config, config,
@@ -391,6 +395,8 @@ mod tests {
} }
#[test] #[test]
#[ignore = "Unable to run in CI as the HIDRAW device is required"]
// TODO: use sim device
fn next_mode_create_multizone_if_no_config() { fn next_mode_create_multizone_if_no_config() {
// Checking to ensure set_mode errors when unsupported modes are tried // Checking to ensure set_mode errors when unsupported modes are tried
let config = AuraConfig::from_default_support(AuraDevice::X19b6, &LaptopLedData::default()); let config = AuraConfig::from_default_support(AuraDevice::X19b6, &LaptopLedData::default());
@@ -404,7 +410,10 @@ mod tests {
}; };
let mut controller = CtrlKbdLed { let mut controller = CtrlKbdLed {
led_prod: AuraDevice::X19b6, led_prod: AuraDevice::X19b6,
led_node: LEDNode::Rog(KeyboardLed::default(), HidRaw::new("id_product").unwrap()), led_node: LEDNode::Rog(
KeyboardLed::default(),
HidRaw::new(AuraDevice::X19b6.into()).unwrap(),
),
supported_data: supported_basic_modes, supported_data: supported_basic_modes,
per_key_mode_active: false, per_key_mode_active: false,
config, config,

View File

@@ -94,18 +94,23 @@ fn main() -> Result<()> {
if cli_parsed.height_fullscreen != 0 { if cli_parsed.height_fullscreen != 0 {
config.fullscreen_height = cli_parsed.height_fullscreen; config.fullscreen_height = cli_parsed.height_fullscreen;
} }
config.write();
} else if cli_parsed.windowed { } else if cli_parsed.windowed {
config.start_fullscreen = false; config.start_fullscreen = false;
config.write(); }
if is_rog_ally {
config.enable_notifications = false;
config.enable_tray_icon = false;
config.run_in_background = false;
config.startup_in_background = false;
} }
if config.startup_in_background { if config.startup_in_background {
config.run_in_background = true; config.run_in_background = true;
config.write();
} else { } else {
get_ipc_file().unwrap().write_all(&[SHOW_GUI, 0]).unwrap(); get_ipc_file().unwrap().write_all(&[SHOW_GUI, 0]).unwrap();
} }
config.write();
let enabled_notifications = EnabledNotifications::tokio_mutex(&config); let enabled_notifications = EnabledNotifications::tokio_mutex(&config);
let aura_creation = AuraCreation::new(cli_parsed.board_name, cli_parsed.layout_viewing)?; let aura_creation = AuraCreation::new(cli_parsed.board_name, cli_parsed.layout_viewing)?;

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-04-03 03:14+0000\n" "POT-Creation-Date: 2024-04-03 20:51+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"
@@ -12,46 +12,6 @@ msgstr ""
"Language: \n" "Language: \n"
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
#: rog-control-center/ui/main_window.slint:50
msgctxt "MainWindow"
msgid "ROG"
msgstr ""
#: rog-control-center/ui/main_window.slint:52
msgctxt "Menu1"
msgid "System Control"
msgstr ""
#: rog-control-center/ui/main_window.slint:53
msgctxt "Menu2"
msgid "Keyboard Aura"
msgstr ""
#: rog-control-center/ui/main_window.slint:54
msgctxt "Menu3"
msgid "AniMe Matrix"
msgstr ""
#: rog-control-center/ui/main_window.slint:55
msgctxt "Menu4"
msgid "Fan Curves"
msgstr ""
#: rog-control-center/ui/main_window.slint:56
msgctxt "Menu5"
msgid "App Settings"
msgstr ""
#: rog-control-center/ui/main_window.slint:57
msgctxt "Menu6"
msgid "About"
msgstr ""
#: rog-control-center/ui/main_window.slint:69
msgctxt "MainWindow"
msgid "Quit"
msgstr ""
#: rog-control-center/ui/pages/anime.slint:6 #: rog-control-center/ui/pages/anime.slint:6
msgctxt "Anime Brightness" msgctxt "Anime Brightness"
msgid "Off" msgid "Off"
@@ -197,91 +157,6 @@ msgctxt "PageAppSettings"
msgid "Enable change notifications" msgid "Enable change notifications"
msgstr "" msgstr ""
#: rog-control-center/ui/pages/aura.slint:27
msgctxt "PageAura"
msgid "Brightness"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:38
msgctxt "PageAura"
msgid "Aura mode"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:56
msgctxt "PageAura"
msgid "Colour 1"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:82
msgctxt "PageAura"
msgid "Colour 2"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:114
msgctxt "PageAura"
msgid "Zone"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:137
msgctxt "PageAura"
msgid "Direction"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:159
msgctxt "PageAura"
msgid "Speed"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:180
msgctxt "PageAura"
msgid "Power Settings"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:211 rog-control-center/ui/pages/aura.slint:369 rog-control-center/ui/pages/aura.slint:434
msgctxt "PageAura"
msgid "Keyboard"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:235
msgctxt "PageAura"
msgid "Lid Logo"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:259
msgctxt "PageAura"
msgid "Lightbar"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:283
msgctxt "PageAura"
msgid "Lid Zone"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:307
msgctxt "PageAura"
msgid "Rear Glow"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:375 rog-control-center/ui/pages/aura.slint:440
msgctxt "PageAura"
msgid "Boot"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:380 rog-control-center/ui/pages/aura.slint:445
msgctxt "PageAura"
msgid "Awake"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:385 rog-control-center/ui/pages/aura.slint:450
msgctxt "PageAura"
msgid "Sleep"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:390 rog-control-center/ui/pages/aura.slint:455
msgctxt "PageAura"
msgid "Shutdown"
msgstr ""
#: rog-control-center/ui/pages/fans.slint:27 #: rog-control-center/ui/pages/fans.slint:27
msgctxt "FanTab" msgctxt "FanTab"
msgid "This fan is not avilable on this machine" msgid "This fan is not avilable on this machine"
@@ -487,6 +362,111 @@ msgctxt "PageSystem"
msgid "Throttle Policy on AC" msgid "Throttle Policy on AC"
msgstr "" msgstr ""
#: rog-control-center/ui/pages/aura.slint:27
msgctxt "PageAura"
msgid "Brightness"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:38
msgctxt "PageAura"
msgid "Aura mode"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:56
msgctxt "PageAura"
msgid "Colour 1"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:82
msgctxt "PageAura"
msgid "Colour 2"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:114
msgctxt "PageAura"
msgid "Zone"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:137
msgctxt "PageAura"
msgid "Direction"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:159
msgctxt "PageAura"
msgid "Speed"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:180
msgctxt "PageAura"
msgid "Power Settings"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:211 rog-control-center/ui/pages/aura.slint:369 rog-control-center/ui/pages/aura.slint:434
msgctxt "PageAura"
msgid "Keyboard"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:235
msgctxt "PageAura"
msgid "Lid Logo"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:259
msgctxt "PageAura"
msgid "Lightbar"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:283
msgctxt "PageAura"
msgid "Lid Zone"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:307
msgctxt "PageAura"
msgid "Rear Glow"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:375 rog-control-center/ui/pages/aura.slint:440
msgctxt "PageAura"
msgid "Boot"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:380 rog-control-center/ui/pages/aura.slint:445
msgctxt "PageAura"
msgid "Awake"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:385 rog-control-center/ui/pages/aura.slint:450
msgctxt "PageAura"
msgid "Sleep"
msgstr ""
#: rog-control-center/ui/pages/aura.slint:390 rog-control-center/ui/pages/aura.slint:455
msgctxt "PageAura"
msgid "Shutdown"
msgstr ""
#: rog-control-center/ui/widgets/aura_power.slint:32
msgctxt "AuraPowerGroup"
msgid "Boot"
msgstr ""
#: rog-control-center/ui/widgets/aura_power.slint:42
msgctxt "AuraPowerGroup"
msgid "Awake"
msgstr ""
#: rog-control-center/ui/widgets/aura_power.slint:52
msgctxt "AuraPowerGroup"
msgid "Sleep"
msgstr ""
#: rog-control-center/ui/widgets/aura_power.slint:62
msgctxt "AuraPowerGroup"
msgid "Shutdown"
msgstr ""
#: rog-control-center/ui/types/aura_types.slint:69 #: rog-control-center/ui/types/aura_types.slint:69
msgctxt "Aura brightness" msgctxt "Aura brightness"
msgid "Off" msgid "Off"
@@ -647,23 +627,43 @@ msgctxt "Aura speed"
msgid "High" msgid "High"
msgstr "" msgstr ""
#: rog-control-center/ui/widgets/aura_power.slint:32 #: rog-control-center/ui/main_window.slint:50
msgctxt "AuraPowerGroup" msgctxt "MainWindow"
msgid "Boot" msgid "ROG"
msgstr "" msgstr ""
#: rog-control-center/ui/widgets/aura_power.slint:42 #: rog-control-center/ui/main_window.slint:52
msgctxt "AuraPowerGroup" msgctxt "Menu1"
msgid "Awake" msgid "System Control"
msgstr "" msgstr ""
#: rog-control-center/ui/widgets/aura_power.slint:52 #: rog-control-center/ui/main_window.slint:53
msgctxt "AuraPowerGroup" msgctxt "Menu2"
msgid "Sleep" msgid "Keyboard Aura"
msgstr "" msgstr ""
#: rog-control-center/ui/widgets/aura_power.slint:62 #: rog-control-center/ui/main_window.slint:54
msgctxt "AuraPowerGroup" msgctxt "Menu3"
msgid "Shutdown" msgid "AniMe Matrix"
msgstr ""
#: rog-control-center/ui/main_window.slint:55
msgctxt "Menu4"
msgid "Fan Curves"
msgstr ""
#: rog-control-center/ui/main_window.slint:56
msgctxt "Menu5"
msgid "App Settings"
msgstr ""
#: rog-control-center/ui/main_window.slint:57
msgctxt "Menu6"
msgid "About"
msgstr ""
#: rog-control-center/ui/main_window.slint:69
msgctxt "MainWindow"
msgid "Quit"
msgstr "" msgstr ""