mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
58 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
602dfea1a6 | ||
|
|
c13a6e9ded | ||
|
|
e11027963f | ||
|
|
9d2b8b506e | ||
|
|
988c9e11dd | ||
|
|
2c6bb32e4a | ||
|
|
e33a0d05ed | ||
|
|
1c283766aa | ||
|
|
f2ef6d197f | ||
|
|
13ec0f8911 | ||
|
|
fcf213f1a0 | ||
|
|
c73b4fce97 | ||
|
|
aab1e08729 | ||
|
|
cf3a84aa3d | ||
|
|
8d119b386d | ||
|
|
0605e63433 | ||
|
|
4634404ed4 | ||
|
|
dcfaf665cd | ||
|
|
15e791cbfd | ||
|
|
5d86c821f6 | ||
|
|
e5de404e5c | ||
|
|
13aa98e954 | ||
|
|
75c397d7a4 | ||
|
|
0ad8efdb7d | ||
|
|
2064f29433 | ||
|
|
890c50d90e | ||
|
|
bd207113f8 | ||
|
|
650a5ff5c0 | ||
|
|
01ce91a474 | ||
|
|
253e1eb095 | ||
|
|
b95768d547 | ||
|
|
dfbfd16d23 | ||
|
|
3eeac0353a | ||
|
|
5e7c9a4191 | ||
|
|
ee84ba6304 | ||
|
|
d15c6cb073 | ||
|
|
1e683a0884 | ||
|
|
1ad48bf763 | ||
|
|
dcc052a574 | ||
|
|
38fca560df | ||
|
|
7e0459bd44 | ||
|
|
228ad70b8d | ||
|
|
b42e565cd6 | ||
|
|
e021d59737 | ||
|
|
dba7967ad5 | ||
|
|
a7a7170676 | ||
|
|
1d43ca3ce4 | ||
|
|
ff7618f16f | ||
|
|
bb947bf8bf | ||
|
|
63092d8415 | ||
|
|
6fbce2f495 | ||
|
|
8d89a04608 | ||
|
|
0cbc48d526 | ||
|
|
81013ca0be | ||
|
|
af2509fc17 | ||
|
|
136b5b4f55 | ||
|
|
4e2abff942 | ||
|
|
2c8a11fc24 |
25
.github/ISSUE_TEMPLATE/bug_report.md
vendored
25
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,31 +1,40 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
**Clear scenario to Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
4. Explanation of an error or a bug
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
**App Logs**
|
||||
Please include and attach log.txt from ``%AppData%\GHelper``
|
||||
|
||||
**Screenshots or screencasts**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- OS: [e.g. Windows 11]
|
||||
- Laptop model
|
||||
|
||||
|
||||
**Asus software**
|
||||
- Armoury crate (or it's services installed)
|
||||
- MyASUS installed
|
||||
- Other Asus services running in background
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
|
||||
## NOTE
|
||||
Bug reports without clear information or scenario to reproduce will be closed without answer.
|
||||
Please respect time of the developer. Thanks.
|
||||
|
||||
@@ -21,6 +21,8 @@ public class ASUSWmi
|
||||
public const uint PerformanceMode = 0x00120075; // Thermal Control
|
||||
|
||||
public const uint GPUEco = 0x00090020;
|
||||
public const uint GPUXGConnected = 0x00090018;
|
||||
public const uint GPUXG = 0x00090019;
|
||||
public const uint GPUMux = 0x00090016;
|
||||
|
||||
public const uint BatteryLimit = 0x00120057;
|
||||
@@ -31,6 +33,10 @@ public class ASUSWmi
|
||||
public const uint DevsGPUFanCurve = 0x00110025;
|
||||
public const uint DevsMidFanCurve = 0x00110032;
|
||||
|
||||
public const int Temp_CPU = 0x00120094;
|
||||
public const int Temp_GPU = 0x00120097;
|
||||
|
||||
|
||||
public const int PPT_TotalA0 = 0x001200A0; // Total PPT on 2022 and CPU PPT on 2021
|
||||
public const int PPT_EDCA1 = 0x001200A1; // CPU EDC
|
||||
public const int PPT_TDCA2 = 0x001200A2; // CPU TDC
|
||||
@@ -54,11 +60,11 @@ public class ASUSWmi
|
||||
public const int GPUModeUltimate = 2;
|
||||
|
||||
|
||||
public const int MaxTotal = 150;
|
||||
public const int MaxTotal = 200;
|
||||
public const int MinTotal = 5;
|
||||
public const int DefaultTotal = 125;
|
||||
|
||||
public const int MaxCPU = 90;
|
||||
public const int MaxCPU = 130;
|
||||
public const int MinCPU = 5;
|
||||
public const int DefaultCPU = 80;
|
||||
|
||||
@@ -153,21 +159,31 @@ public class ASUSWmi
|
||||
|
||||
}
|
||||
|
||||
public byte[] DeviceSet(uint DeviceID, int Status)
|
||||
public int DeviceSet(uint DeviceID, int Status, string logName)
|
||||
{
|
||||
byte[] args = new byte[8];
|
||||
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
||||
BitConverter.GetBytes((uint)Status).CopyTo(args, 4);
|
||||
return CallMethod(DEVS, args);
|
||||
|
||||
byte[] status = CallMethod(DEVS, args);
|
||||
int result = BitConverter.ToInt32(status, 0);
|
||||
|
||||
Logger.WriteLine(logName + " = " + Status + " : " + (result == 1 ? "OK" : result));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public byte[] DeviceSet(uint DeviceID, byte[] Params)
|
||||
public int DeviceSet(uint DeviceID, byte[] Params, string logName)
|
||||
{
|
||||
byte[] args = new byte[4 + Params.Length];
|
||||
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
||||
Params.CopyTo(args, 4);
|
||||
return CallMethod(DEVS, args);
|
||||
|
||||
byte[] status = CallMethod(DEVS, args);
|
||||
int result = BitConverter.ToInt32(status, 0);
|
||||
|
||||
Logger.WriteLine(logName + " = " + BitConverter.ToString(Params) + " : " + (result == 1 ? "OK" : result));
|
||||
return BitConverter.ToInt32(status, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +192,9 @@ public class ASUSWmi
|
||||
byte[] args = new byte[8];
|
||||
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
||||
byte[] status = CallMethod(DSTS, args);
|
||||
|
||||
return BitConverter.ToInt32(status, 0) - 65536;
|
||||
|
||||
}
|
||||
|
||||
public byte[] DeviceGetBuffer(uint DeviceID, uint Status = 0)
|
||||
@@ -184,35 +202,38 @@ public class ASUSWmi
|
||||
byte[] args = new byte[8];
|
||||
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
||||
BitConverter.GetBytes((uint)Status).CopyTo(args, 4);
|
||||
|
||||
return CallMethod(DSTS, args);
|
||||
}
|
||||
|
||||
|
||||
public void SetFanCurve(int device, byte[] curve)
|
||||
public int SetFanCurve(int device, byte[] curve)
|
||||
{
|
||||
|
||||
if (curve.Length != 16) return;
|
||||
if (curve.All(singleByte => singleByte == 0)) return;
|
||||
if (curve.Length != 16) return -1;
|
||||
if (curve.All(singleByte => singleByte == 0)) return -1;
|
||||
|
||||
string name;
|
||||
int result;
|
||||
|
||||
for (int i = 8; i < curve.Length; i++)
|
||||
{
|
||||
curve[i] = Math.Max((byte)0, Math.Min((byte)99, curve[i])); // it seems to be a bug, when some old model's bios can go nuts if fan is set to 100%
|
||||
}
|
||||
|
||||
switch (device)
|
||||
{
|
||||
case 1:
|
||||
DeviceSet(DevsGPUFanCurve, curve);
|
||||
name = "GPU";
|
||||
result = DeviceSet(DevsGPUFanCurve, curve, "FanGPU");
|
||||
break;
|
||||
case 2:
|
||||
DeviceSet(DevsMidFanCurve, curve);
|
||||
name = "Mid";
|
||||
result = DeviceSet(DevsMidFanCurve, curve, "FanMid");
|
||||
break;
|
||||
default:
|
||||
DeviceSet(DevsCPUFanCurve, curve);
|
||||
name = "CPU";
|
||||
result = DeviceSet(DevsCPUFanCurve, curve, "FanCPU");
|
||||
break;
|
||||
}
|
||||
|
||||
Logger.WriteLine("Fans" + name + " " + BitConverter.ToString(curve));
|
||||
return result;
|
||||
}
|
||||
|
||||
public byte[] GetFanCurve(int device, int mode = 0)
|
||||
@@ -250,7 +271,7 @@ public class ASUSWmi
|
||||
setting[4] = color.B;
|
||||
setting[5] = (byte)speed;
|
||||
|
||||
DeviceSet(TUF_KB, setting);
|
||||
DeviceSet(TUF_KB, setting, "TUF RGB");
|
||||
//Debug.WriteLine(BitConverter.ToString(setting));
|
||||
|
||||
}
|
||||
@@ -270,16 +291,22 @@ public class ASUSWmi
|
||||
|
||||
state = state | 0x01 << 8;
|
||||
|
||||
DeviceSet(TUF_KB_STATE, state);
|
||||
DeviceSet(TUF_KB_STATE, state, "TUF_KB");
|
||||
}
|
||||
|
||||
public void SubscribeToEvents(Action<object, EventArrivedEventArgs> EventHandler)
|
||||
{
|
||||
ManagementEventWatcher watcher = new ManagementEventWatcher();
|
||||
watcher.EventArrived += new EventArrivedEventHandler(EventHandler);
|
||||
watcher.Scope = new ManagementScope("root\\wmi");
|
||||
watcher.Query = new WqlEventQuery("SELECT * FROM AsusAtkWmiEvent");
|
||||
watcher.Start();
|
||||
try
|
||||
{
|
||||
ManagementEventWatcher watcher = new ManagementEventWatcher();
|
||||
watcher.EventArrived += new EventArrivedEventHandler(EventHandler);
|
||||
watcher.Scope = new ManagementScope("root\\wmi");
|
||||
watcher.Query = new WqlEventQuery("SELECT * FROM AsusAtkWmiEvent");
|
||||
watcher.Start();
|
||||
} catch
|
||||
{
|
||||
Logger.WriteLine("Can't connect to ASUS WMI events");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ using Starlight.Communication;
|
||||
using System.Management;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Text;
|
||||
using System.Globalization;
|
||||
using System;
|
||||
|
||||
namespace Starlight.AnimeMatrix
|
||||
{
|
||||
@@ -359,6 +361,15 @@ namespace Starlight.AnimeMatrix
|
||||
}
|
||||
|
||||
|
||||
public void PresentClock()
|
||||
{
|
||||
int second = DateTime.Now.Second;
|
||||
|
||||
if (CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern.Contains("H"))
|
||||
PresentText(DateTime.Now.ToString("H" + ((second % 2 == 0)?":":" ") + "mm"));
|
||||
else
|
||||
PresentText(DateTime.Now.ToString("h" + ((second % 2 == 0) ? ":" : " ") + "mm"), DateTime.Now.ToString("tt"));
|
||||
}
|
||||
|
||||
public void PresentText(string text1, string text2 = "")
|
||||
{
|
||||
@@ -390,7 +401,7 @@ namespace Starlight.AnimeMatrix
|
||||
|
||||
}
|
||||
|
||||
public void GenerateFrame(Image image, InterpolationMode interpolation = InterpolationMode.HighQualityBicubic)
|
||||
public void GenerateFrame(Image image, InterpolationMode interpolation = InterpolationMode.High)
|
||||
{
|
||||
|
||||
int width = MaxColumns/2 * 6;
|
||||
|
||||
@@ -108,6 +108,8 @@ public class AppConfig
|
||||
|
||||
if (device == 1)
|
||||
name = "gpu";
|
||||
else if (device == 2)
|
||||
name = "mid";
|
||||
else
|
||||
name = "cpu";
|
||||
|
||||
|
||||
61
app/Aura.cs
61
app/Aura.cs
@@ -1,5 +1,9 @@
|
||||
using HidLibrary;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
|
||||
using System.Security.Policy;
|
||||
using HidSharp.Utility;
|
||||
|
||||
namespace GHelper
|
||||
{
|
||||
@@ -54,7 +58,7 @@ namespace GHelper
|
||||
static byte[] MESSAGE_SET = { 0x5d, 0xb5, 0, 0, 0 };
|
||||
static byte[] MESSAGE_APPLY = { 0x5d, 0xb4 };
|
||||
|
||||
static int[] deviceIds = { 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0 };
|
||||
static int[] deviceIds = { 0x1a30, 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0 };
|
||||
|
||||
private static int mode = 0;
|
||||
private static int speed = 1;
|
||||
@@ -71,9 +75,8 @@ namespace GHelper
|
||||
{ 2, "Fast" }
|
||||
};
|
||||
}
|
||||
public static Dictionary<int, string> GetModes()
|
||||
{
|
||||
return new Dictionary<int, string>
|
||||
|
||||
static Dictionary<int, string> _modes = new Dictionary<int, string>
|
||||
{
|
||||
{ 0, "Static" },
|
||||
{ 1, "Breathe" },
|
||||
@@ -81,6 +84,43 @@ namespace GHelper
|
||||
{ 3, "Rainbow" },
|
||||
{ 10, "Strobe" },
|
||||
};
|
||||
|
||||
static Dictionary<int, string> _modesStrix = new Dictionary<int, string>
|
||||
{
|
||||
{ 0, "Static" },
|
||||
{ 1, "Breathe" },
|
||||
{ 2, "Color Cycle" },
|
||||
{ 3, "Rainbow" },
|
||||
{ 4, "Star" },
|
||||
{ 5, "Rain" },
|
||||
{ 6, "Highlight" },
|
||||
{ 7, "Laser" },
|
||||
{ 8, "Ripple" },
|
||||
{ 10, "Strobe" },
|
||||
{ 11, "Comet" },
|
||||
{ 12, "Flash" },
|
||||
};
|
||||
|
||||
|
||||
public static Dictionary<int, string> GetModes()
|
||||
{
|
||||
if (Program.config.ContainsModel("TUF"))
|
||||
{
|
||||
_modes.Remove(3);
|
||||
}
|
||||
|
||||
if (Program.config.ContainsModel("401"))
|
||||
{
|
||||
_modes.Remove(2);
|
||||
_modes.Remove(3);
|
||||
}
|
||||
|
||||
if (Program.config.ContainsModel("Strix") || Program.config.ContainsModel("Scar"))
|
||||
{
|
||||
return _modesStrix;
|
||||
}
|
||||
|
||||
return _modes;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +138,7 @@ namespace GHelper
|
||||
|
||||
public static bool HasSecondColor()
|
||||
{
|
||||
return mode == 1;
|
||||
return (mode == 1 && !Program.config.ContainsModel("TUF"));
|
||||
}
|
||||
|
||||
public static int Speed
|
||||
@@ -148,7 +188,7 @@ namespace GHelper
|
||||
{
|
||||
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
|
||||
|
||||
byte[] msg = { 0x5a, 0xba, 0xc5, 0xc4, (byte)brightness };
|
||||
byte[] msg = { 0x5d, 0xba, 0xc5, 0xc4, (byte)brightness };
|
||||
|
||||
foreach (HidDevice device in HidDeviceList)
|
||||
if (device.IsConnected && device.Description.Contains("HID"))
|
||||
@@ -158,6 +198,7 @@ namespace GHelper
|
||||
device.CloseDevice();
|
||||
}
|
||||
|
||||
Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
|
||||
}
|
||||
|
||||
|
||||
@@ -184,7 +225,10 @@ namespace GHelper
|
||||
device.CloseDevice();
|
||||
}
|
||||
|
||||
Program.wmi.TUFKeyboardPower(awake, boot, sleep, shutdown);
|
||||
Logger.WriteLine("USB-KB = " + BitConverter.ToString(msg));
|
||||
|
||||
if (Program.config.ContainsModel("TUF"))
|
||||
Program.wmi.TUFKeyboardPower(awake, boot, sleep, shutdown);
|
||||
|
||||
}
|
||||
|
||||
@@ -220,7 +264,8 @@ namespace GHelper
|
||||
device.CloseDevice();
|
||||
}
|
||||
|
||||
Program.wmi.TUFKeyboardRGB(Mode, Color1, _speed);
|
||||
if (Program.config.ContainsModel("TUF"))
|
||||
Program.wmi.TUFKeyboardRGB(Mode, Color1, _speed);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,43 +7,13 @@ public static class ControlHelper
|
||||
{
|
||||
|
||||
static bool _invert = false;
|
||||
static bool _darkTheme = false;
|
||||
|
||||
static float _scale = 1;
|
||||
|
||||
static Color formBack;
|
||||
static Color backMain;
|
||||
static Color foreMain;
|
||||
static Color foreAccent;
|
||||
static Color borderMain;
|
||||
static Color buttonMain;
|
||||
|
||||
public static void Adjust(RForm container, bool darkTheme = false, bool invert = false)
|
||||
public static void Adjust(RForm container, bool invert = false)
|
||||
{
|
||||
|
||||
_darkTheme = darkTheme;
|
||||
|
||||
if (darkTheme)
|
||||
{
|
||||
formBack = Color.FromArgb(255, 35, 35, 35);
|
||||
backMain = Color.FromArgb(255, 50, 50, 50);
|
||||
foreMain = Color.FromArgb(255, 240, 240, 240);
|
||||
foreAccent = Color.FromArgb(255, 100, 100, 100);
|
||||
borderMain = Color.FromArgb(255, 50, 50, 50);
|
||||
buttonMain = Color.FromArgb(255, 80, 80, 80);
|
||||
}
|
||||
else
|
||||
{
|
||||
formBack = SystemColors.Control;
|
||||
backMain = SystemColors.ControlLightLight;
|
||||
foreMain = SystemColors.ControlText;
|
||||
foreAccent = Color.LightGray;
|
||||
borderMain = Color.LightGray;
|
||||
buttonMain = Color.FromArgb(255, 250, 250, 250);
|
||||
}
|
||||
|
||||
container.BackColor = formBack;
|
||||
container.ForeColor = foreMain;
|
||||
container.BackColor = RForm.formBack;
|
||||
container.ForeColor = RForm.foreMain;
|
||||
|
||||
_invert = invert;
|
||||
AdjustControls(container.Controls);
|
||||
@@ -84,11 +54,11 @@ public static class ControlHelper
|
||||
var button = control as RButton;
|
||||
if (button != null)
|
||||
{
|
||||
button.BackColor = button.Secondary ? buttonMain : backMain;
|
||||
button.ForeColor = foreMain;
|
||||
button.BackColor = button.Secondary ? RForm.buttonSecond : RForm.buttonMain;
|
||||
button.ForeColor = RForm.foreMain;
|
||||
|
||||
button.FlatStyle = FlatStyle.Flat;
|
||||
button.FlatAppearance.BorderColor = borderMain;
|
||||
button.FlatAppearance.BorderColor = RForm.borderMain;
|
||||
|
||||
if (button.Image is not null)
|
||||
button.Image = AdjustImage(button.Image);
|
||||
@@ -102,45 +72,52 @@ public static class ControlHelper
|
||||
var combo = control as RComboBox;
|
||||
if (combo != null)
|
||||
{
|
||||
combo.BackColor = backMain;
|
||||
combo.ForeColor = foreMain;
|
||||
combo.BorderColor = backMain;
|
||||
combo.ButtonColor = buttonMain;
|
||||
combo.BackColor = RForm.buttonMain;
|
||||
combo.ForeColor = RForm.foreMain;
|
||||
combo.BorderColor = RForm.buttonMain;
|
||||
combo.ButtonColor = RForm.buttonMain;
|
||||
combo.ArrowColor = RForm.foreMain;
|
||||
}
|
||||
|
||||
var gb = control as GroupBox;
|
||||
if (gb != null)
|
||||
{
|
||||
gb.ForeColor = foreMain;
|
||||
gb.ForeColor = RForm.foreMain;
|
||||
}
|
||||
|
||||
var sl = control as Slider;
|
||||
if (sl != null)
|
||||
if (sl != null)
|
||||
{
|
||||
sl.borderColor = buttonMain;
|
||||
sl.borderColor = RForm.buttonMain;
|
||||
}
|
||||
|
||||
var chk = control as CheckBox;
|
||||
if (chk != null && chk.Padding.Left > 5)
|
||||
{
|
||||
chk.BackColor = RForm.buttonSecond;
|
||||
}
|
||||
|
||||
var chart = control as Chart;
|
||||
if (chart != null)
|
||||
{
|
||||
chart.BackColor = backMain;
|
||||
chart.ChartAreas[0].BackColor = backMain;
|
||||
chart.BackColor = RForm.chartMain;
|
||||
chart.ChartAreas[0].BackColor = RForm.chartMain;
|
||||
|
||||
chart.ChartAreas[0].AxisX.TitleForeColor = foreMain;
|
||||
chart.ChartAreas[0].AxisY.TitleForeColor = foreMain;
|
||||
chart.ChartAreas[0].AxisX.TitleForeColor = RForm.foreMain;
|
||||
chart.ChartAreas[0].AxisY.TitleForeColor = RForm.foreMain;
|
||||
|
||||
chart.ChartAreas[0].AxisX.LabelStyle.ForeColor = foreMain;
|
||||
chart.ChartAreas[0].AxisY.LabelStyle.ForeColor = foreMain;
|
||||
chart.ChartAreas[0].AxisX.LabelStyle.ForeColor = RForm.foreMain;
|
||||
chart.ChartAreas[0].AxisY.LabelStyle.ForeColor = RForm.foreMain;
|
||||
|
||||
chart.ChartAreas[0].AxisX.MajorTickMark.LineColor = foreMain;
|
||||
chart.ChartAreas[0].AxisY.MajorTickMark.LineColor = foreMain;
|
||||
chart.ChartAreas[0].AxisX.MajorTickMark.LineColor = RForm.foreMain;
|
||||
chart.ChartAreas[0].AxisY.MajorTickMark.LineColor = RForm.foreMain;
|
||||
|
||||
chart.ChartAreas[0].AxisX.MajorGrid.LineColor = foreAccent;
|
||||
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = foreAccent;
|
||||
chart.ChartAreas[0].AxisX.LineColor = foreAccent;
|
||||
chart.ChartAreas[0].AxisY.LineColor = foreAccent;
|
||||
chart.ChartAreas[0].AxisX.MajorGrid.LineColor = RForm.chartGrid;
|
||||
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = RForm.chartGrid;
|
||||
chart.ChartAreas[0].AxisX.LineColor = RForm.chartGrid;
|
||||
chart.ChartAreas[0].AxisY.LineColor = RForm.chartGrid;
|
||||
|
||||
chart.Titles[0].ForeColor = foreMain;
|
||||
chart.Titles[0].ForeColor = RForm.foreMain;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Microsoft.Win32;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
@@ -10,9 +9,18 @@ namespace CustomControls
|
||||
public class RForm : Form
|
||||
{
|
||||
|
||||
protected static Color colorEco = Color.FromArgb(255, 6, 180, 138);
|
||||
protected static Color colorStandard = Color.FromArgb(255, 58, 174, 239);
|
||||
protected static Color colorTurbo = Color.FromArgb(255, 255, 32, 32);
|
||||
public static Color colorEco = Color.FromArgb(255, 6, 180, 138);
|
||||
public static Color colorStandard = Color.FromArgb(255, 58, 174, 239);
|
||||
public static Color colorTurbo = Color.FromArgb(255, 255, 32, 32);
|
||||
|
||||
public static Color buttonMain;
|
||||
public static Color buttonSecond;
|
||||
|
||||
public static Color formBack;
|
||||
public static Color foreMain;
|
||||
public static Color borderMain;
|
||||
public static Color chartMain;
|
||||
public static Color chartGrid;
|
||||
|
||||
[DllImport("UXTheme.dll", SetLastError = true, EntryPoint = "#138")]
|
||||
public static extern bool CheckSystemDarkModeStatus();
|
||||
@@ -20,7 +28,35 @@ namespace CustomControls
|
||||
[DllImport("DwmApi")] //System.Runtime.InteropServices
|
||||
private static extern int DwmSetWindowAttribute(IntPtr hwnd, int attr, int[] attrValue, int attrSize);
|
||||
|
||||
public bool darkTheme;
|
||||
public bool darkTheme = false;
|
||||
|
||||
public static void InitColors(bool darkTheme)
|
||||
{
|
||||
if (darkTheme)
|
||||
{
|
||||
buttonMain = Color.FromArgb(255, 55, 55, 55);
|
||||
buttonSecond = Color.FromArgb(255, 38, 38, 38);
|
||||
|
||||
formBack = Color.FromArgb(255, 28, 28, 28);
|
||||
foreMain = Color.FromArgb(255, 240, 240, 240);
|
||||
borderMain = Color.FromArgb(255, 50, 50, 50);
|
||||
|
||||
chartMain = Color.FromArgb(255, 35, 35, 35);
|
||||
chartGrid = Color.FromArgb(255, 70, 70, 70);
|
||||
}
|
||||
else
|
||||
{
|
||||
buttonMain = SystemColors.ControlLightLight;
|
||||
buttonSecond = SystemColors.ControlLight;
|
||||
|
||||
formBack = SystemColors.Control;
|
||||
foreMain = SystemColors.ControlText;
|
||||
borderMain = Color.LightGray;
|
||||
|
||||
chartMain = SystemColors.ControlLightLight;
|
||||
chartGrid = Color.LightGray;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsDarkTheme()
|
||||
{
|
||||
@@ -37,13 +73,15 @@ namespace CustomControls
|
||||
bool changed = (darkTheme != newDarkTheme);
|
||||
darkTheme = newDarkTheme;
|
||||
|
||||
InitColors(darkTheme);
|
||||
|
||||
if (setDPI)
|
||||
ControlHelper.Resize(this);
|
||||
|
||||
if (changed)
|
||||
{
|
||||
DwmSetWindowAttribute(this.Handle, 20, new[] { darkTheme ? 1 : 0 }, 4);
|
||||
ControlHelper.Adjust(this, darkTheme, changed);
|
||||
ControlHelper.Adjust(this, changed);
|
||||
}
|
||||
|
||||
return changed;
|
||||
@@ -53,7 +91,13 @@ namespace CustomControls
|
||||
}
|
||||
|
||||
|
||||
public class RComboBox : ComboBox
|
||||
public class RCheckBox : CheckBox
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class RComboBox : ComboBox
|
||||
{
|
||||
private Color borderColor = Color.Gray;
|
||||
[DefaultValue(typeof(Color), "Gray")]
|
||||
@@ -71,8 +115,8 @@ namespace CustomControls
|
||||
}
|
||||
|
||||
|
||||
private Color buttonColor = Color.FromArgb(255,230, 230, 230);
|
||||
[DefaultValue(typeof(Color), "230, 230, 230")]
|
||||
private Color buttonColor = Color.FromArgb(255, 255, 255, 255);
|
||||
[DefaultValue(typeof(Color), "255, 255, 255")]
|
||||
public Color ButtonColor
|
||||
{
|
||||
get { return buttonColor; }
|
||||
|
||||
151
app/Fans.Designer.cs
generated
151
app/Fans.Designer.cs
generated
@@ -31,12 +31,12 @@ namespace GHelper
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
ChartArea chartArea1 = new ChartArea();
|
||||
Title title1 = new Title();
|
||||
ChartArea chartArea2 = new ChartArea();
|
||||
Title title2 = new Title();
|
||||
ChartArea chartArea3 = new ChartArea();
|
||||
Title title3 = new Title();
|
||||
ChartArea chartArea4 = new ChartArea();
|
||||
Title title4 = new Title();
|
||||
ChartArea chartArea5 = new ChartArea();
|
||||
Title title5 = new Title();
|
||||
ChartArea chartArea6 = new ChartArea();
|
||||
Title title6 = new Title();
|
||||
panelFans = new Panel();
|
||||
labelTip = new Label();
|
||||
labelBoost = new Label();
|
||||
@@ -47,14 +47,12 @@ namespace GHelper
|
||||
chartCPU = new Chart();
|
||||
chartMid = new Chart();
|
||||
labelFans = new Label();
|
||||
checkAuto = new CheckBox();
|
||||
checkApplyFans = new RCheckBox();
|
||||
buttonReset = new RButton();
|
||||
buttonApply = new RButton();
|
||||
panelPower = new Panel();
|
||||
pictureBox1 = new PictureBox();
|
||||
labelPowerLimits = new Label();
|
||||
checkApplyPower = new CheckBox();
|
||||
buttonApplyPower = new RButton();
|
||||
checkApplyPower = new RCheckBox();
|
||||
panelCPU = new Panel();
|
||||
labelCPU = new Label();
|
||||
label2 = new Label();
|
||||
@@ -63,7 +61,6 @@ namespace GHelper
|
||||
labelTotal = new Label();
|
||||
label1 = new Label();
|
||||
trackTotal = new TrackBar();
|
||||
labelApplied = new Label();
|
||||
pictureFine = new PictureBox();
|
||||
labelInfo = new Label();
|
||||
panelFans.SuspendLayout();
|
||||
@@ -89,9 +86,8 @@ namespace GHelper
|
||||
panelFans.Controls.Add(picturePerf);
|
||||
panelFans.Controls.Add(tableFanCharts);
|
||||
panelFans.Controls.Add(labelFans);
|
||||
panelFans.Controls.Add(checkAuto);
|
||||
panelFans.Controls.Add(checkApplyFans);
|
||||
panelFans.Controls.Add(buttonReset);
|
||||
panelFans.Controls.Add(buttonApply);
|
||||
panelFans.Dock = DockStyle.Left;
|
||||
panelFans.Location = new Point(364, 0);
|
||||
panelFans.Margin = new Padding(0);
|
||||
@@ -104,7 +100,7 @@ namespace GHelper
|
||||
//
|
||||
labelTip.AutoSize = true;
|
||||
labelTip.BackColor = SystemColors.ControlLightLight;
|
||||
labelTip.Location = new Point(245, 13);
|
||||
labelTip.Location = new Point(271, 13);
|
||||
labelTip.Name = "labelTip";
|
||||
labelTip.Padding = new Padding(5);
|
||||
labelTip.Size = new Size(107, 42);
|
||||
@@ -124,6 +120,7 @@ namespace GHelper
|
||||
//
|
||||
comboBoost.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
comboBoost.BorderColor = Color.White;
|
||||
comboBoost.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||
comboBoost.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||
comboBoost.FormattingEnabled = true;
|
||||
comboBoost.Items.AddRange(new object[] { "Disabled", "Enabled", "Aggressive", "Efficient Enabled", "Efficient Aggressive" });
|
||||
@@ -164,8 +161,8 @@ namespace GHelper
|
||||
//
|
||||
// chartGPU
|
||||
//
|
||||
chartArea1.Name = "ChartArea1";
|
||||
chartGPU.ChartAreas.Add(chartArea1);
|
||||
chartArea4.Name = "ChartArea1";
|
||||
chartGPU.ChartAreas.Add(chartArea4);
|
||||
chartGPU.Dock = DockStyle.Fill;
|
||||
chartGPU.Location = new Point(2, 340);
|
||||
chartGPU.Margin = new Padding(2, 10, 2, 10);
|
||||
@@ -173,13 +170,13 @@ namespace GHelper
|
||||
chartGPU.Size = new Size(760, 310);
|
||||
chartGPU.TabIndex = 17;
|
||||
chartGPU.Text = "chartGPU";
|
||||
title1.Name = "Title1";
|
||||
chartGPU.Titles.Add(title1);
|
||||
title4.Name = "Title1";
|
||||
chartGPU.Titles.Add(title4);
|
||||
//
|
||||
// chartCPU
|
||||
//
|
||||
chartArea2.Name = "ChartArea1";
|
||||
chartCPU.ChartAreas.Add(chartArea2);
|
||||
chartArea5.Name = "ChartArea1";
|
||||
chartCPU.ChartAreas.Add(chartArea5);
|
||||
chartCPU.Dock = DockStyle.Fill;
|
||||
chartCPU.Location = new Point(2, 10);
|
||||
chartCPU.Margin = new Padding(2, 10, 2, 10);
|
||||
@@ -187,13 +184,13 @@ namespace GHelper
|
||||
chartCPU.Size = new Size(760, 310);
|
||||
chartCPU.TabIndex = 14;
|
||||
chartCPU.Text = "chartCPU";
|
||||
title2.Name = "Title1";
|
||||
chartCPU.Titles.Add(title2);
|
||||
title5.Name = "Title1";
|
||||
chartCPU.Titles.Add(title5);
|
||||
//
|
||||
// chartMid
|
||||
//
|
||||
chartArea3.Name = "ChartArea3";
|
||||
chartMid.ChartAreas.Add(chartArea3);
|
||||
chartArea6.Name = "ChartArea3";
|
||||
chartMid.ChartAreas.Add(chartArea6);
|
||||
chartMid.Dock = DockStyle.Fill;
|
||||
chartMid.Location = new Point(2, 670);
|
||||
chartMid.Margin = new Padding(2, 10, 2, 10);
|
||||
@@ -201,8 +198,8 @@ namespace GHelper
|
||||
chartMid.Size = new Size(760, 312);
|
||||
chartMid.TabIndex = 14;
|
||||
chartMid.Text = "chartMid";
|
||||
title3.Name = "Title3";
|
||||
chartMid.Titles.Add(title3);
|
||||
title6.Name = "Title3";
|
||||
chartMid.Titles.Add(title6);
|
||||
chartMid.Visible = false;
|
||||
//
|
||||
// labelFans
|
||||
@@ -216,61 +213,44 @@ namespace GHelper
|
||||
labelFans.TabIndex = 28;
|
||||
labelFans.Text = "Fan Curves";
|
||||
//
|
||||
// checkAuto
|
||||
// checkApplyFans
|
||||
//
|
||||
checkAuto.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||
checkAuto.AutoSize = true;
|
||||
checkAuto.Location = new Point(377, 1086);
|
||||
checkAuto.Margin = new Padding(4, 2, 4, 2);
|
||||
checkAuto.Name = "checkAuto";
|
||||
checkAuto.Size = new Size(165, 36);
|
||||
checkAuto.TabIndex = 17;
|
||||
checkAuto.Text = "Auto Apply";
|
||||
checkAuto.UseVisualStyleBackColor = true;
|
||||
checkApplyFans.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||
checkApplyFans.AutoSize = true;
|
||||
checkApplyFans.BackColor = SystemColors.ControlLight;
|
||||
checkApplyFans.Location = new Point(449, 1084);
|
||||
checkApplyFans.Margin = new Padding(4, 2, 4, 2);
|
||||
checkApplyFans.Name = "checkApplyFans";
|
||||
checkApplyFans.Padding = new Padding(15, 5, 15, 5);
|
||||
checkApplyFans.Size = new Size(339, 46);
|
||||
checkApplyFans.TabIndex = 17;
|
||||
checkApplyFans.Text = "Apply Custom Fan Curve";
|
||||
checkApplyFans.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// buttonReset
|
||||
//
|
||||
buttonReset.Activated = false;
|
||||
buttonReset.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
buttonReset.BackColor = Color.FromArgb(230, 230, 230);
|
||||
buttonReset.BackColor = SystemColors.ControlLight;
|
||||
buttonReset.BorderColor = Color.Transparent;
|
||||
buttonReset.BorderRadius = 2;
|
||||
buttonReset.FlatStyle = FlatStyle.Flat;
|
||||
buttonReset.Location = new Point(30, 1081);
|
||||
buttonReset.Location = new Point(30, 1084);
|
||||
buttonReset.Margin = new Padding(4, 2, 4, 2);
|
||||
buttonReset.Name = "buttonReset";
|
||||
buttonReset.Secondary = true;
|
||||
buttonReset.Size = new Size(232, 44);
|
||||
buttonReset.Size = new Size(232, 50);
|
||||
buttonReset.TabIndex = 15;
|
||||
buttonReset.Text = "Factory Defaults";
|
||||
buttonReset.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// buttonApply
|
||||
//
|
||||
buttonApply.Activated = false;
|
||||
buttonApply.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
||||
buttonApply.BackColor = Color.FromArgb(230, 230, 230);
|
||||
buttonApply.BorderColor = Color.Transparent;
|
||||
buttonApply.BorderRadius = 2;
|
||||
buttonApply.FlatStyle = FlatStyle.Flat;
|
||||
buttonApply.Location = new Point(542, 1081);
|
||||
buttonApply.Margin = new Padding(4, 2, 4, 2);
|
||||
buttonApply.Name = "buttonApply";
|
||||
buttonApply.Secondary = true;
|
||||
buttonApply.Size = new Size(248, 44);
|
||||
buttonApply.TabIndex = 14;
|
||||
buttonApply.Text = "Apply Custom Curve";
|
||||
buttonApply.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// panelPower
|
||||
//
|
||||
panelPower.Controls.Add(pictureBox1);
|
||||
panelPower.Controls.Add(labelPowerLimits);
|
||||
panelPower.Controls.Add(checkApplyPower);
|
||||
panelPower.Controls.Add(buttonApplyPower);
|
||||
panelPower.Controls.Add(panelCPU);
|
||||
panelPower.Controls.Add(panelTotal);
|
||||
panelPower.Controls.Add(labelApplied);
|
||||
panelPower.Controls.Add(pictureFine);
|
||||
panelPower.Controls.Add(labelInfo);
|
||||
panelPower.Dock = DockStyle.Left;
|
||||
@@ -308,37 +288,22 @@ namespace GHelper
|
||||
//
|
||||
checkApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
||||
checkApplyPower.AutoSize = true;
|
||||
checkApplyPower.Location = new Point(27, 1039);
|
||||
checkApplyPower.BackColor = SystemColors.ControlLight;
|
||||
checkApplyPower.Location = new Point(20, 1086);
|
||||
checkApplyPower.Margin = new Padding(4, 2, 4, 2);
|
||||
checkApplyPower.Name = "checkApplyPower";
|
||||
checkApplyPower.Size = new Size(165, 36);
|
||||
checkApplyPower.Padding = new Padding(15, 5, 15, 5);
|
||||
checkApplyPower.Size = new Size(277, 46);
|
||||
checkApplyPower.TabIndex = 25;
|
||||
checkApplyPower.Text = "Auto Apply";
|
||||
checkApplyPower.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonApplyPower
|
||||
//
|
||||
buttonApplyPower.Activated = false;
|
||||
buttonApplyPower.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
||||
buttonApplyPower.BackColor = Color.FromArgb(230, 230, 230);
|
||||
buttonApplyPower.BorderColor = Color.Transparent;
|
||||
buttonApplyPower.BorderRadius = 2;
|
||||
buttonApplyPower.FlatStyle = FlatStyle.Flat;
|
||||
buttonApplyPower.Location = new Point(20, 1081);
|
||||
buttonApplyPower.Margin = new Padding(4, 2, 4, 2);
|
||||
buttonApplyPower.Name = "buttonApplyPower";
|
||||
buttonApplyPower.Secondary = true;
|
||||
buttonApplyPower.Size = new Size(324, 44);
|
||||
buttonApplyPower.TabIndex = 24;
|
||||
buttonApplyPower.Text = "Apply Power Limits";
|
||||
buttonApplyPower.UseVisualStyleBackColor = false;
|
||||
checkApplyPower.Text = "Apply Power Limits";
|
||||
checkApplyPower.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// panelCPU
|
||||
//
|
||||
panelCPU.Controls.Add(labelCPU);
|
||||
panelCPU.Controls.Add(label2);
|
||||
panelCPU.Controls.Add(trackCPU);
|
||||
panelCPU.Location = new Point(184, 93);
|
||||
panelCPU.Location = new Point(184, 72);
|
||||
panelCPU.Margin = new Padding(4);
|
||||
panelCPU.Name = "panelCPU";
|
||||
panelCPU.Size = new Size(160, 510);
|
||||
@@ -371,7 +336,7 @@ namespace GHelper
|
||||
trackCPU.Location = new Point(48, 88);
|
||||
trackCPU.Margin = new Padding(4, 2, 4, 2);
|
||||
trackCPU.Maximum = 85;
|
||||
trackCPU.Minimum = 15;
|
||||
trackCPU.Minimum = 5;
|
||||
trackCPU.Name = "trackCPU";
|
||||
trackCPU.Orientation = Orientation.Vertical;
|
||||
trackCPU.Size = new Size(90, 416);
|
||||
@@ -384,7 +349,7 @@ namespace GHelper
|
||||
panelTotal.Controls.Add(labelTotal);
|
||||
panelTotal.Controls.Add(label1);
|
||||
panelTotal.Controls.Add(trackTotal);
|
||||
panelTotal.Location = new Point(16, 93);
|
||||
panelTotal.Location = new Point(16, 72);
|
||||
panelTotal.Margin = new Padding(4);
|
||||
panelTotal.Name = "panelTotal";
|
||||
panelTotal.Size = new Size(160, 512);
|
||||
@@ -416,8 +381,8 @@ namespace GHelper
|
||||
//
|
||||
trackTotal.Location = new Point(44, 88);
|
||||
trackTotal.Margin = new Padding(4, 2, 4, 2);
|
||||
trackTotal.Maximum = 150;
|
||||
trackTotal.Minimum = 15;
|
||||
trackTotal.Maximum = 180;
|
||||
trackTotal.Minimum = 10;
|
||||
trackTotal.Name = "trackTotal";
|
||||
trackTotal.Orientation = Orientation.Vertical;
|
||||
trackTotal.Size = new Size(90, 416);
|
||||
@@ -426,17 +391,6 @@ namespace GHelper
|
||||
trackTotal.TickStyle = TickStyle.TopLeft;
|
||||
trackTotal.Value = 125;
|
||||
//
|
||||
// labelApplied
|
||||
//
|
||||
labelApplied.AutoSize = true;
|
||||
labelApplied.ForeColor = Color.Tomato;
|
||||
labelApplied.Location = new Point(56, 54);
|
||||
labelApplied.Margin = new Padding(4, 0, 4, 0);
|
||||
labelApplied.Name = "labelApplied";
|
||||
labelApplied.Size = new Size(143, 32);
|
||||
labelApplied.TabIndex = 21;
|
||||
labelApplied.Text = "Not Applied";
|
||||
//
|
||||
// pictureFine
|
||||
//
|
||||
pictureFine.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||
@@ -501,12 +455,10 @@ namespace GHelper
|
||||
|
||||
#endregion
|
||||
private Panel panelFans;
|
||||
private CheckBox checkAuto;
|
||||
private RCheckBox checkApplyFans;
|
||||
private RButton buttonReset;
|
||||
private RButton buttonApply;
|
||||
private Panel panelPower;
|
||||
private CheckBox checkApplyPower;
|
||||
private RButton buttonApplyPower;
|
||||
private RCheckBox checkApplyPower;
|
||||
private Panel panelCPU;
|
||||
private Label labelCPU;
|
||||
private Label label2;
|
||||
@@ -515,7 +467,6 @@ namespace GHelper
|
||||
private Label labelTotal;
|
||||
private Label label1;
|
||||
private TrackBar trackTotal;
|
||||
private Label labelApplied;
|
||||
private PictureBox pictureFine;
|
||||
private Label labelInfo;
|
||||
private Label labelPowerLimits;
|
||||
|
||||
230
app/Fans.cs
230
app/Fans.cs
@@ -13,12 +13,74 @@ namespace GHelper
|
||||
Series seriesMid;
|
||||
|
||||
static int MinRPM, MaxRPM;
|
||||
public Fans()
|
||||
{
|
||||
|
||||
InitializeComponent();
|
||||
InitTheme();
|
||||
|
||||
MinRPM = 18;
|
||||
MaxRPM = HardwareMonitor.GetFanMax();
|
||||
|
||||
|
||||
|
||||
labelTip.Visible = false;
|
||||
labelTip.BackColor = Color.Transparent;
|
||||
|
||||
FormClosing += Fans_FormClosing;
|
||||
|
||||
seriesCPU = chartCPU.Series.Add("CPU");
|
||||
seriesGPU = chartGPU.Series.Add("GPU");
|
||||
seriesMid = chartMid.Series.Add("Mid");
|
||||
|
||||
seriesCPU.Color = colorStandard;
|
||||
seriesGPU.Color = colorTurbo;
|
||||
seriesMid.Color = colorEco;
|
||||
|
||||
chartCPU.MouseMove += ChartCPU_MouseMove;
|
||||
chartCPU.MouseUp += ChartCPU_MouseUp;
|
||||
|
||||
chartGPU.MouseMove += ChartCPU_MouseMove;
|
||||
chartGPU.MouseUp += ChartCPU_MouseUp;
|
||||
|
||||
chartMid.MouseMove += ChartCPU_MouseMove;
|
||||
chartMid.MouseUp += ChartCPU_MouseUp;
|
||||
|
||||
buttonReset.Click += ButtonReset_Click;
|
||||
|
||||
trackTotal.Maximum = ASUSWmi.MaxTotal;
|
||||
trackTotal.Minimum = ASUSWmi.MinTotal;
|
||||
|
||||
trackCPU.Maximum = ASUSWmi.MaxCPU;
|
||||
trackCPU.Minimum = ASUSWmi.MinCPU;
|
||||
|
||||
trackCPU.Scroll += TrackPower_Scroll;
|
||||
trackTotal.Scroll += TrackPower_Scroll;
|
||||
|
||||
trackCPU.MouseUp += TrackPower_MouseUp;
|
||||
trackTotal.MouseUp += TrackPower_MouseUp;
|
||||
|
||||
checkApplyFans.Click += CheckApplyFans_Click;
|
||||
checkApplyPower.Click += CheckApplyPower_Click;
|
||||
|
||||
//labelInfo.MaximumSize = new Size(280, 0);
|
||||
labelInfo.Text = "Power Limits (PPT) is\nexperimental feature.\n\nUse carefully and\non your own risk!";
|
||||
|
||||
InitFans();
|
||||
InitPower();
|
||||
InitBoost();
|
||||
|
||||
comboBoost.SelectedValueChanged += ComboBoost_Changed;
|
||||
|
||||
Shown += Fans_Shown;
|
||||
|
||||
}
|
||||
|
||||
static string ChartPercToRPM(int percentage, string unit = "")
|
||||
{
|
||||
if (percentage == 0) return "OFF";
|
||||
|
||||
return (200 * Math.Round((float)(MinRPM + (MaxRPM - MinRPM) * percentage * 0.01) / 200)).ToString() + unit;
|
||||
return (200 * Math.Round((float)(MinRPM * 100 + (MaxRPM - MinRPM) * percentage) / 200)).ToString() + unit;
|
||||
}
|
||||
|
||||
void SetChart(Chart chart, int device)
|
||||
@@ -47,12 +109,10 @@ namespace GHelper
|
||||
|
||||
chart.ChartAreas[0].AxisY.LabelStyle.Font = new Font("Arial", 7F);
|
||||
|
||||
var foreAccent = Color.FromArgb(255, 100, 100, 100);
|
||||
|
||||
chart.ChartAreas[0].AxisX.MajorGrid.LineColor = foreAccent;
|
||||
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = foreAccent;
|
||||
chart.ChartAreas[0].AxisX.LineColor = foreAccent;
|
||||
chart.ChartAreas[0].AxisY.LineColor = foreAccent;
|
||||
chart.ChartAreas[0].AxisX.MajorGrid.LineColor = chartGrid;
|
||||
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = chartGrid;
|
||||
chart.ChartAreas[0].AxisX.LineColor = chartGrid;
|
||||
chart.ChartAreas[0].AxisY.LineColor = chartGrid;
|
||||
|
||||
for (int i = 0; i <= 90; i += 10)
|
||||
chart.ChartAreas[0].AxisY.CustomLabels.Add(i - 2, i + 2, ChartPercToRPM(i));
|
||||
@@ -83,73 +143,10 @@ namespace GHelper
|
||||
Left = Program.settingsForm.Left - Width - 5;
|
||||
}
|
||||
|
||||
public Fans()
|
||||
|
||||
private void TrackPower_MouseUp(object? sender, MouseEventArgs e)
|
||||
{
|
||||
|
||||
InitializeComponent();
|
||||
InitTheme();
|
||||
|
||||
MinRPM = 1800;
|
||||
|
||||
if (Program.config.ContainsModel("401"))
|
||||
MaxRPM = 7200;
|
||||
else if (Program.config.ContainsModel("503"))
|
||||
MaxRPM = 6800;
|
||||
else
|
||||
MaxRPM = 5800;
|
||||
|
||||
|
||||
|
||||
labelTip.Visible = false;
|
||||
labelTip.BackColor = Color.Transparent;
|
||||
|
||||
FormClosing += Fans_FormClosing;
|
||||
|
||||
seriesCPU = chartCPU.Series.Add("CPU");
|
||||
seriesGPU = chartGPU.Series.Add("GPU");
|
||||
seriesMid = chartMid.Series.Add("Mid");
|
||||
|
||||
seriesCPU.Color = colorStandard;
|
||||
seriesGPU.Color = colorTurbo;
|
||||
seriesMid.Color = colorEco;
|
||||
|
||||
chartCPU.MouseMove += ChartCPU_MouseMove;
|
||||
chartCPU.MouseUp += ChartCPU_MouseUp;
|
||||
|
||||
chartGPU.MouseMove += ChartCPU_MouseMove;
|
||||
chartGPU.MouseUp += ChartCPU_MouseUp;
|
||||
|
||||
chartMid.MouseMove += ChartCPU_MouseMove;
|
||||
chartMid.MouseUp += ChartCPU_MouseUp;
|
||||
|
||||
buttonReset.Click += ButtonReset_Click;
|
||||
buttonApply.Click += ButtonApply_Click;
|
||||
|
||||
trackTotal.Maximum = ASUSWmi.MaxTotal;
|
||||
trackTotal.Minimum = ASUSWmi.MinTotal;
|
||||
|
||||
trackCPU.Maximum = ASUSWmi.MaxCPU;
|
||||
trackCPU.Minimum = ASUSWmi.MinCPU;
|
||||
|
||||
trackCPU.Scroll += TrackCPU_Scroll;
|
||||
trackTotal.Scroll += TrackTotal_Scroll;
|
||||
|
||||
buttonApplyPower.Click += ButtonApplyPower_Click;
|
||||
|
||||
checkAuto.Click += CheckAuto_Click;
|
||||
checkApplyPower.Click += CheckApplyPower_Click;
|
||||
|
||||
//labelInfo.MaximumSize = new Size(280, 0);
|
||||
labelInfo.Text = "Power Limits (PPT) is\nexperimental feature.\n\nUse carefully and\non your own risk!";
|
||||
|
||||
InitFans();
|
||||
InitPower();
|
||||
InitBoost();
|
||||
|
||||
comboBoost.SelectedValueChanged += ComboBoost_Changed;
|
||||
|
||||
Shown += Fans_Shown;
|
||||
|
||||
Program.settingsForm.AutoPower();
|
||||
}
|
||||
|
||||
|
||||
@@ -174,13 +171,38 @@ namespace GHelper
|
||||
if (sender is null) return;
|
||||
CheckBox chk = (CheckBox)sender;
|
||||
Program.config.setConfigPerf("auto_apply_power", chk.Checked ? 1 : 0);
|
||||
|
||||
if (chk.Checked)
|
||||
{
|
||||
Program.settingsForm.AutoPower();
|
||||
}
|
||||
else
|
||||
{
|
||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
||||
Program.settingsForm.AutoFans();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void CheckAuto_Click(object? sender, EventArgs e)
|
||||
private void CheckApplyFans_Click(object? sender, EventArgs e)
|
||||
{
|
||||
if (sender is null) return;
|
||||
CheckBox chk = (CheckBox)sender;
|
||||
|
||||
Program.config.setConfigPerf("auto_apply", chk.Checked ? 1 : 0);
|
||||
|
||||
if (chk.Checked)
|
||||
{
|
||||
Program.settingsForm.AutoFans();
|
||||
}
|
||||
else
|
||||
{
|
||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
||||
Program.settingsForm.AutoPower();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void Fans_FormClosing(object? sender, FormClosingEventArgs e)
|
||||
@@ -192,11 +214,6 @@ namespace GHelper
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonApplyPower_Click(object? sender, EventArgs e)
|
||||
{
|
||||
Program.settingsForm.SetPower();
|
||||
ApplyLabel(true);
|
||||
}
|
||||
|
||||
public void InitPower(bool changed = false)
|
||||
{
|
||||
@@ -221,13 +238,11 @@ namespace GHelper
|
||||
{
|
||||
limit_total = trackTotal.Value;
|
||||
limit_cpu = trackCPU.Value;
|
||||
ApplyLabel(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
limit_total = Program.config.getConfigPerf("limit_total");
|
||||
limit_cpu = Program.config.getConfigPerf("limit_cpu");
|
||||
ApplyLabel(apply);
|
||||
}
|
||||
|
||||
if (limit_total < 0) limit_total = ASUSWmi.DefaultTotal;
|
||||
@@ -249,34 +264,16 @@ namespace GHelper
|
||||
|
||||
Program.config.setConfigPerf("limit_total", limit_total);
|
||||
Program.config.setConfigPerf("limit_cpu", limit_cpu);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void TrackTotal_Scroll(object? sender, EventArgs e)
|
||||
private void TrackPower_Scroll(object? sender, EventArgs e)
|
||||
{
|
||||
InitPower(true);
|
||||
}
|
||||
|
||||
private void TrackCPU_Scroll(object? sender, EventArgs e)
|
||||
{
|
||||
InitPower(true);
|
||||
}
|
||||
|
||||
|
||||
public void ApplyLabel(bool applied = false)
|
||||
{
|
||||
if (applied)
|
||||
{
|
||||
labelApplied.ForeColor = colorStandard;
|
||||
labelApplied.Text = "Applied";
|
||||
}
|
||||
else
|
||||
{
|
||||
labelApplied.ForeColor = colorTurbo;
|
||||
labelApplied.Text = "Not Applied";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void InitFans()
|
||||
{
|
||||
@@ -305,7 +302,7 @@ namespace GHelper
|
||||
|
||||
int auto_apply = Program.config.getConfigPerf("auto_apply");
|
||||
|
||||
checkAuto.Checked = (auto_apply == 1);
|
||||
checkApplyFans.Checked = (auto_apply == 1);
|
||||
|
||||
}
|
||||
|
||||
@@ -340,7 +337,7 @@ namespace GHelper
|
||||
|
||||
}
|
||||
|
||||
void ApplyProfile(Series series, int device)
|
||||
void SaveProfile(Series series, int device)
|
||||
{
|
||||
byte[] curve = new byte[16];
|
||||
int i = 0;
|
||||
@@ -352,19 +349,11 @@ namespace GHelper
|
||||
}
|
||||
|
||||
Program.config.setFanConfig(device, curve);
|
||||
Program.wmi.SetFanCurve(device, curve);
|
||||
//Program.wmi.SetFanCurve(device, curve);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void ButtonApply_Click(object? sender, EventArgs e)
|
||||
{
|
||||
ApplyProfile(seriesCPU, 0);
|
||||
ApplyProfile(seriesGPU, 1);
|
||||
if (Program.config.getConfig("mid_fan") == 1)
|
||||
ApplyProfile(seriesMid, 2);
|
||||
}
|
||||
|
||||
private void ButtonReset_Click(object? sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -373,21 +362,28 @@ namespace GHelper
|
||||
if (Program.config.getConfig("mid_fan") == 1)
|
||||
LoadProfile(seriesMid, 2, 1);
|
||||
|
||||
checkAuto.Checked = false;
|
||||
checkApplyFans.Checked = false;
|
||||
checkApplyPower.Checked = false;
|
||||
|
||||
Program.config.setConfigPerf("auto_apply", 0);
|
||||
Program.config.setConfigPerf("auto_apply_power", 0);
|
||||
|
||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"));
|
||||
|
||||
ApplyLabel(false);
|
||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, Program.config.getConfig("performance_mode"), "PerfMode");
|
||||
}
|
||||
|
||||
private void ChartCPU_MouseUp(object? sender, MouseEventArgs e)
|
||||
{
|
||||
curPoint = null;
|
||||
labelTip.Visible = false;
|
||||
|
||||
SaveProfile(seriesCPU, 0);
|
||||
SaveProfile(seriesGPU, 1);
|
||||
if (Program.config.getConfig("mid_fan") == 1)
|
||||
SaveProfile(seriesMid, 2);
|
||||
|
||||
Program.settingsForm.AutoFans();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void ChartCPU_MouseMove(object? sender, MouseEventArgs e)
|
||||
|
||||
@@ -16,7 +16,23 @@
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<AssemblyVersion>0.42</AssemblyVersion>
|
||||
<AssemblyVersion>0.49</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<DebugType>none</DebugType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -48,7 +64,7 @@
|
||||
<PackageReference Include="NvAPIWrapper.Net" Version="0.8.1.101" />
|
||||
<PackageReference Include="System.Management" Version="7.0.0" />
|
||||
<PackageReference Include="TaskScheduler" Version="2.10.1" />
|
||||
<PackageReference Include="WinForms.DataVisualization" Version="1.7.0" />
|
||||
<PackageReference Include="WinForms.DataVisualization" Version="1.8.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -73,6 +73,24 @@ public class AmdGpuTemperatureProvider : IGpuTemperatureProvider {
|
||||
return temperatureSensor.Value;
|
||||
}
|
||||
|
||||
|
||||
public int? GetGpuUse()
|
||||
{
|
||||
if (!IsValid)
|
||||
return null;
|
||||
|
||||
if (Adl2.NativeMethods.ADL2_New_QueryPMLogData_Get(_adlContextHandle, _internalDiscreteAdapter.AdapterIndex, out ADLPMLogDataOutput adlpmLogDataOutput) != Adl2.ADL_SUCCESS)
|
||||
return null;
|
||||
|
||||
ADLSingleSensorData gpuUsage = adlpmLogDataOutput.Sensors[(int)ADLSensorType.PMLOG_INFO_ACTIVITY_GFX];
|
||||
if (gpuUsage.Supported == 0)
|
||||
return null;
|
||||
|
||||
return gpuUsage.Value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void ReleaseUnmanagedResources() {
|
||||
if (_adlContextHandle != IntPtr.Zero) {
|
||||
Adl2.NativeMethods.ADL2_Main_Control_Destroy(_adlContextHandle);
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
public interface IGpuTemperatureProvider : IDisposable {
|
||||
bool IsValid { get; }
|
||||
int? GetCurrentTemperature();
|
||||
int? GetGpuUse();
|
||||
}
|
||||
|
||||
@@ -1,42 +1,68 @@
|
||||
using NvAPIWrapper.GPU;
|
||||
using NvAPIWrapper.Native;
|
||||
using NvAPIWrapper.Native.Exceptions;
|
||||
using NvAPIWrapper.Native.GPU;
|
||||
using NvAPIWrapper.Native.Interfaces.GPU;
|
||||
|
||||
namespace GHelper.Gpu;
|
||||
namespace GHelper.Gpu;
|
||||
|
||||
public class NvidiaGpuTemperatureProvider : IGpuTemperatureProvider {
|
||||
public class NvidiaGpuTemperatureProvider : IGpuTemperatureProvider
|
||||
{
|
||||
private readonly PhysicalGPU? _internalGpu;
|
||||
|
||||
public NvidiaGpuTemperatureProvider() {
|
||||
public NvidiaGpuTemperatureProvider()
|
||||
{
|
||||
_internalGpu = GetInternalDiscreteGpu();
|
||||
}
|
||||
|
||||
public bool IsValid => _internalGpu != null;
|
||||
|
||||
public int? GetCurrentTemperature() {
|
||||
public int? GetCurrentTemperature()
|
||||
{
|
||||
if (!IsValid)
|
||||
return null;
|
||||
|
||||
PhysicalGPU internalGpu = _internalGpu!;
|
||||
IThermalSensor? gpuSensor =
|
||||
IThermalSensor? gpuSensor =
|
||||
GPUApi.GetThermalSettings(internalGpu.Handle).Sensors
|
||||
.FirstOrDefault(s => s.Target == ThermalSettingsTarget.GPU);
|
||||
|
||||
return gpuSensor?.CurrentTemperature;
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
private static PhysicalGPU? GetInternalDiscreteGpu() {
|
||||
try {
|
||||
|
||||
private static PhysicalGPU? GetInternalDiscreteGpu()
|
||||
{
|
||||
try
|
||||
{
|
||||
return PhysicalGPU
|
||||
.GetPhysicalGPUs()
|
||||
.FirstOrDefault(gpu => gpu.SystemType == SystemType.Laptop);
|
||||
} catch {
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int? GetGpuUse()
|
||||
{
|
||||
if (!IsValid)
|
||||
return null;
|
||||
|
||||
PhysicalGPU internalGpu = _internalGpu!;
|
||||
|
||||
IUtilizationDomainInfo? gpuUsage = GPUApi.GetUsages(internalGpu.Handle).GPU;
|
||||
|
||||
if (gpuUsage == null)
|
||||
return null;
|
||||
|
||||
return
|
||||
(int)gpuUsage?.Percentage;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System.Diagnostics;
|
||||
using GHelper;
|
||||
using GHelper.Gpu;
|
||||
using System.Diagnostics;
|
||||
using System.Management;
|
||||
|
||||
public static class HardwareMonitor
|
||||
{
|
||||
@@ -9,20 +11,101 @@ public static class HardwareMonitor
|
||||
public static float? batteryDischarge = -1;
|
||||
public static int? gpuTemp = null;
|
||||
|
||||
public static string? cpuFan;
|
||||
public static string? gpuFan;
|
||||
public static string? midFan;
|
||||
|
||||
//public static List<int> gpuUsage = new List<int>();
|
||||
public static int? gpuUse;
|
||||
|
||||
public static int GetFanMax()
|
||||
{
|
||||
int max = 58;
|
||||
if (Program.config.ContainsModel("401")) max = 72;
|
||||
else if (Program.config.ContainsModel("503")) max = 68;
|
||||
return Math.Max(max, Program.config.getConfig("fan_max"));
|
||||
}
|
||||
|
||||
public static void SetFanMax(int fan)
|
||||
{
|
||||
Program.config.setConfig("fan_max", fan);
|
||||
}
|
||||
private static string FormatFan(int fan)
|
||||
{
|
||||
// fix for old models
|
||||
if (fan < 0)
|
||||
{
|
||||
fan += 65536;
|
||||
if (fan <= 0 || fan > 100) return null; //nothing reasonable
|
||||
}
|
||||
|
||||
int fanMax = GetFanMax();
|
||||
if (fan > fanMax) SetFanMax(fan);
|
||||
|
||||
if (Program.config.getConfig("fan_rpm") == 1)
|
||||
return " Fan: " + (fan * 100).ToString() + "RPM";
|
||||
else
|
||||
return " Fan: " + Math.Min(Math.Round((float)fan / fanMax * 100), 100).ToString() + "%"; // relatively to 6000 rpm
|
||||
}
|
||||
|
||||
private static int GetGpuUse()
|
||||
{
|
||||
try
|
||||
{
|
||||
int? gpuUse = GpuTemperatureProvider?.GetGpuUse();
|
||||
if (gpuUse is not null) return (int)gpuUse;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex.ToString());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public static void ReadSensors()
|
||||
{
|
||||
cpuTemp = -1;
|
||||
batteryDischarge = -1;
|
||||
gpuTemp = -1;
|
||||
gpuUse = -1;
|
||||
|
||||
try
|
||||
cpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.CPU_Fan));
|
||||
gpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.GPU_Fan));
|
||||
midFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.Mid_Fan));
|
||||
|
||||
cpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_CPU);
|
||||
|
||||
if (cpuTemp < 0) try
|
||||
{
|
||||
var ct = new PerformanceCounter("Thermal Zone Information", "Temperature", @"\_TZ.THRM", true);
|
||||
cpuTemp = ct.NextValue() - 273;
|
||||
ct.Dispose();
|
||||
} catch
|
||||
{
|
||||
Logger.WriteLine("Failed reading CPU temp");
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.WriteLine("Failed reading CPU temp");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
gpuTemp = GpuTemperatureProvider?.GetCurrentTemperature();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
gpuTemp = -1;
|
||||
Debug.WriteLine("Failed reading GPU temp");
|
||||
Debug.WriteLine(ex.ToString());
|
||||
}
|
||||
|
||||
if (gpuTemp is null || gpuTemp < 0)
|
||||
gpuTemp = Program.wmi.DeviceGet(ASUSWmi.Temp_GPU);
|
||||
|
||||
/*
|
||||
gpuUsage.Add(GetGpuUse());
|
||||
if (gpuUsage.Count > 3) gpuUsage.RemoveAt(0);
|
||||
*/
|
||||
|
||||
try
|
||||
{
|
||||
@@ -30,27 +113,25 @@ public static class HardwareMonitor
|
||||
batteryDischarge = cb.NextValue() / 1000;
|
||||
cb.Dispose();
|
||||
|
||||
} catch
|
||||
{
|
||||
Logger.WriteLine("Failed reading Battery discharge");
|
||||
}
|
||||
|
||||
try
|
||||
catch
|
||||
{
|
||||
gpuTemp = GpuTemperatureProvider?.GetCurrentTemperature();
|
||||
} catch (Exception ex) {
|
||||
gpuTemp = null;
|
||||
Logger.WriteLine("Failed reading GPU temp");
|
||||
Logger.WriteLine(ex.ToString());
|
||||
Debug.WriteLine("Failed reading Battery discharge");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void RecreateGpuTemperatureProviderWithDelay() {
|
||||
public static bool IsUsedGPU(int threshold = 50)
|
||||
{
|
||||
return (GetGpuUse() > threshold);
|
||||
}
|
||||
|
||||
public static void RecreateGpuTemperatureProviderWithDelay()
|
||||
{
|
||||
|
||||
// Re-enabling the discrete GPU takes a bit of time,
|
||||
// so a simple workaround is to refresh again after that happens
|
||||
Task.Run(async () => {
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromSeconds(5));
|
||||
RecreateGpuTemperatureProvider();
|
||||
});
|
||||
@@ -59,7 +140,8 @@ public static class HardwareMonitor
|
||||
|
||||
}
|
||||
|
||||
public static void RecreateGpuTemperatureProvider() {
|
||||
public static void RecreateGpuTemperatureProvider()
|
||||
{
|
||||
try
|
||||
{
|
||||
GpuTemperatureProvider?.Dispose();
|
||||
@@ -86,8 +168,8 @@ public static class HardwareMonitor
|
||||
GpuTemperatureProvider = null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
{
|
||||
Debug.WriteLine(ex.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CustomControls;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace GHelper
|
||||
{
|
||||
@@ -98,6 +99,16 @@ namespace GHelper
|
||||
private void CheckKeyboardAuto_CheckedChanged(object? sender, EventArgs e)
|
||||
{
|
||||
Program.config.setConfig("keyboard_auto", (checkKeyboardAuto.Checked ? 1 : 0));
|
||||
|
||||
/*
|
||||
RegistryKey myKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\ASUS\\ASUS System Control Interface\\AsusOptimization\\ASUS Keyboard Hotkeys", true);
|
||||
if (myKey != null)
|
||||
{
|
||||
myKey.SetValue("TurnOffKeybdLight", 30, RegistryValueKind.DWord);
|
||||
myKey.Close();
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
private void CheckTopmost_CheckedChanged(object? sender, EventArgs e)
|
||||
|
||||
@@ -1,12 +1,53 @@
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
using System.Xml.Linq;
|
||||
using static Tools.ScreenInterrogatory;
|
||||
|
||||
namespace Tools
|
||||
{
|
||||
|
||||
public class KeyHandler
|
||||
{
|
||||
|
||||
public const int NOMOD = 0x0000;
|
||||
public const int ALT = 0x0001;
|
||||
public const int CTRL = 0x0002;
|
||||
public const int SHIFT = 0x0004;
|
||||
public const int WIN = 0x0008;
|
||||
|
||||
public const int WM_HOTKEY_MSG_ID = 0x0312;
|
||||
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vk);
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool UnregisterHotKey(IntPtr hWnd, int id);
|
||||
|
||||
private int modifier;
|
||||
private int key;
|
||||
private IntPtr hWnd;
|
||||
private int id;
|
||||
public KeyHandler(int modifier, Keys key, nint handle)
|
||||
{
|
||||
this.modifier = modifier;
|
||||
this.key = (int)key;
|
||||
this.hWnd = handle;
|
||||
id = this.GetHashCode();
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return modifier ^ key ^ hWnd.ToInt32();
|
||||
}
|
||||
public bool Register()
|
||||
{
|
||||
return RegisterHotKey(hWnd, id, modifier, key);
|
||||
}
|
||||
public bool Unregiser()
|
||||
{
|
||||
return UnregisterHotKey(hWnd, id);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ScreenInterrogatory
|
||||
{
|
||||
public const int ERROR_SUCCESS = 0;
|
||||
@@ -608,7 +649,8 @@ public class NativeMethods
|
||||
if (dm.dmDisplayFrequency > frequency) frequency = dm.dmDisplayFrequency;
|
||||
i++;
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (0 != NativeMethods.EnumDisplaySettingsEx(laptopScreen, NativeMethods.ENUM_CURRENT_SETTINGS, ref dm))
|
||||
{
|
||||
@@ -632,6 +674,7 @@ public class NativeMethods
|
||||
{
|
||||
dm.dmDisplayFrequency = frequency;
|
||||
int iRet = NativeMethods.ChangeDisplaySettingsEx(laptopScreen, ref dm, IntPtr.Zero, DisplaySettingsFlags.CDS_UPDATEREGISTRY, IntPtr.Zero);
|
||||
Logger.WriteLine("Screen = " + frequency.ToString() + "Hz : " + (iRet == 0 ? "OK" : iRet));
|
||||
return iRet;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
using Microsoft.Win32;
|
||||
using System.Diagnostics;
|
||||
using System.Management;
|
||||
using Tools;
|
||||
|
||||
namespace GHelper
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
|
||||
|
||||
public static NotifyIcon trayIcon = new NotifyIcon
|
||||
{
|
||||
Text = "G-Helper",
|
||||
@@ -15,7 +14,7 @@ namespace GHelper
|
||||
Visible = true
|
||||
};
|
||||
|
||||
public static ASUSWmi wmi;
|
||||
public static ASUSWmi? wmi;
|
||||
public static AppConfig config = new AppConfig();
|
||||
|
||||
public static SettingsForm settingsForm = new SettingsForm();
|
||||
@@ -56,30 +55,37 @@ namespace GHelper
|
||||
|
||||
}
|
||||
|
||||
Logger.WriteLine("------------");
|
||||
Logger.WriteLine("App launched: " + config.GetModel());
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
|
||||
SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(SystemEvents_UserPreferenceChanged);
|
||||
|
||||
var ds = settingsForm.Handle;
|
||||
|
||||
trayIcon.MouseClick += TrayIcon_MouseClick;
|
||||
|
||||
|
||||
wmi.SubscribeToEvents(WatcherEventArrived);
|
||||
|
||||
settingsForm.InitGPUMode();
|
||||
settingsForm.InitAura();
|
||||
settingsForm.InitMatrix();
|
||||
|
||||
settingsForm.SetStartupCheck(Startup.IsScheduled());
|
||||
|
||||
SetAutoModes();
|
||||
|
||||
HardwareMonitor.RecreateGpuTemperatureProvider();
|
||||
|
||||
// Subscribing for system power change events
|
||||
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
||||
SystemEvents.UserPreferenceChanged += SystemEvents_UserPreferenceChanged;
|
||||
|
||||
// Subscribing for monitor power on events
|
||||
var settingGuid = new NativeMethods.PowerSettingGuid();
|
||||
unRegPowerNotify = NativeMethods.RegisterPowerSettingNotification(ds, settingGuid.ConsoleDisplayState, NativeMethods.DEVICE_NOTIFY_WINDOW_HANDLE);
|
||||
|
||||
// CTRL + SHIFT + F5 to cycle profiles
|
||||
var ghk = new KeyHandler(KeyHandler.SHIFT | KeyHandler.CTRL, Keys.F5, ds);
|
||||
ghk.Register();
|
||||
|
||||
if (Environment.CurrentDirectory.Trim('\\') == Application.StartupPath.Trim('\\'))
|
||||
{
|
||||
@@ -96,14 +102,16 @@ namespace GHelper
|
||||
{
|
||||
|
||||
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastTheme) < 2000) return;
|
||||
lastTheme = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
|
||||
switch (e.Category)
|
||||
{
|
||||
case UserPreferenceCategory.General:
|
||||
Debug.WriteLine("Theme Changed");
|
||||
Thread.Sleep(1000);
|
||||
settingsForm.InitTheme();
|
||||
bool changed = settingsForm.InitTheme();
|
||||
if (changed)
|
||||
{
|
||||
Debug.WriteLine("Theme Changed");
|
||||
lastTheme = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
}
|
||||
|
||||
if (settingsForm.fans is not null && settingsForm.fans.Text != "")
|
||||
settingsForm.fans.InitTheme();
|
||||
@@ -130,8 +138,14 @@ namespace GHelper
|
||||
settingsForm.AutoPerformance();
|
||||
|
||||
bool switched = settingsForm.AutoGPUMode();
|
||||
if (!switched) settingsForm.AutoScreen();
|
||||
|
||||
if (!switched)
|
||||
{
|
||||
settingsForm.InitGPUMode();
|
||||
settingsForm.AutoScreen();
|
||||
}
|
||||
|
||||
settingsForm.AutoKeyboard();
|
||||
settingsForm.SetMatrix();
|
||||
}
|
||||
|
||||
@@ -140,7 +154,6 @@ namespace GHelper
|
||||
if (SystemInformation.PowerStatus.PowerLineStatus == isPlugged) return;
|
||||
|
||||
Logger.WriteLine("Windows - Power Mode Changed");
|
||||
settingsForm.AutoKeyboard();
|
||||
SetAutoModes();
|
||||
}
|
||||
|
||||
@@ -157,7 +170,7 @@ namespace GHelper
|
||||
}
|
||||
catch
|
||||
{
|
||||
Logger.WriteLine("Failed to run " + fileName);
|
||||
Logger.WriteLine("Failed to run " + fileName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
16
app/Settings.Designer.cs
generated
16
app/Settings.Designer.cs
generated
@@ -163,7 +163,7 @@ namespace GHelper
|
||||
// comboMatrix
|
||||
//
|
||||
comboMatrix.BorderColor = Color.White;
|
||||
comboMatrix.ButtonColor = SystemColors.ControlLight;
|
||||
comboMatrix.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||
comboMatrix.Dock = DockStyle.Top;
|
||||
comboMatrix.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
comboMatrix.FormattingEnabled = true;
|
||||
@@ -179,7 +179,7 @@ namespace GHelper
|
||||
// comboMatrixRunning
|
||||
//
|
||||
comboMatrixRunning.BorderColor = Color.White;
|
||||
comboMatrixRunning.ButtonColor = SystemColors.ControlLight;
|
||||
comboMatrixRunning.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||
comboMatrixRunning.Dock = DockStyle.Top;
|
||||
comboMatrixRunning.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
comboMatrixRunning.FormattingEnabled = true;
|
||||
@@ -195,7 +195,7 @@ namespace GHelper
|
||||
// buttonMatrix
|
||||
//
|
||||
buttonMatrix.Activated = false;
|
||||
buttonMatrix.BackColor = Color.FromArgb(230, 230, 230);
|
||||
buttonMatrix.BackColor = SystemColors.ControlLight;
|
||||
buttonMatrix.BorderColor = Color.Transparent;
|
||||
buttonMatrix.BorderRadius = 2;
|
||||
buttonMatrix.Dock = DockStyle.Top;
|
||||
@@ -335,7 +335,7 @@ namespace GHelper
|
||||
//
|
||||
buttonQuit.Activated = false;
|
||||
buttonQuit.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||
buttonQuit.BackColor = Color.FromArgb(230, 230, 230);
|
||||
buttonQuit.BackColor = SystemColors.ControlLight;
|
||||
buttonQuit.BorderColor = Color.Transparent;
|
||||
buttonQuit.BorderRadius = 2;
|
||||
buttonQuit.FlatStyle = FlatStyle.Flat;
|
||||
@@ -503,7 +503,7 @@ namespace GHelper
|
||||
// buttonFans
|
||||
//
|
||||
buttonFans.Activated = false;
|
||||
buttonFans.BackColor = Color.FromArgb(230, 230, 230);
|
||||
buttonFans.BackColor = SystemColors.ControlLight;
|
||||
buttonFans.BorderColor = Color.Transparent;
|
||||
buttonFans.BorderRadius = 5;
|
||||
buttonFans.Dock = DockStyle.Fill;
|
||||
@@ -826,7 +826,7 @@ namespace GHelper
|
||||
buttonMiniled.Secondary = false;
|
||||
buttonMiniled.Size = new Size(185, 72);
|
||||
buttonMiniled.TabIndex = 3;
|
||||
buttonMiniled.Text = "Miniled";
|
||||
buttonMiniled.Text = "Multizone";
|
||||
buttonMiniled.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// pictureScreen
|
||||
@@ -890,7 +890,7 @@ namespace GHelper
|
||||
// comboKeyboard
|
||||
//
|
||||
comboKeyboard.BorderColor = Color.White;
|
||||
comboKeyboard.ButtonColor = SystemColors.ControlLight;
|
||||
comboKeyboard.ButtonColor = Color.FromArgb(255, 255, 255);
|
||||
comboKeyboard.Dock = DockStyle.Top;
|
||||
comboKeyboard.FlatStyle = FlatStyle.Flat;
|
||||
comboKeyboard.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||
@@ -958,7 +958,7 @@ namespace GHelper
|
||||
// buttonKeyboard
|
||||
//
|
||||
buttonKeyboard.Activated = false;
|
||||
buttonKeyboard.BackColor = Color.FromArgb(230, 230, 230);
|
||||
buttonKeyboard.BackColor = SystemColors.ControlLight;
|
||||
buttonKeyboard.BorderColor = Color.Transparent;
|
||||
buttonKeyboard.BorderRadius = 2;
|
||||
buttonKeyboard.Dock = DockStyle.Top;
|
||||
|
||||
254
app/Settings.cs
254
app/Settings.cs
@@ -2,10 +2,10 @@
|
||||
using Starlight.AnimeMatrix;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
using System.Timers;
|
||||
using Tools;
|
||||
|
||||
namespace GHelper
|
||||
{
|
||||
@@ -26,9 +26,11 @@ namespace GHelper
|
||||
public Keyboard keyb;
|
||||
|
||||
static AnimeMatrixDevice mat;
|
||||
static int matrixTick = 0;
|
||||
static long lastRefresh;
|
||||
|
||||
private bool customFans = false;
|
||||
private int customPower = 0;
|
||||
|
||||
public SettingsForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -118,13 +120,9 @@ namespace GHelper
|
||||
sliderBattery.ValueChanged += SliderBattery_ValueChanged;
|
||||
Program.trayIcon.MouseMove += TrayIcon_MouseMove;
|
||||
|
||||
aTimer = new System.Timers.Timer(500);
|
||||
aTimer = new System.Timers.Timer(1000);
|
||||
aTimer.Elapsed += OnTimedEvent;
|
||||
|
||||
// Subscribing for monitor power on events
|
||||
var settingGuid = new NativeMethods.PowerSettingGuid();
|
||||
Program.unRegPowerNotify = NativeMethods.RegisterPowerSettingNotification(Handle, settingGuid.ConsoleDisplayState, NativeMethods.DEVICE_NOTIFY_WINDOW_HANDLE);
|
||||
|
||||
SetVersionLabel("Version: " + Assembly.GetExecutingAssembly().GetName().Version);
|
||||
|
||||
string model = Program.config.GetModel();
|
||||
@@ -137,7 +135,7 @@ namespace GHelper
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromSeconds(5));
|
||||
await Task.Delay(TimeSpan.FromSeconds(1));
|
||||
CheckForUpdatesAsync();
|
||||
});
|
||||
|
||||
@@ -191,13 +189,13 @@ namespace GHelper
|
||||
|
||||
private static void TrayIcon_MouseMove(object? sender, MouseEventArgs e)
|
||||
{
|
||||
RefreshSensors();
|
||||
Program.settingsForm.RefreshSensors();
|
||||
}
|
||||
|
||||
|
||||
private static void OnTimedEvent(Object? source, ElapsedEventArgs? e)
|
||||
{
|
||||
RefreshSensors();
|
||||
Program.settingsForm.RefreshSensors();
|
||||
}
|
||||
|
||||
private void Button120Hz_MouseHover(object? sender, EventArgs e)
|
||||
@@ -277,10 +275,7 @@ namespace GHelper
|
||||
break;
|
||||
case 1:
|
||||
Logger.WriteLine("Monitor Power On");
|
||||
Program.settingsForm.BeginInvoke(delegate
|
||||
{
|
||||
Program.SetAutoModes();
|
||||
});
|
||||
Program.SetAutoModes();
|
||||
break;
|
||||
case 2:
|
||||
Logger.WriteLine("Monitor Dimmed");
|
||||
@@ -289,6 +284,9 @@ namespace GHelper
|
||||
}
|
||||
m.Result = (IntPtr)1;
|
||||
break;
|
||||
case KeyHandler.WM_HOTKEY_MSG_ID:
|
||||
CyclePerformanceMode();
|
||||
break;
|
||||
}
|
||||
base.WndProc(ref m);
|
||||
}
|
||||
@@ -354,29 +352,7 @@ namespace GHelper
|
||||
mat.PresentNextFrame();
|
||||
break;
|
||||
case 3:
|
||||
string format1, format2;
|
||||
if (CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern.Contains("H"))
|
||||
{
|
||||
format1 = "H:mm";
|
||||
format2 = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
format1 = "h:mm";
|
||||
format2 = "tt";
|
||||
}
|
||||
|
||||
if (matrixTick > 0)
|
||||
{
|
||||
format1 = format1.Replace(":", " ");
|
||||
matrixTick = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
matrixTick++;
|
||||
}
|
||||
|
||||
mat.PresentText(DateTime.Now.ToString(format1), DateTime.Now.ToString(format2));
|
||||
mat.PresentClock();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -716,19 +692,18 @@ namespace GHelper
|
||||
if (frequency > 0)
|
||||
{
|
||||
NativeMethods.SetRefreshRate(frequency);
|
||||
Logger.WriteLine("Screen " + frequency.ToString() + "Hz");
|
||||
}
|
||||
|
||||
if (overdrive >= 0)
|
||||
{
|
||||
if (Program.config.getConfig("no_overdrive") == 1) overdrive = 0;
|
||||
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive);
|
||||
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive, "ScreenOverdrive");
|
||||
|
||||
}
|
||||
|
||||
if (miniled >= 0)
|
||||
{
|
||||
Program.wmi.DeviceSet(ASUSWmi.ScreenMiniled, miniled);
|
||||
Program.wmi.DeviceSet(ASUSWmi.ScreenMiniled, miniled, "Miniled");
|
||||
Debug.WriteLine("Miniled " + miniled);
|
||||
}
|
||||
|
||||
@@ -746,7 +721,6 @@ namespace GHelper
|
||||
bool overdriveSetting = (Program.config.getConfig("no_overdrive") != 1);
|
||||
|
||||
int overdrive = Program.wmi.DeviceGet(ASUSWmi.ScreenOverdrive);
|
||||
|
||||
int miniled = Program.wmi.DeviceGet(ASUSWmi.ScreenMiniled);
|
||||
|
||||
bool screenEnabled = (frequency >= 0);
|
||||
@@ -828,26 +802,12 @@ namespace GHelper
|
||||
}
|
||||
|
||||
|
||||
private static string FormatFan(int fan)
|
||||
{
|
||||
if (fan < 0) return null;
|
||||
|
||||
if (Program.config.getConfig("fan_rpm") == 1)
|
||||
return " Fan: " + (fan * 100).ToString() + "RPM";
|
||||
else
|
||||
return " Fan: " + Math.Min(Math.Round(fan / 0.6), 100).ToString() + "%"; // relatively to 6000 rpm
|
||||
}
|
||||
|
||||
private static void RefreshSensors(bool force = false)
|
||||
private void RefreshSensors(bool force = false)
|
||||
{
|
||||
|
||||
if (!force && Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastRefresh) < 2000) return;
|
||||
lastRefresh = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||
|
||||
string cpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.CPU_Fan));
|
||||
string gpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.GPU_Fan));
|
||||
string midFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.Mid_Fan));
|
||||
|
||||
string cpuTemp = "";
|
||||
string gpuTemp = "";
|
||||
string battery = "";
|
||||
@@ -855,26 +815,31 @@ namespace GHelper
|
||||
HardwareMonitor.ReadSensors();
|
||||
|
||||
if (HardwareMonitor.cpuTemp > 0)
|
||||
cpuTemp = ": " + Math.Round((decimal)HardwareMonitor.cpuTemp).ToString() + "°C - ";
|
||||
cpuTemp = ": " + Math.Round((decimal)HardwareMonitor.cpuTemp).ToString() + "°C ";
|
||||
|
||||
if (HardwareMonitor.batteryDischarge > 0)
|
||||
battery = "Discharging: " + Math.Round((decimal)HardwareMonitor.batteryDischarge, 1).ToString() + "W";
|
||||
|
||||
if (HardwareMonitor.gpuTemp != null)
|
||||
if (HardwareMonitor.gpuTemp > 0)
|
||||
{
|
||||
gpuTemp = $": {HardwareMonitor.gpuTemp}°C - ";
|
||||
gpuTemp = $": {HardwareMonitor.gpuTemp}°C ";
|
||||
}
|
||||
|
||||
Program.settingsForm.BeginInvoke(delegate
|
||||
{
|
||||
Program.settingsForm.labelCPUFan.Text = "CPU" + cpuTemp + cpuFan;
|
||||
Program.settingsForm.labelGPUFan.Text = "GPU" + gpuTemp + gpuFan;
|
||||
if (midFan is not null) Program.settingsForm.labelMidFan.Text = "Mid" + midFan;
|
||||
Program.settingsForm.labelBattery.Text = battery;
|
||||
|
||||
Program.trayIcon.Text = "CPU" + cpuTemp + cpuFan + "\n" + "GPU" + gpuTemp + gpuFan + ((battery.Length > 0) ? ("\n" + battery) : "");
|
||||
labelCPUFan.Text = "CPU" + cpuTemp + HardwareMonitor.cpuFan;
|
||||
labelGPUFan.Text = "GPU" + gpuTemp + HardwareMonitor.gpuFan;
|
||||
if (HardwareMonitor.midFan is not null)
|
||||
labelMidFan.Text = "Mid" + HardwareMonitor.midFan;
|
||||
|
||||
labelBattery.Text = battery;
|
||||
});
|
||||
|
||||
|
||||
Program.trayIcon.Text = "CPU" + cpuTemp + HardwareMonitor.cpuFan + "\n"
|
||||
+ "GPU" + gpuTemp + HardwareMonitor.gpuFan +
|
||||
((battery.Length > 0) ? ("\n" + battery) : "");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -888,10 +853,7 @@ namespace GHelper
|
||||
this.Top = Screen.FromControl(this).WorkingArea.Height - 10 - this.Height;
|
||||
this.Activate();
|
||||
|
||||
aTimer.Interval = 300;
|
||||
aTimer.Enabled = true;
|
||||
|
||||
//RefreshSensors();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -899,6 +861,12 @@ namespace GHelper
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void SetPerformanceLabel()
|
||||
{
|
||||
labelPerf.Text = "Performance Mode" + (customFans?"+":"") + ((customPower > 0) ? " "+customPower+"W" : "");
|
||||
}
|
||||
|
||||
public void SetPower()
|
||||
{
|
||||
int limit_total = Program.config.getConfigPerf("limit_total");
|
||||
@@ -911,57 +879,80 @@ namespace GHelper
|
||||
if (limit_cpu < ASUSWmi.MinCPU) return;
|
||||
|
||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_TotalA0) >= 0)
|
||||
Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA0, limit_total);
|
||||
{
|
||||
Program.wmi.DeviceSet(ASUSWmi.PPT_TotalA0, limit_total, "PowerLimit A");
|
||||
customPower = limit_total;
|
||||
}
|
||||
|
||||
if (Program.wmi.DeviceGet(ASUSWmi.PPT_CPUB0) >= 0)
|
||||
Program.wmi.DeviceSet(ASUSWmi.PPT_CPUB0, limit_cpu);
|
||||
|
||||
Logger.WriteLine("PowerLimits " + limit_total.ToString() + ", " + limit_cpu.ToString());
|
||||
{
|
||||
Program.wmi.DeviceSet(ASUSWmi.PPT_CPUB0, limit_cpu, "PowerLimit B");
|
||||
customPower = limit_cpu;
|
||||
}
|
||||
|
||||
Program.settingsForm.BeginInvoke(SetPerformanceLabel);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void AutoFansAndPower()
|
||||
public void AutoFans()
|
||||
{
|
||||
customFans = false;
|
||||
|
||||
if (Program.config.getConfigPerf("auto_apply") == 1)
|
||||
{
|
||||
Program.wmi.SetFanCurve(0, Program.config.getFanConfig(0));
|
||||
Program.wmi.SetFanCurve(1, Program.config.getFanConfig(1));
|
||||
int cpuResult = Program.wmi.SetFanCurve(0, Program.config.getFanConfig(0));
|
||||
int gpuResult = Program.wmi.SetFanCurve(1, Program.config.getFanConfig(1));
|
||||
|
||||
if (Program.config.getConfig("mid_fan") == 1)
|
||||
Program.wmi.SetFanCurve(2, Program.config.getFanConfig(2));
|
||||
|
||||
labelPerf.Text = "Performance Mode+";
|
||||
if (cpuResult != 1 || gpuResult != 1) // something went wrong, resetting to default profile
|
||||
{
|
||||
int mode = Program.config.getConfig("performance_mode");
|
||||
Logger.WriteLine("Driver rejected fan curve, resetting mode to " + mode);
|
||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, mode, "PerformanceMode");
|
||||
}
|
||||
else customFans = true;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
labelPerf.Text = "Performance Mode";
|
||||
}
|
||||
Program.settingsForm.BeginInvoke(SetPerformanceLabel);
|
||||
|
||||
}
|
||||
|
||||
public void AutoPower(int delay = 0)
|
||||
{
|
||||
|
||||
customPower = 0;
|
||||
|
||||
if (Program.config.getConfigPerf("auto_apply_power") == 1)
|
||||
{
|
||||
var timer = new System.Timers.Timer(1000);
|
||||
timer.Elapsed += delegate
|
||||
if (delay > 0)
|
||||
{
|
||||
var timer = new System.Timers.Timer(1000);
|
||||
timer.Elapsed += delegate
|
||||
{
|
||||
timer.Stop();
|
||||
timer.Dispose();
|
||||
SetPower();
|
||||
};
|
||||
timer.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
timer.Stop();
|
||||
timer.Dispose();
|
||||
SetPower();
|
||||
};
|
||||
timer.Start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (Program.config.getConfigPerf("auto_boost") != -1)
|
||||
{
|
||||
NativeMethods.SetCPUBoost(Program.config.getConfigPerf("auto_boost"));
|
||||
}
|
||||
}
|
||||
|
||||
public void SetPerformanceMode(int PerformanceMode = ASUSWmi.PerformanceBalanced, bool notify = false)
|
||||
|
||||
public void SetPerformanceMode(int PerformanceMode = -1, bool notify = false)
|
||||
{
|
||||
|
||||
if (PerformanceMode < 0)
|
||||
PerformanceMode = Program.config.getConfig("performance_mode");
|
||||
|
||||
buttonSilent.Activated = false;
|
||||
buttonBalanced.Activated = false;
|
||||
@@ -988,8 +979,7 @@ namespace GHelper
|
||||
Program.config.setConfig("performance_" + (int)SystemInformation.PowerStatus.PowerLineStatus, PerformanceMode);
|
||||
Program.config.setConfig("performance_mode", PerformanceMode);
|
||||
|
||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, PerformanceMode);
|
||||
Logger.WriteLine("PerfMode " + perfName + " " + PerformanceMode);
|
||||
Program.wmi.DeviceSet(ASUSWmi.PerformanceMode, PerformanceMode, "PerformanceMode");
|
||||
|
||||
if (notify && (oldMode != PerformanceMode))
|
||||
{
|
||||
@@ -1003,7 +993,13 @@ namespace GHelper
|
||||
}
|
||||
}
|
||||
|
||||
AutoFansAndPower();
|
||||
AutoFans();
|
||||
AutoPower(1000);
|
||||
|
||||
if (Program.config.getConfigPerf("auto_boost") != -1)
|
||||
{
|
||||
NativeMethods.SetCPUBoost(Program.config.getConfigPerf("auto_boost"));
|
||||
}
|
||||
|
||||
NativeMethods.SetPowerScheme(PerformanceMode);
|
||||
|
||||
@@ -1018,15 +1014,19 @@ namespace GHelper
|
||||
fans.InitPower();
|
||||
fans.InitBoost();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void CyclePerformanceMode()
|
||||
{
|
||||
SetPerformanceMode(Program.config.getConfig("performance_mode") + 1, true);
|
||||
int mode = Program.config.getConfig("performance_mode");
|
||||
|
||||
if (Control.ModifierKeys == Keys.Shift)
|
||||
mode = (mode == 0) ? 2 : mode - 1;
|
||||
else
|
||||
mode++;
|
||||
|
||||
SetPerformanceMode(mode, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -1035,9 +1035,11 @@ namespace GHelper
|
||||
if (Program.config.getConfig("keyboard_auto") != 1) return;
|
||||
|
||||
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
|
||||
Program.wmi.DeviceSet(ASUSWmi.UniversalControl, ASUSWmi.KB_Light_Up);
|
||||
Aura.ApplyBrightness(3);
|
||||
//Program.wmi.DeviceSet(ASUSWmi.UniversalControl, ASUSWmi.KB_Light_Up);
|
||||
else
|
||||
Program.wmi.DeviceSet(ASUSWmi.UniversalControl, ASUSWmi.KB_Light_Down);
|
||||
Aura.ApplyBrightness(0);
|
||||
//Program.wmi.DeviceSet(ASUSWmi.UniversalControl, ASUSWmi.KB_Light_Down);
|
||||
|
||||
|
||||
}
|
||||
@@ -1072,7 +1074,11 @@ namespace GHelper
|
||||
var Plugged = SystemInformation.PowerStatus.PowerLineStatus;
|
||||
|
||||
bool GpuAuto = Program.config.getConfig("gpu_auto") == 1;
|
||||
if (!GpuAuto) return false;
|
||||
bool ForceGPU = Program.config.ContainsModel("503");
|
||||
|
||||
int GpuMode = Program.config.getConfig("gpu_mode");
|
||||
|
||||
if (!GpuAuto && !ForceGPU) return false;
|
||||
|
||||
int eco = Program.wmi.DeviceGet(ASUSWmi.GPUEco);
|
||||
int mux = Program.wmi.DeviceGet(ASUSWmi.GPUMux);
|
||||
@@ -1081,16 +1087,25 @@ namespace GHelper
|
||||
return false;
|
||||
else
|
||||
{
|
||||
if (eco == 1 && Plugged == PowerLineStatus.Online) // Eco going Standard on plugged
|
||||
{
|
||||
SetEcoGPU(0);
|
||||
return true;
|
||||
}
|
||||
else if (eco == 0 && Plugged != PowerLineStatus.Online) // Standard going Eco on plugged
|
||||
{
|
||||
SetEcoGPU(1);
|
||||
return true;
|
||||
}
|
||||
if (eco == 1)
|
||||
if ((GpuAuto && Plugged == PowerLineStatus.Online) || (ForceGPU && GpuMode == ASUSWmi.GPUModeStandard))
|
||||
{
|
||||
SetEcoGPU(0);
|
||||
return true;
|
||||
}
|
||||
if (eco == 0)
|
||||
if ((GpuAuto && Plugged != PowerLineStatus.Online) || (ForceGPU && GpuMode == ASUSWmi.GPUModeEco))
|
||||
{
|
||||
|
||||
if (HardwareMonitor.IsUsedGPU())
|
||||
{
|
||||
DialogResult dialogResult = MessageBox.Show("Your dGPU seem to be in heavy use, disable it?", "Eco Mode", MessageBoxButtons.YesNo);
|
||||
if (dialogResult == DialogResult.No) return false;
|
||||
}
|
||||
|
||||
SetEcoGPU(1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -1119,6 +1134,9 @@ namespace GHelper
|
||||
int eco = Program.wmi.DeviceGet(ASUSWmi.GPUEco);
|
||||
int mux = Program.wmi.DeviceGet(ASUSWmi.GPUMux);
|
||||
|
||||
Logger.WriteLine("Eco flag : " + eco);
|
||||
Logger.WriteLine("Mux flag : " + mux);
|
||||
|
||||
int GpuMode;
|
||||
|
||||
if (mux == 0)
|
||||
@@ -1169,12 +1187,12 @@ namespace GHelper
|
||||
foreach (var process in Process.GetProcessesByName(kill)) process.Kill();
|
||||
}
|
||||
|
||||
Program.wmi.DeviceSet(ASUSWmi.GPUEco, eco);
|
||||
Program.wmi.DeviceSet(ASUSWmi.GPUEco, eco, "GPUEco");
|
||||
|
||||
Program.settingsForm.BeginInvoke(delegate
|
||||
{
|
||||
InitGPUMode();
|
||||
HardwareMonitor.RecreateGpuTemperatureProviderWithDelay();
|
||||
Thread.Sleep(500);
|
||||
InitGPUMode();
|
||||
AutoScreen();
|
||||
});
|
||||
});
|
||||
@@ -1203,7 +1221,7 @@ namespace GHelper
|
||||
DialogResult dialogResult = MessageBox.Show("Switching off Ultimate Mode requires restart", "Reboot now?", MessageBoxButtons.YesNo);
|
||||
if (dialogResult == DialogResult.Yes)
|
||||
{
|
||||
Program.wmi.DeviceSet(ASUSWmi.GPUMux, 1);
|
||||
Program.wmi.DeviceSet(ASUSWmi.GPUMux, 1, "GPUMux");
|
||||
restart = true;
|
||||
changed = true;
|
||||
}
|
||||
@@ -1213,7 +1231,7 @@ namespace GHelper
|
||||
DialogResult dialogResult = MessageBox.Show("Ultimate Mode requires restart", "Reboot now?", MessageBoxButtons.YesNo);
|
||||
if (dialogResult == DialogResult.Yes)
|
||||
{
|
||||
Program.wmi.DeviceSet(ASUSWmi.GPUMux, 0);
|
||||
Program.wmi.DeviceSet(ASUSWmi.GPUMux, 0, "GPUMux");
|
||||
restart = true;
|
||||
changed = true;
|
||||
}
|
||||
@@ -1329,7 +1347,7 @@ namespace GHelper
|
||||
labelBatteryTitle.Text = "Battery Charge Limit: " + limit.ToString() + "%";
|
||||
sliderBattery.Value = limit;
|
||||
|
||||
Program.wmi.DeviceSet(ASUSWmi.BatteryLimit, limit);
|
||||
Program.wmi.DeviceSet(ASUSWmi.BatteryLimit, limit, "BatteryLimit");
|
||||
Program.config.setConfig("charge_limit", limit);
|
||||
|
||||
}
|
||||
|
||||
@@ -22,31 +22,43 @@ public class Startup
|
||||
|
||||
var userId = WindowsIdentity.GetCurrent().Name;
|
||||
|
||||
TaskDefinition td = TaskService.Instance.NewTask();
|
||||
td.RegistrationInfo.Description = "GHelper Auto Start";
|
||||
td.Triggers.Add(new LogonTrigger { UserId = userId });
|
||||
td.Actions.Add(strExeFilePath);
|
||||
|
||||
td.Settings.StopIfGoingOnBatteries = false;
|
||||
td.Settings.DisallowStartIfOnBatteries = false;
|
||||
td.Settings.ExecutionTimeLimit = TimeSpan.Zero;
|
||||
|
||||
Debug.WriteLine(strExeFilePath);
|
||||
Debug.WriteLine(userId);
|
||||
|
||||
try
|
||||
using (TaskDefinition td = TaskService.Instance.NewTask())
|
||||
{
|
||||
TaskService.Instance.RootFolder.RegisterTaskDefinition(taskName, td);
|
||||
} catch (Exception e)
|
||||
{
|
||||
MessageBox.Show(e.ToString(), "Scheduler Error", MessageBoxButtons.OK);
|
||||
td.RegistrationInfo.Description = "G-Helper Auto Start";
|
||||
td.Triggers.Add(new LogonTrigger { UserId = userId });
|
||||
td.Actions.Add(strExeFilePath);
|
||||
|
||||
td.Settings.StopIfGoingOnBatteries = false;
|
||||
td.Settings.DisallowStartIfOnBatteries = false;
|
||||
td.Settings.ExecutionTimeLimit = TimeSpan.Zero;
|
||||
|
||||
Debug.WriteLine(strExeFilePath);
|
||||
Debug.WriteLine(userId);
|
||||
|
||||
try
|
||||
{
|
||||
TaskService.Instance.RootFolder.RegisterTaskDefinition(taskName, td);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show("Can't create a start up task. Try running Task Scheduler by hand and manually deleting GHelper task if it exists there.", "Scheduler Error", MessageBoxButtons.OK);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void UnSchedule()
|
||||
{
|
||||
TaskService taskService = new TaskService();
|
||||
taskService.RootFolder.DeleteTask(taskName);
|
||||
using (TaskService taskService = new TaskService())
|
||||
{
|
||||
try
|
||||
{
|
||||
taskService.RootFolder.DeleteTask(taskName);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show("Can't remove task. Try running Task Scheduler by hand and manually deleting GHelper task if it exists there.", "Scheduler Error", MessageBoxButtons.OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
19
bloat.bat
Normal file
19
bloat.bat
Normal file
@@ -0,0 +1,19 @@
|
||||
sc config AsusAppService start= auto
|
||||
sc config ASUSLinkNear start= auto
|
||||
sc config ASUSLinkRemote start= auto
|
||||
sc config ASUSSoftwareManager start= auto
|
||||
sc config ASUSSwitch start= auto
|
||||
sc config ASUSSystemAnalysis start= auto
|
||||
sc config ASUSSystemDiagnosis start= auto
|
||||
sc config ArmouryCrateControlInterface start= auto
|
||||
|
||||
sc START AsusAppService
|
||||
sc START ASUSLinkNear
|
||||
sc START ASUSLinkRemote
|
||||
sc START ASUSSoftwareManager
|
||||
sc START ASUSSwitch
|
||||
sc START ASUSSystemAnalysis
|
||||
sc START ASUSSystemDiagnosis
|
||||
sc START ArmouryCrateControlInterface
|
||||
|
||||
set /p asd="Hit enter to finish"
|
||||
@@ -1,77 +1,81 @@
|
||||
# [G-Helper (GHelper)](https://github.com/seerge/g-helper)
|
||||
# G-Helper (GHelper)
|
||||
|
||||
[](https://GitHub.com/seerge/g-helper/releases/) [](https://GitHub.com/seerge/g-helper/releases/) [](https://GitHub.com/seerge/g-helper/stargazers/)
|
||||
|
||||
## Open source Armoury Crate alternative for Asus laptops such as ROG Zephyrus G14, G15, Flow X13, Flow X16, TUF and other models
|
||||
## Lightweight Armoury Crate alternative for Asus laptops
|
||||
### Control tool for ROG Zephyrus G14, G15, Flow X13, Flow X16, TUF, Strix, Scar and other models
|
||||
|
||||
A small utility that allows you to do almost everything you could do with Armoury Crate but without extra bloat and unnecessary services.
|
||||
|
||||
### :gift: Main advantages
|
||||
## :gift: Main advantages
|
||||
|
||||
1. Seamless and automatic GPU switching (without asking you to close all apps, etc)
|
||||
2. All performance modes can be fully customized (with fan curves and PPTs)
|
||||
3. Very lightweight and consumes almost no resources, doesn't install any services. Just a single exe to run
|
||||
4. Simple and clean UI with easy access to all settings
|
||||
4. Simple and clean native UI with easy access to all settings
|
||||
5. Doesn't need administrator privileges to run!
|
||||
|
||||
### [:floppy_disk: Download latest release](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
|
||||
## [:floppy_disk: Download App](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
|
||||
|
||||
If you like this app, please [star :star: it on Github](https://github.com/seerge/g-helper) and spread a word about it!
|
||||
|
||||

|
||||
_If you post about the app - please include a link. Thanks._
|
||||
|
||||

|
||||
|
||||
### :zap: Main features
|
||||
|
||||
1. Built-in **Performance modes**: Silent - Balanced - Turbo (with default fan curves)
|
||||
1. **Performance modes**: Silent - Balanced - Turbo (built-in, with default fan curves)
|
||||
2. **GPU modes**: Eco - Standard - Ultimate - Optimized
|
||||
3. Laptop screen refresh rate 60hz or 120hz (144hz, etc depending on the model) with display overdrive (OD)
|
||||
4. Default and custom fan profiles for every performance mode
|
||||
5. Power limits (PPT) for every performance mode
|
||||
6. CPU turbo boost mode
|
||||
7. Keyboard backlit animation and colors
|
||||
8. Anime matrix control thanks to [Starlight](https://github.com/vddCore/Starlight) + some tweaks from my side (including animated GIFs)
|
||||
9. FN+F5 cycles performance modes, FN+F4 cycles keyboard animation modes
|
||||
10. Keybindings for M3 and M4 keys
|
||||
11. Battery charge limit to preserve battery health
|
||||
12. Monitor CPU / GPU temperature, fan speeds and battery discharge rate
|
||||
3. Laptop screen refresh rate 60hz or 120hz (144hz, etc) with display overdrive (OD) and miniled multizone switch
|
||||
4. Custom fan curve editor, power limits (PPT) and turbo boost selection for every performance mode
|
||||
5. Anime matrix control thanks to [Starlight](https://github.com/vddCore/Starlight) + some tweaks from my side including animated GIFs
|
||||
6. Keyboard backlit animation and colors (including sleep animation and support for TUF models)
|
||||
7. Custom bindings for M3, M4 keys and FN+F5 (performance mode) FN+F4 (keyboard animation modes)
|
||||
8. Monitor CPU / GPU temperature, fan speeds and battery discharge rate
|
||||
9. Battery charge limit to preserve battery health
|
||||
|
||||
### :apple: Automatic switching of modes when on battery or plugged in
|
||||
### :gear: Automatic switching when on battery or plugged in
|
||||
- Performance modes (app remembers last mode used on battery or when plugged)
|
||||
- Optimized GPU mode - disables dGPU on battery and enables when plugged
|
||||
- Auto Screen refresh rate (60hz on battery, 120+ hz when plugged)
|
||||
- Keyboard backlight can be turned off on battery
|
||||
|
||||
To keep auto switching and hotkeys working the app needs to stay in running in the tray. It doesn't consume any resources.
|
||||
To keep auto switching and hotkeys working the app needs to stay running in the tray. It doesn't consume any resources.
|
||||
|
||||
### :rocket: Performance Modes
|
||||
|
||||
Modes are **same** as in Armory Crate (as they are stored in bios), including default fan curves
|
||||
Modes are **same** as in Armoury Crate as they are stored in bios including default fan curves
|
||||
|
||||
1. Silent (minimal or no fans, 70W PPT total, up to 45W PPT to CPU) + Best power efficiency setting in windows
|
||||
2. Balanced (balanced fans, 100W PPT total, up to 45W PPT to CPU) + Balanced setting in windows
|
||||
3. Turbo (intense fans, 125W PPT total, up to 80W PPT to CPU) + Best performance setting in windows
|
||||
|
||||
PPTs are shown for G14 2022, for other models PPTs will be different as they are set in bios.
|
||||
_PPTs are shown for G14 2022, for other models PPTs will be different as they are set in bios._
|
||||
|
||||

|
||||
|
||||
### :video_game: GPU Modes
|
||||
|
||||
1. Eco mode : only low power integrated GPU enabled, iGPU drives built in display
|
||||
2. Standard mode (MS Hybrid) : iGPU and dGPU enabled, iGPU drives built in display
|
||||
3. Ultimate mode: iGPU and dGPU enabled, but dGPU drives built in display (supported only on G14 2022 model)
|
||||
4. Optimized (formerly existed as a checkbox): disables dGPU on battery (Eco) and enables when plugged (Standard)
|
||||
4. Optimized: disables dGPU on battery (Eco) and enables when plugged (Standard)
|
||||
|
||||
## :question: FAQ
|
||||
|
||||
### How do I stop Armory Crate install popup appearing every time I press M4 / Rog key?
|
||||
### How do I stop the Armory Crate install popup appearing every time I press the M4 / Rog key?
|
||||
Go to BIOS (F2 on boot), open Advanced Settings and disable "Armory Control Interface".
|
||||
If it still appears - delete or move somwhere following file ``C:\Windows\System32\ASUSACCI\ArmouryCrateKeyControl.exe``
|
||||
If it still appears - delete or move somewhere following file ``C:\Windows\System32\ASUSACCI\ArmouryCrateKeyControl.exe``
|
||||
|
||||
### Why Ultimate GPU mode is not available on my laptop?
|
||||
### Why is Ultimate GPU mode not available on my laptop?
|
||||
Ultimate mode is supported (by hardware) only on G14 2022 (and possibly other models from 2022+)
|
||||
|
||||
### I can't set Eco mode (disable dGPU) on my G14 2020
|
||||
Unfortunately 2020 model doesn't support that on hardware level
|
||||
|
||||
### Should I apply custom PPTs and fan profiles?
|
||||
You don't have to, it's purely optional. From my experience built in (in bios) performance modes work well. Limit your power or apply custom fan curves only if you have issues. As sooon as you click Apply in fan + power section bios will be considering fan profile as "custom"! (no matter if you modified it or not)
|
||||
You don't have to, it's purely optional. From my experience built in (in bios) performance modes work well. Limit your power or apply custom fan curves only if you have issues. As soon as you click Apply in the fan + power section bios will be considering the fan profile as "custom"! (no matter if you modified it or not)
|
||||
|
||||
### How does G-helper control my fan speeds?
|
||||
It doesn't. Your bios does (same as in case with armoury). What G-helper can do - is (optionally) set a custom fan profile to current performance mode consisting of 8 pairs of temperature + fan speed % via same endpoint armoury seem to use.
|
||||
@@ -80,11 +84,17 @@ It doesn't. Your bios does (same as in case with armoury). What G-helper can do
|
||||
Click on them
|
||||
|
||||
### I don't see a GPU temperature in G-helper
|
||||
Most probably either you are using Eco / Optimized mode and your dGPU is simply off, or your windows has put dGPU into sleep (to preserve power). In this situations G-helper won't be able to reach your GPU and get readings
|
||||
Most probably either you are using Eco / Optimized mode and your dGPU is simply off, or your windows has put the dGPU into sleep (to preserve power). In this situations G-helper won't be able to reach your GPU and get readings
|
||||
|
||||
### It says, that app is already running
|
||||
Please check system tray for a (G) icon. By default windows is keen to hide all icons, so you may need to click ^ to see them all. I would advise to right click on Task Bar select Task Bar Settings -> Other System Tray icons -> Mark G-Helper to be always ON.
|
||||
|
||||
### App doesn't start / or crashes, what should I do ?
|
||||
Open "Event Viewer" from start menu, go to Windows Logs -> Application and check for recent Errors mentioning G-Helper. If you see one - please post a [new issue](https://github.com/seerge/g-helper/issues) with all details from this error.
|
||||
|
||||
### Can I use MyASUS app along with G-Helper?
|
||||
Sure, you can! The only problem is that MyASUS may override the battery charge limit that you set before. My advice in such a situation would be to set the same limit (i.e. 80%) in both MyASUS and G-Helper.
|
||||
|
||||
### How do I uninstall G-helper?
|
||||
G-helper is a single exe, and it doesn't install anything in the system. To remove it - you can simply delete exe :) If you have applied any custom fan profiles or PPTs - before removing I would recommend selecting your favorite performance mode (for example balanced) and clicking "Factory defaults" under Fans + Power.
|
||||
|
||||
@@ -96,15 +106,17 @@ G-helper is a single exe, and it doesn't install anything in the system. To remo
|
||||
2. Unzip to a folder of your choice
|
||||
3. Run **GHelper.exe**
|
||||
|
||||
### Dependencies
|
||||
### Dependencies & Requirements
|
||||
|
||||
- App requires [.NET7](https://dotnet.microsoft.com/en-us/download) to be installed. Most probably you already have it. Otherwise you can [download it](https://dotnet.microsoft.com/en-us/download).
|
||||
- Microsoft [.NET7](https://dotnet.microsoft.com/en-us/download). Most probably you already have it. Otherwise you can [download it](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-7.0.202-windows-x64-installer) from the official website.
|
||||
|
||||
- I recommend keeping "Asus Optimization Service" running, as it keeps basic laptop hotkeys such as screen or keyboard brightness adjustment working. If you have (or had) MyASUS app installed, that service is most probably still up and running even after MyASUS uninstalls. It's part of [Asus System Control Interface](https://www.asus.com/support/FAQ/1047338/). You can install it, and later disable / remove unnecessary services by running [this bat file](https://raw.githubusercontent.com/seerge/g-helper/main/debloat.bat) as admin.
|
||||
- [Asus System Control Interface](https://dlcdnets.asus.com/pub/ASUS/nb/Image/CustomComponent/ASUSSystemControlInterfaceV3/ASUSSystemControlInterfaceV3.exe). If you have or had MyASUS app installed this "driver" probably still in place (even after MyASUS uninstalls). Alternatively - you can download and install it
|
||||
|
||||
- It's not recommended to use an app in combination with Armoury Crate, cause they adjust the same settings. You can [uninstall it using it's own uninstall tool](https://dlcdnets.asus.com/pub/ASUS/mb/14Utilities/Armoury_Crate_Uninstall_Tool.zip?model=armoury%20crate). Just in case, you can always install it back later.
|
||||
- Optionally(!) you can disable / remove unnecessary services by running [this debloat bat file](https://raw.githubusercontent.com/seerge/g-helper/main/debloat.bat) as admin. To restore services - run [this bloat bat file](https://raw.githubusercontent.com/seerge/g-helper/main/bloat.bat) instead.
|
||||
|
||||
Note: Doesn't need administrator privileges to run!
|
||||
- I recommend keeping "Asus Optimization Service" running, as it keeps basic laptop hotkeys such as screen or keyboard brightness adjustment working.
|
||||
|
||||
- It's not recommended to use an app in combination with Armoury Crate services, because they adjust the same settings. You can [uninstall it using it's own uninstall tool](https://dlcdnets.asus.com/pub/ASUS/mb/14Utilities/Armoury_Crate_Uninstall_Tool.zip?model=armoury%20crate). Just in case, you can always install it back later.
|
||||
|
||||
-------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user