From 3fb61d3bf1ba2934a0188a774967c7135afeed23 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Thu, 29 Jun 2023 18:18:42 +0200 Subject: [PATCH] X13 tweaks --- app/AsusUSB.cs | 7 ++++++- app/HardwareControl.cs | 12 ++---------- app/Input/InputDispatcher.cs | 2 ++ app/Mode/ModeControl.cs | 2 +- app/Settings.cs | 2 +- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/app/AsusUSB.cs b/app/AsusUSB.cs index ed2bbbe4..a5b993ec 100644 --- a/app/AsusUSB.cs +++ b/app/AsusUSB.cs @@ -118,7 +118,7 @@ namespace GHelper _modes.Remove(3); } - if (AppConfig.ContainsModel("401")) + if (AppConfig.ContainsModel("401") || AppConfig.ContainsModel("X13")) { _modes.Remove(2); _modes.Remove(3); @@ -150,6 +150,11 @@ namespace GHelper } } + public static bool HasColor() + { + return AppConfig.ContainsModel("GA401") || AppConfig.ContainsModel("X13"); + } + public static bool HasSecondColor() { return (mode == 1 && !AppConfig.ContainsModel("TUF")); diff --git a/app/HardwareControl.cs b/app/HardwareControl.cs index 7084ac9b..afe96dfe 100644 --- a/app/HardwareControl.cs +++ b/app/HardwareControl.cs @@ -24,7 +24,7 @@ public static class HardwareControl { int max = 58; int configMax = AppConfig.Get("fan_max"); - if (configMax > 100) configMax = 0; // skipping inadvequate settings + if (configMax > 80) configMax = 0; // skipping inadvequate settings if (AppConfig.ContainsModel("401")) max = 72; else if (AppConfig.ContainsModel("503")) max = 68; @@ -45,7 +45,7 @@ public static class HardwareControl } int fanMax = GetFanMax(); - if (fan > fanMax && fan < 110) SetFanMax(fan); + if (fan > fanMax && fan < 80) SetFanMax(fan); if (AppConfig.Is("fan_rpm")) return GHelper.Properties.Strings.FanSpeed + (fan * 100).ToString() + "RPM"; @@ -192,14 +192,6 @@ public static class HardwareControl { List tokill = new() { "EADesktop", "RadeonSoftware", "epicgameslauncher", "ASUSSmartDisplayControl" }; - - if (AppConfig.Is("kill_gpu_apps")) - { - tokill.Add("nvdisplay.container"); - tokill.Add("nvcontainer"); - tokill.Add("nvcplui"); - } - foreach (string kill in tokill) ProcessHelper.KillByName(kill); if (AppConfig.Is("kill_gpu_apps") && GpuControl is not null) diff --git a/app/Input/InputDispatcher.cs b/app/Input/InputDispatcher.cs index 39e12797..1255a5c1 100644 --- a/app/Input/InputDispatcher.cs +++ b/app/Input/InputDispatcher.cs @@ -402,9 +402,11 @@ namespace GHelper.Input switch (EventID) { case 16: // FN+F7 + //ScreenBrightness.Adjust(-10); Program.acpi.DeviceSet(AsusACPI.UniversalControl, AsusACPI.Brightness_Down, "Brightness"); break; case 32: // FN+F8 + //ScreenBrightness.Adjust(+10); Program.acpi.DeviceSet(AsusACPI.UniversalControl, AsusACPI.Brightness_Up, "Brightness"); break; case 107: // FN+F10 diff --git a/app/Mode/ModeControl.cs b/app/Mode/ModeControl.cs index 4a2c2b73..2938832a 100644 --- a/app/Mode/ModeControl.cs +++ b/app/Mode/ModeControl.cs @@ -19,7 +19,7 @@ namespace GHelper.Mode public ModeControl() { - reapplyTimer = new System.Timers.Timer(30 * 1000); + reapplyTimer = new System.Timers.Timer(AppConfig.GetMode("reapply_time", 30) * 1000); reapplyTimer.Elapsed += ReapplyTimer_Elapsed; reapplyTimer.Enabled = false; } diff --git a/app/Settings.cs b/app/Settings.cs index e29c7219..5ab1aec4 100644 --- a/app/Settings.cs +++ b/app/Settings.cs @@ -712,7 +712,7 @@ namespace GHelper pictureColor2.BackColor = AsusUSB.Color2; pictureColor2.Visible = AsusUSB.HasSecondColor(); - if (AppConfig.ContainsModel("GA401")) + if (AsusUSB.HasColor()) { panelColor.Visible = false; }