Auto off for matrix on battery

This commit is contained in:
seerge
2023-03-06 19:57:47 +01:00
parent 6c3d4b9cb2
commit 003a19d94b
4 changed files with 105 additions and 88 deletions

View File

@@ -1,7 +1,6 @@
using Microsoft.Win32;
using System.Diagnostics;
using System.Management;
using Starlight.AnimeMatrix;
public class HardwareMonitor
{
@@ -56,12 +55,14 @@ namespace GHelper
try
{
wmi = new ASUSWmi();
} catch {
}
catch
{
DialogResult dialogResult = MessageBox.Show("Can't connect to ASUS ACPI. Application can't function without it. Try to install Asus System Controll Interface", "Startup Error", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
Process.Start(new ProcessStartInfo("https://www.asus.com/support/FAQ/1047338/") { UseShellExecute = true });
}
}
Application.Exit();
return;
@@ -99,7 +100,7 @@ namespace GHelper
settingsForm.AutoScreen(isPlugged);
settingsForm.AutoPerformance(isPlugged);
settingsForm.SetAnimeMatrix();
settingsForm.SetMatrix(isPlugged);
settingsForm.SetBatteryChargeLimit(config.getConfig("charge_limit"));
}
@@ -136,7 +137,8 @@ namespace GHelper
try
{
intKey = Convert.ToInt32(command, 16);
} catch
}
catch
{
intKey = -1;
}