mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d002edf65 | ||
|
|
28a17562a8 | ||
|
|
583cb677d0 | ||
|
|
1888fe7bd9 | ||
|
|
089b339e61 | ||
|
|
cab4a04339 | ||
|
|
7ab3b450cd | ||
|
|
ea2dc7b75d | ||
|
|
ccd69a8628 | ||
|
|
c1d23159a0 | ||
|
|
1c865624e6 | ||
|
|
4853c09c2c | ||
|
|
08704d6826 | ||
|
|
6edbcf5ecd | ||
|
|
7702dc8e38 | ||
|
|
94391358ef | ||
|
|
feecd193ac | ||
|
|
444f7c76f0 | ||
|
|
701423fa0e | ||
|
|
7b3a6d319b | ||
|
|
8bc9325b3f | ||
|
|
64195c5082 | ||
|
|
2297532323 | ||
|
|
daac8b0a45 | ||
|
|
f061e3f43a | ||
|
|
85e02549f1 |
@@ -10,6 +10,10 @@ public class ASUSWmi
|
|||||||
const uint DSTS = 0x53545344;
|
const uint DSTS = 0x53545344;
|
||||||
const uint DEVS = 0x53564544;
|
const uint DEVS = 0x53564544;
|
||||||
|
|
||||||
|
public const uint UniversalControl = 0x00100021;
|
||||||
|
public const int KB_Light_Up = 0xc4;
|
||||||
|
public const int KB_Light_Down = 0xc5;
|
||||||
|
|
||||||
public const uint CPU_Fan = 0x00110013;
|
public const uint CPU_Fan = 0x00110013;
|
||||||
public const uint GPU_Fan = 0x00110014;
|
public const uint GPU_Fan = 0x00110014;
|
||||||
public const uint Mid_Fan = 0x00110031;
|
public const uint Mid_Fan = 0x00110031;
|
||||||
@@ -38,6 +42,9 @@ public class ASUSWmi
|
|||||||
public const int PPT_APUC1 = 0x001200C1;
|
public const int PPT_APUC1 = 0x001200C1;
|
||||||
public const int PPT_APUC2 = 0x001200C2;
|
public const int PPT_APUC2 = 0x001200C2;
|
||||||
|
|
||||||
|
public const int TUF_KB = 0x00100056;
|
||||||
|
public const int TUF_KB_STATE = 0x00100057;
|
||||||
|
|
||||||
public const int PerformanceBalanced = 0;
|
public const int PerformanceBalanced = 0;
|
||||||
public const int PerformanceTurbo = 1;
|
public const int PerformanceTurbo = 1;
|
||||||
public const int PerformanceSilent = 2;
|
public const int PerformanceSilent = 2;
|
||||||
@@ -146,21 +153,21 @@ public class ASUSWmi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeviceSet(uint DeviceID, int Status)
|
public byte[] DeviceSet(uint DeviceID, int Status)
|
||||||
{
|
{
|
||||||
byte[] args = new byte[8];
|
byte[] args = new byte[8];
|
||||||
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
||||||
BitConverter.GetBytes((uint)Status).CopyTo(args, 4);
|
BitConverter.GetBytes((uint)Status).CopyTo(args, 4);
|
||||||
CallMethod(DEVS, args);
|
return CallMethod(DEVS, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void DeviceSet(uint DeviceID, byte[] Params)
|
public byte[] DeviceSet(uint DeviceID, byte[] Params)
|
||||||
{
|
{
|
||||||
byte[] args = new byte[4 + Params.Length];
|
byte[] args = new byte[4 + Params.Length];
|
||||||
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
BitConverter.GetBytes((uint)DeviceID).CopyTo(args, 0);
|
||||||
Params.CopyTo(args, 4);
|
Params.CopyTo(args, 4);
|
||||||
CallMethod(DEVS, args);
|
return CallMethod(DEVS, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -232,6 +239,40 @@ public class ASUSWmi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void TUFKeyboardRGB(int mode, Color color, int speed)
|
||||||
|
{
|
||||||
|
|
||||||
|
byte[] setting = new byte[12];
|
||||||
|
setting[0] = (byte)1;
|
||||||
|
setting[1] = (byte)mode;
|
||||||
|
setting[2] = color.R;
|
||||||
|
setting[3] = color.G;
|
||||||
|
setting[4] = color.B;
|
||||||
|
setting[5] = (byte)speed;
|
||||||
|
|
||||||
|
DeviceSet(TUF_KB, setting);
|
||||||
|
//Debug.WriteLine(BitConverter.ToString(setting));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
const int ASUS_WMI_KEYBOARD_POWER_BOOT = 0x03 << 16;
|
||||||
|
const int ASUS_WMI_KEYBOARD_POWER_AWAKE = 0x0C << 16;
|
||||||
|
const int ASUS_WMI_KEYBOARD_POWER_SLEEP = 0x30 << 16;
|
||||||
|
const int ASUS_WMI_KEYBOARD_POWER_SHUTDOWN = 0xC0 << 16;
|
||||||
|
public void TUFKeyboardPower(bool awake = true, bool boot = false, bool sleep = false, bool shutdown = false)
|
||||||
|
{
|
||||||
|
int state = 0xbd;
|
||||||
|
|
||||||
|
if (boot) state = state | ASUS_WMI_KEYBOARD_POWER_BOOT;
|
||||||
|
if (awake) state = state | ASUS_WMI_KEYBOARD_POWER_AWAKE;
|
||||||
|
if (sleep) state = state | ASUS_WMI_KEYBOARD_POWER_SLEEP;
|
||||||
|
if (shutdown) state = state | ASUS_WMI_KEYBOARD_POWER_SHUTDOWN;
|
||||||
|
|
||||||
|
state = state | 0x01 << 8;
|
||||||
|
|
||||||
|
DeviceSet(TUF_KB_STATE, state);
|
||||||
|
}
|
||||||
|
|
||||||
public void SubscribeToEvents(Action<object, EventArrivedEventArgs> EventHandler)
|
public void SubscribeToEvents(Action<object, EventArrivedEventArgs> EventHandler)
|
||||||
{
|
{
|
||||||
ManagementEventWatcher watcher = new ManagementEventWatcher();
|
ManagementEventWatcher watcher = new ManagementEventWatcher();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
using Starlight.Communication;
|
using Starlight.Communication;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
|
using System.Drawing.Drawing2D;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Starlight.AnimeMatrix
|
namespace Starlight.AnimeMatrix
|
||||||
@@ -56,6 +57,14 @@ namespace Starlight.AnimeMatrix
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum AnimeType
|
||||||
|
{
|
||||||
|
GA401,
|
||||||
|
GA402
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public enum BrightnessMode : byte
|
public enum BrightnessMode : byte
|
||||||
{
|
{
|
||||||
Off = 0,
|
Off = 0,
|
||||||
@@ -74,29 +83,38 @@ namespace Starlight.AnimeMatrix
|
|||||||
List<byte[]> frames = new List<byte[]>();
|
List<byte[]> frames = new List<byte[]>();
|
||||||
|
|
||||||
public int MaxRows = 61;
|
public int MaxRows = 61;
|
||||||
public int FullRows = 11;
|
//public int FullRows = 11;
|
||||||
public int FullEvenRows = -1;
|
//public int FullEvenRows = -1;
|
||||||
|
|
||||||
|
public int dx = 0;
|
||||||
public int MaxColumns = 34;
|
public int MaxColumns = 34;
|
||||||
|
|
||||||
private int frameIndex = 0;
|
private int frameIndex = 0;
|
||||||
|
|
||||||
|
private static AnimeType _model = AnimeType.GA402;
|
||||||
|
|
||||||
public AnimeMatrixDevice()
|
public AnimeMatrixDevice()
|
||||||
: base(0x0B05, 0x193B, 640)
|
: base(0x0B05, 0x193B, 640)
|
||||||
{
|
{
|
||||||
string model = GetModel();
|
string model = GetModel();
|
||||||
if (model.Contains("401"))
|
if (model.Contains("401"))
|
||||||
{
|
{
|
||||||
MaxColumns = 33;
|
|
||||||
|
|
||||||
FullRows = 7;
|
_model = AnimeType.GA401;
|
||||||
FullEvenRows = 1;
|
|
||||||
|
MaxColumns = 33;
|
||||||
|
dx = 1;
|
||||||
|
|
||||||
|
//FullRows = 7;
|
||||||
|
//FullEvenRows = 3;
|
||||||
|
|
||||||
MaxRows = 55;
|
MaxRows = 55;
|
||||||
LedCount = 1214;
|
LedCount = 1245;
|
||||||
|
|
||||||
UpdatePageLength = 410;
|
UpdatePageLength = 410;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_displayBuffer = new byte[LedCount];
|
_displayBuffer = new byte[LedCount];
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -144,6 +162,71 @@ namespace Starlight.AnimeMatrix
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static int FirstX(int y)
|
||||||
|
{
|
||||||
|
switch (_model)
|
||||||
|
{
|
||||||
|
case AnimeType.GA401:
|
||||||
|
if (y < 5)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (y + 1) / 2 - 3;
|
||||||
|
}
|
||||||
|
case AnimeType.GA402:
|
||||||
|
if (y < 11)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (y) / 2 - 5;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
throw new ArgumentException("Invalid anime type", nameof(_model));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Width(int y)
|
||||||
|
{
|
||||||
|
switch (_model)
|
||||||
|
{
|
||||||
|
case AnimeType.GA401:
|
||||||
|
return 33;
|
||||||
|
case AnimeType.GA402:
|
||||||
|
return 34;
|
||||||
|
default:
|
||||||
|
throw new ArgumentException("Invalid anime type", nameof(_model));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Pitch(int y)
|
||||||
|
{
|
||||||
|
switch (_model)
|
||||||
|
{
|
||||||
|
case AnimeType.GA401:
|
||||||
|
switch (y)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
case 2:
|
||||||
|
case 4:
|
||||||
|
return 33;
|
||||||
|
case 1:
|
||||||
|
case 3:
|
||||||
|
return 35;
|
||||||
|
default:
|
||||||
|
return 36 - y / 2;
|
||||||
|
}
|
||||||
|
case AnimeType.GA402:
|
||||||
|
return Width(y) - FirstX(y);
|
||||||
|
default:
|
||||||
|
throw new ArgumentException("Invalid anime type", nameof(_model));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
public int XStart(int row)
|
public int XStart(int row)
|
||||||
{
|
{
|
||||||
return (int)Math.Ceiling(Math.Max(0, row - FullRows) / 2.0);
|
return (int)Math.Ceiling(Math.Max(0, row - FullRows) / 2.0);
|
||||||
@@ -151,22 +234,38 @@ namespace Starlight.AnimeMatrix
|
|||||||
|
|
||||||
public int XEnd(int row)
|
public int XEnd(int row)
|
||||||
{
|
{
|
||||||
if (row <= FullEvenRows && row % 2 == 0) return MaxColumns - 1;
|
if (row <= FullEvenRows)
|
||||||
|
{
|
||||||
|
if (row % 2 == 1) return MaxColumns + 2;
|
||||||
|
else return MaxColumns;
|
||||||
|
}
|
||||||
return MaxColumns;
|
return MaxColumns;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
public int RowToLinearAddress(int row)
|
public int RowToLinearAddress(int y)
|
||||||
{
|
{
|
||||||
EnsureRowInRange(row);
|
EnsureRowInRange(y);
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
for (var i = 0; i < row; i++)
|
for (var i = 0; i < y; i++)
|
||||||
ret += XEnd(i) - XStart(i);
|
ret += Pitch(i);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetLedPlanar(int x, int y, byte value)
|
||||||
|
{
|
||||||
|
EnsureRowInRange(y);
|
||||||
|
|
||||||
|
if (x >= FirstX(y) && x < Width(y))
|
||||||
|
{
|
||||||
|
SetLedLinear(RowToLinearAddress(y) - FirstX(y) + x + dx, value);
|
||||||
|
//Debug.Write((RowToLinearAddress(y) - FirstX(y) + x + dx).ToString() + " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void WakeUp()
|
public void WakeUp()
|
||||||
{
|
{
|
||||||
Set(Packet<AnimeMatrixPacket>(Encoding.ASCII.GetBytes("ASUS Tech.Inc.")));
|
Set(Packet<AnimeMatrixPacket>(Encoding.ASCII.GetBytes("ASUS Tech.Inc.")));
|
||||||
@@ -192,15 +291,7 @@ namespace Starlight.AnimeMatrix
|
|||||||
Set(Packet<AnimeMatrixPacket>(0xC0, 0x03));
|
Set(Packet<AnimeMatrixPacket>(0xC0, 0x03));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetLedPlanar(int x, int y, byte value)
|
|
||||||
{
|
|
||||||
EnsureRowInRange(y);
|
|
||||||
var start = RowToLinearAddress(y) - XStart(y);
|
|
||||||
if (x >= XStart(y) && x < XEnd(y))
|
|
||||||
{
|
|
||||||
SetLedLinear(start + x, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Clear(bool present = false)
|
public void Clear(bool present = false)
|
||||||
{
|
{
|
||||||
@@ -269,72 +360,75 @@ namespace Starlight.AnimeMatrix
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void PresentText(string text, float fontSize = 8F)
|
public void PresentText(string text1, string text2 = "")
|
||||||
{
|
{
|
||||||
using (Bitmap bmp = new Bitmap(MaxColumns * 3, MaxRows))
|
using (Bitmap bmp = new Bitmap(MaxColumns * 3, MaxRows))
|
||||||
{
|
{
|
||||||
using (Graphics g = Graphics.FromImage(bmp))
|
using (Graphics g = Graphics.FromImage(bmp))
|
||||||
{
|
{
|
||||||
using (Font font = new Font("Arial", fontSize))
|
g.CompositingQuality = CompositingQuality.HighQuality;
|
||||||
|
g.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
|
||||||
|
using (Font font = new Font("Arial", 12F))
|
||||||
{
|
{
|
||||||
|
SizeF textSize = g.MeasureString(text1, font);
|
||||||
g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
|
g.DrawString(text1, font, Brushes.White, (MaxColumns*3 - textSize.Width)+3, -5);
|
||||||
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
|
|
||||||
|
|
||||||
/*
|
|
||||||
SizeF textSize = g.MeasureString(text, font);
|
|
||||||
g.TranslateTransform(bmp.Width / 2, bmp.Height / 2);
|
|
||||||
g.RotateTransform(33);
|
|
||||||
g.DrawString(text, font, Brushes.White, -textSize.Width/2, -textSize.Height / 2);
|
|
||||||
*/
|
|
||||||
|
|
||||||
g.DrawString(text, font, Brushes.White, 12, -2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (text2.Length > 0)
|
||||||
|
using (Font font = new Font("Arial", 9F))
|
||||||
|
{
|
||||||
|
SizeF textSize = g.MeasureString(text2, font);
|
||||||
|
g.DrawString(text2, font, Brushes.White, (MaxColumns * 3 - textSize.Width), 25);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GenerateFrame(bmp);
|
GenerateFrame(bmp, InterpolationMode.Bicubic);
|
||||||
Present();
|
Present();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GenerateFrame(Image image)
|
public void GenerateFrame(Image image, InterpolationMode interpolation = InterpolationMode.HighQualityBicubic)
|
||||||
{
|
{
|
||||||
|
|
||||||
int width = MaxColumns * 3;
|
int width = MaxColumns/2 * 6;
|
||||||
int height = MaxRows;
|
int height = MaxRows;
|
||||||
|
|
||||||
|
int targetWidth = MaxColumns * 2;
|
||||||
|
|
||||||
float scale;
|
float scale;
|
||||||
|
|
||||||
using (Bitmap canvas = new Bitmap(width, height))
|
using (Bitmap bmp = new Bitmap(targetWidth, height))
|
||||||
{
|
{
|
||||||
scale = Math.Min((float)width / (float)image.Width, (float)height / (float)image.Height);
|
scale = Math.Min((float)width / (float)image.Width, (float)height / (float)image.Height);
|
||||||
|
|
||||||
using (var graph = Graphics.FromImage(canvas))
|
using (var graph = Graphics.FromImage(bmp))
|
||||||
{
|
{
|
||||||
var scaleWidth = (int)(image.Width * scale);
|
var scaleWidth = (float)(image.Width * scale);
|
||||||
var scaleHeight = (int)(image.Height * scale);
|
var scaleHeight = (float)(image.Height * scale);
|
||||||
|
|
||||||
graph.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
|
graph.InterpolationMode = interpolation;
|
||||||
graph.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
|
graph.CompositingQuality = CompositingQuality.HighQuality;
|
||||||
graph.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
|
graph.SmoothingMode = SmoothingMode.AntiAlias;
|
||||||
|
|
||||||
graph.DrawImage(image, ((int)width - scaleWidth), 0, scaleWidth, scaleHeight);
|
graph.DrawImage(image, (float)Math.Round(targetWidth - scaleWidth * targetWidth / width), 0, (float)Math.Round(scaleWidth * targetWidth / width), scaleHeight);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using (Bitmap bmp = new Bitmap(canvas, MaxColumns * 2, MaxRows))
|
for (int y = 0; y < bmp.Height; y++)
|
||||||
{
|
{
|
||||||
for (int y = 0; y < bmp.Height; y++)
|
for (int x = 0; x < bmp.Width; x++)
|
||||||
for (int x = 0; x < bmp.Width; x++)
|
if (x % 2 == (y+dx) % 2)
|
||||||
if (x % 2 == y % 2)
|
{
|
||||||
{
|
var pixel = bmp.GetPixel(x, y);
|
||||||
var pixel = bmp.GetPixel(x, y);
|
var color = (pixel.R + pixel.G + pixel.B) / 3;
|
||||||
SetLedPlanar(x / 2, y, (byte)((pixel.R + pixel.G + pixel.B)/3));
|
if (color < 10) color = 0;
|
||||||
}
|
SetLedPlanar(x / 2, y, (byte)color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnsureRowInRange(int row)
|
private void EnsureRowInRange(int row)
|
||||||
|
|||||||
@@ -40,8 +40,7 @@ public class AppConfig
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public string GetModel()
|
||||||
public bool ContainsModel(string contains)
|
|
||||||
{
|
{
|
||||||
if (_model is null)
|
if (_model is null)
|
||||||
{
|
{
|
||||||
@@ -56,6 +55,12 @@ public class AppConfig
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return _model;
|
||||||
|
}
|
||||||
|
public bool ContainsModel(string contains)
|
||||||
|
{
|
||||||
|
|
||||||
|
GetModel();
|
||||||
return (_model is not null && _model.Contains(contains));
|
return (_model is not null && _model.Contains(contains));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
268
app/Aura.cs
268
app/Aura.cs
@@ -1,78 +1,228 @@
|
|||||||
using HidLibrary;
|
using HidLibrary;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
public class Aura
|
namespace GHelper
|
||||||
{
|
{
|
||||||
|
|
||||||
static byte[] MESSAGE_SET = { 0x5d, 0xb5, 0,0,0 };
|
[Flags]
|
||||||
static byte[] MESSAGE_APPLY = { 0x5d, 0xb4};
|
public enum AuraDev19b6 : uint
|
||||||
|
|
||||||
public const int Static = 0;
|
|
||||||
public const int Breathe = 1;
|
|
||||||
public const int Strobe = 2;
|
|
||||||
public const int Rainbow = 3;
|
|
||||||
public const int Dingding = 4;
|
|
||||||
|
|
||||||
public const int SpeedSlow = 0xe1;
|
|
||||||
public const int SpeedMedium = 0xeb;
|
|
||||||
public const int SpeedHigh = 0xf5;
|
|
||||||
|
|
||||||
public static int Mode = Static;
|
|
||||||
public static Color Color1 = Color.White;
|
|
||||||
public static Color Color2 = Color.Black;
|
|
||||||
public static int Speed = SpeedSlow;
|
|
||||||
|
|
||||||
public static byte[] AuraMessage(int mode, Color color, Color color2, int speed)
|
|
||||||
{
|
{
|
||||||
byte[] msg = new byte[17];
|
BootLogo = 1,
|
||||||
msg[0] = 0x5d;
|
BootKeyb = 1 << 1,
|
||||||
msg[1] = 0xb3;
|
AwakeLogo = 1 << 2,
|
||||||
msg[2] = 0x00; // Zone
|
AwakeKeyb = 1 << 3,
|
||||||
msg[3] = (byte)mode; // Aura Mode
|
SleepLogo = 1 << 4,
|
||||||
msg[4] = (byte)(color.R); // R
|
SleepKeyb = 1 << 5,
|
||||||
msg[5] = (byte)(color.G); // G
|
ShutdownLogo = 1 << 6,
|
||||||
msg[6] = (byte)(color.B); // B
|
ShutdownKeyb = 1 << 7,
|
||||||
msg[7] = (byte)speed; // aura.speed as u8;
|
BootBar = 1u << (7 + 2),
|
||||||
msg[8] = 0; // aura.direction as u8;
|
AwakeBar = 1u << (7 + 3),
|
||||||
msg[10] = (byte)(color2.R); // R
|
SleepBar = 1u << (7 + 4),
|
||||||
msg[11] = (byte)(color2.G); // G
|
ShutdownBar = 1u << (7 + 5),
|
||||||
msg[12] = (byte)(color2.B); // B
|
BootLid = 1u << (15 + 1),
|
||||||
return msg;
|
AwakeLid = 1u << (15 + 2),
|
||||||
|
SleepLid = 1u << (15 + 3),
|
||||||
|
ShutdownLid = 1u << (15 + 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ApplyAura()
|
public static class AuraDev19b6Extensions
|
||||||
|
{
|
||||||
|
public static byte[] ToBytes(this AuraDev19b6[] controls)
|
||||||
|
{
|
||||||
|
uint a = 0;
|
||||||
|
foreach (var n in controls)
|
||||||
|
{
|
||||||
|
a |= (uint)n;
|
||||||
|
}
|
||||||
|
return new byte[] { 0x5d, 0xbd, 0x01, (byte)(a & 0xff), (byte)((a & 0xff00) >> 8), (byte)((a & 0xff0000) >> 16) };
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ushort BitOr(this AuraDev19b6 self, AuraDev19b6 rhs)
|
||||||
|
{
|
||||||
|
return (ushort)(self | rhs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ushort BitAnd(this AuraDev19b6 self, AuraDev19b6 rhs)
|
||||||
|
{
|
||||||
|
return (ushort)(self & rhs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Aura
|
||||||
{
|
{
|
||||||
|
|
||||||
HidDevice[] HidDeviceList;
|
static byte[] MESSAGE_SET = { 0x5d, 0xb5, 0, 0, 0 };
|
||||||
int[] deviceIds = { 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0 };
|
static byte[] MESSAGE_APPLY = { 0x5d, 0xb4 };
|
||||||
|
|
||||||
HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
|
static int[] deviceIds = { 0x1854, 0x1869, 0x1866, 0x19b6, 0x1822, 0x1837, 0x1854, 0x184a, 0x183d, 0x8502, 0x1807, 0x17e0 };
|
||||||
|
|
||||||
if (Mode == Dingding)
|
private static int mode = 0;
|
||||||
{
|
private static int speed = 1;
|
||||||
Mode = 10;
|
public static Color Color1 = Color.White;
|
||||||
Speed = SpeedMedium;
|
public static Color Color2 = Color.Black;
|
||||||
}
|
|
||||||
else if (Mode == Rainbow)
|
|
||||||
{
|
|
||||||
Speed = SpeedMedium;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Speed = SpeedSlow;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (HidDevice device in HidDeviceList)
|
|
||||||
|
public static Dictionary<int, string> GetSpeeds()
|
||||||
{
|
{
|
||||||
if (device.IsConnected && device.Description.Contains("HID"))
|
return new Dictionary<int, string>
|
||||||
{
|
{
|
||||||
device.OpenDevice();
|
{ 0, "Slow" },
|
||||||
byte[] msg = AuraMessage(Mode, Color1, Color2, Speed);
|
{ 1, "Normal" },
|
||||||
device.Write(msg);
|
{ 2, "Fast" }
|
||||||
device.Write(MESSAGE_SET);
|
};
|
||||||
device.Write(MESSAGE_APPLY);
|
}
|
||||||
device.CloseDevice();
|
public static Dictionary<int, string> GetModes()
|
||||||
|
{
|
||||||
|
return new Dictionary<int, string>
|
||||||
|
{
|
||||||
|
{ 0, "Static" },
|
||||||
|
{ 1, "Breathe" },
|
||||||
|
{ 2, "Color Cycle" },
|
||||||
|
{ 3, "Rainbow" },
|
||||||
|
{ 10, "Strobe" },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static int Mode
|
||||||
|
{
|
||||||
|
get { return mode; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (GetModes().ContainsKey(value))
|
||||||
|
mode = value;
|
||||||
|
else
|
||||||
|
mode = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool HasSecondColor()
|
||||||
|
{
|
||||||
|
return mode == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int Speed
|
||||||
|
{
|
||||||
|
get { return speed; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (GetSpeeds().ContainsKey(value))
|
||||||
|
speed = value;
|
||||||
|
else
|
||||||
|
speed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetColor(int colorCode)
|
||||||
|
{
|
||||||
|
Color1 = Color.FromArgb(colorCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetColor2(int colorCode)
|
||||||
|
{
|
||||||
|
Color2 = Color.FromArgb(colorCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static byte[] AuraMessage(int mode, Color color, Color color2, int speed)
|
||||||
|
{
|
||||||
|
|
||||||
|
byte[] msg = new byte[17];
|
||||||
|
msg[0] = 0x5d;
|
||||||
|
msg[1] = 0xb3;
|
||||||
|
msg[2] = 0x00; // Zone
|
||||||
|
msg[3] = (byte)mode; // Aura Mode
|
||||||
|
msg[4] = (byte)(color.R); // R
|
||||||
|
msg[5] = (byte)(color.G); // G
|
||||||
|
msg[6] = (byte)(color.B); // B
|
||||||
|
msg[7] = (byte)speed; // aura.speed as u8;
|
||||||
|
msg[8] = 0; // aura.direction as u8;
|
||||||
|
msg[10] = (byte)(color2.R); // R
|
||||||
|
msg[11] = (byte)(color2.G); // G
|
||||||
|
msg[12] = (byte)(color2.B); // B
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void ApplyBrightness(int brightness)
|
||||||
|
{
|
||||||
|
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
|
||||||
|
|
||||||
|
byte[] msg = { 0x5a, 0xba, 0xc5, 0xc4, (byte)brightness };
|
||||||
|
|
||||||
|
foreach (HidDevice device in HidDeviceList)
|
||||||
|
if (device.IsConnected && device.Description.Contains("HID"))
|
||||||
|
{
|
||||||
|
device.OpenDevice();
|
||||||
|
device.Write(msg);
|
||||||
|
device.CloseDevice();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void ApplyAuraPower(bool awake = true, bool boot = false, bool sleep = false, bool shutdown = false)
|
||||||
|
{
|
||||||
|
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, 0x19b6).ToArray();
|
||||||
|
|
||||||
|
List<AuraDev19b6> flags = new List<AuraDev19b6>();
|
||||||
|
|
||||||
|
if (awake) flags.Add(AuraDev19b6.AwakeKeyb);
|
||||||
|
if (boot) flags.Add(AuraDev19b6.BootKeyb);
|
||||||
|
if (sleep) flags.Add(AuraDev19b6.SleepKeyb);
|
||||||
|
if (shutdown) flags.Add(AuraDev19b6.ShutdownKeyb);
|
||||||
|
|
||||||
|
byte[] msg = AuraDev19b6Extensions.ToBytes(flags.ToArray());
|
||||||
|
|
||||||
|
Debug.WriteLine(BitConverter.ToString(msg));
|
||||||
|
|
||||||
|
foreach (HidDevice device in HidDeviceList)
|
||||||
|
if (device.IsConnected && device.Description.Contains("HID"))
|
||||||
|
{
|
||||||
|
device.OpenDevice();
|
||||||
|
device.Write(msg);
|
||||||
|
device.CloseDevice();
|
||||||
|
}
|
||||||
|
|
||||||
|
Program.wmi.TUFKeyboardPower(awake, boot, sleep, shutdown);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void ApplyAura()
|
||||||
|
{
|
||||||
|
|
||||||
|
HidDevice[] HidDeviceList = HidDevices.Enumerate(0x0b05, deviceIds).ToArray();
|
||||||
|
|
||||||
|
int _speed;
|
||||||
|
|
||||||
|
switch (Speed)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
_speed = 0xeb;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
_speed = 0xf5;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
_speed = 0xe1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
byte[] msg = AuraMessage(Mode, Color1, Color2, _speed);
|
||||||
|
foreach (HidDevice device in HidDeviceList)
|
||||||
|
if (device.IsConnected && device.Description.Contains("HID"))
|
||||||
|
{
|
||||||
|
device.OpenDevice();
|
||||||
|
device.Write(msg);
|
||||||
|
device.Write(MESSAGE_SET);
|
||||||
|
device.Write(MESSAGE_APPLY);
|
||||||
|
device.CloseDevice();
|
||||||
|
}
|
||||||
|
|
||||||
|
Program.wmi.TUFKeyboardRGB(Mode, Color1, _speed);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@ public static class ControlHelper
|
|||||||
{
|
{
|
||||||
|
|
||||||
static bool _invert = false;
|
static bool _invert = false;
|
||||||
static bool _resize = false;
|
static bool _darkTheme = false;
|
||||||
|
|
||||||
static float _scale = 1;
|
static float _scale = 1;
|
||||||
|
|
||||||
@@ -20,11 +20,13 @@ public static class ControlHelper
|
|||||||
public static void Adjust(RForm container, bool darkTheme = false, bool invert = false)
|
public static void Adjust(RForm container, bool darkTheme = false, bool invert = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
_darkTheme = darkTheme;
|
||||||
|
|
||||||
if (darkTheme)
|
if (darkTheme)
|
||||||
{
|
{
|
||||||
formBack = Color.FromArgb(255, 35, 35, 35);
|
formBack = Color.FromArgb(255, 35, 35, 35);
|
||||||
backMain = Color.FromArgb(255, 50, 50, 50);
|
backMain = Color.FromArgb(255, 50, 50, 50);
|
||||||
foreMain = Color.White;
|
foreMain = Color.FromArgb(255, 240, 240, 240);
|
||||||
foreAccent = Color.FromArgb(255, 100, 100, 100);
|
foreAccent = Color.FromArgb(255, 100, 100, 100);
|
||||||
borderMain = Color.FromArgb(255, 50, 50, 50);
|
borderMain = Color.FromArgb(255, 50, 50, 50);
|
||||||
buttonMain = Color.FromArgb(255, 80, 80, 80);
|
buttonMain = Color.FromArgb(255, 80, 80, 80);
|
||||||
@@ -115,8 +117,6 @@ public static class ControlHelper
|
|||||||
{
|
{
|
||||||
chart.BackColor = backMain;
|
chart.BackColor = backMain;
|
||||||
chart.ChartAreas[0].BackColor = backMain;
|
chart.ChartAreas[0].BackColor = backMain;
|
||||||
chart.ChartAreas[0].AxisX.MajorGrid.LineColor = foreAccent;
|
|
||||||
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = foreAccent;
|
|
||||||
|
|
||||||
chart.ChartAreas[0].AxisX.TitleForeColor = foreMain;
|
chart.ChartAreas[0].AxisX.TitleForeColor = foreMain;
|
||||||
chart.ChartAreas[0].AxisY.TitleForeColor = foreMain;
|
chart.ChartAreas[0].AxisY.TitleForeColor = foreMain;
|
||||||
@@ -127,6 +127,8 @@ public static class ControlHelper
|
|||||||
chart.ChartAreas[0].AxisX.MajorTickMark.LineColor = foreMain;
|
chart.ChartAreas[0].AxisX.MajorTickMark.LineColor = foreMain;
|
||||||
chart.ChartAreas[0].AxisY.MajorTickMark.LineColor = foreMain;
|
chart.ChartAreas[0].AxisY.MajorTickMark.LineColor = foreMain;
|
||||||
|
|
||||||
|
chart.ChartAreas[0].AxisX.MajorGrid.LineColor = foreAccent;
|
||||||
|
chart.ChartAreas[0].AxisY.MajorGrid.LineColor = foreAccent;
|
||||||
chart.ChartAreas[0].AxisX.LineColor = foreAccent;
|
chart.ChartAreas[0].AxisX.LineColor = foreAccent;
|
||||||
chart.ChartAreas[0].AxisY.LineColor = foreAccent;
|
chart.ChartAreas[0].AxisY.LineColor = foreAccent;
|
||||||
|
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ namespace CustomControls
|
|||||||
return (int)registryValueObject <= 0;
|
return (int)registryValueObject <= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitTheme(bool setDPI = true)
|
public bool InitTheme(bool setDPI = true)
|
||||||
{
|
{
|
||||||
bool newDarkTheme = IsDarkTheme();
|
bool newDarkTheme = CheckSystemDarkModeStatus();
|
||||||
bool changed = (darkTheme != newDarkTheme);
|
bool changed = (darkTheme != newDarkTheme);
|
||||||
darkTheme = newDarkTheme;
|
darkTheme = newDarkTheme;
|
||||||
|
|
||||||
@@ -45,6 +45,8 @@ namespace CustomControls
|
|||||||
ControlHelper.Adjust(this, darkTheme, changed);
|
ControlHelper.Adjust(this, darkTheme, changed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return changed;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
17
app/Fans.cs
17
app/Fans.cs
@@ -47,6 +47,13 @@ namespace GHelper
|
|||||||
|
|
||||||
chart.ChartAreas[0].AxisY.LabelStyle.Font = new Font("Arial", 7F);
|
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;
|
||||||
|
|
||||||
for (int i = 0; i <= 90; i += 10)
|
for (int i = 0; i <= 90; i += 10)
|
||||||
chart.ChartAreas[0].AxisY.CustomLabels.Add(i - 2, i + 2, ChartPercToRPM(i));
|
chart.ChartAreas[0].AxisY.CustomLabels.Add(i - 2, i + 2, ChartPercToRPM(i));
|
||||||
|
|
||||||
@@ -139,7 +146,7 @@ namespace GHelper
|
|||||||
InitPower();
|
InitPower();
|
||||||
InitBoost();
|
InitBoost();
|
||||||
|
|
||||||
comboBoost.SelectedIndexChanged += ComboBoost_Changed;
|
comboBoost.SelectedValueChanged += ComboBoost_Changed;
|
||||||
|
|
||||||
Shown += Fans_Shown;
|
Shown += Fans_Shown;
|
||||||
|
|
||||||
@@ -155,9 +162,11 @@ namespace GHelper
|
|||||||
|
|
||||||
private void ComboBoost_Changed(object? sender, EventArgs e)
|
private void ComboBoost_Changed(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is null) return;
|
if (Program.config.getConfigPerf("auto_boost") != comboBoost.SelectedIndex)
|
||||||
ComboBox cmb = (ComboBox)sender;
|
{
|
||||||
NativeMethods.SetCPUBoost(cmb.SelectedIndex);
|
NativeMethods.SetCPUBoost(comboBoost.SelectedIndex);
|
||||||
|
Program.config.setConfigPerf("auto_boost", comboBoost.SelectedIndex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckApplyPower_Click(object? sender, EventArgs e)
|
private void CheckApplyPower_Click(object? sender, EventArgs e)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.37</AssemblyVersion>
|
<AssemblyVersion>0.41</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -46,15 +46,17 @@ public static class HardwareMonitor
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RecreateGpuTemperatureProviderWithRetry() {
|
public static void RecreateGpuTemperatureProviderWithDelay() {
|
||||||
RecreateGpuTemperatureProvider();
|
|
||||||
|
|
||||||
// Re-enabling the discrete GPU takes a bit of time,
|
// Re-enabling the discrete GPU takes a bit of time,
|
||||||
// so a simple workaround is to refresh again after that happens
|
// so a simple workaround is to refresh again after that happens
|
||||||
Task.Run(async () => {
|
Task.Run(async () => {
|
||||||
await Task.Delay(TimeSpan.FromSeconds(3));
|
await Task.Delay(TimeSpan.FromSeconds(5));
|
||||||
RecreateGpuTemperatureProvider();
|
RecreateGpuTemperatureProvider();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RecreateGpuTemperatureProvider() {
|
public static void RecreateGpuTemperatureProvider() {
|
||||||
|
|||||||
204
app/Keyboard.Designer.cs
generated
204
app/Keyboard.Designer.cs
generated
@@ -31,16 +31,29 @@ namespace GHelper
|
|||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
groupBox1 = new GroupBox();
|
groupBox1 = new GroupBox();
|
||||||
|
textFNF4 = new TextBox();
|
||||||
|
comboFNF4 = new RComboBox();
|
||||||
|
labelFNF4 = new Label();
|
||||||
textM4 = new TextBox();
|
textM4 = new TextBox();
|
||||||
textM3 = new TextBox();
|
textM3 = new TextBox();
|
||||||
comboM4 = new RComboBox();
|
comboM4 = new RComboBox();
|
||||||
labelM4 = new Label();
|
labelM4 = new Label();
|
||||||
comboM3 = new RComboBox();
|
comboM3 = new RComboBox();
|
||||||
labelM3 = new Label();
|
labelM3 = new Label();
|
||||||
textFNF4 = new TextBox();
|
groupLight = new GroupBox();
|
||||||
comboFNF4 = new RComboBox();
|
labelSpeed = new Label();
|
||||||
labelFNF4 = new Label();
|
comboKeyboardSpeed = new RComboBox();
|
||||||
|
checkShutdown = new CheckBox();
|
||||||
|
checkSleep = new CheckBox();
|
||||||
|
checkBoot = new CheckBox();
|
||||||
|
checkAwake = new CheckBox();
|
||||||
|
groupOther = new GroupBox();
|
||||||
|
checkKeyboardAuto = new CheckBox();
|
||||||
|
checkTopmost = new CheckBox();
|
||||||
|
checkNoOverdrive = new CheckBox();
|
||||||
groupBox1.SuspendLayout();
|
groupBox1.SuspendLayout();
|
||||||
|
groupLight.SuspendLayout();
|
||||||
|
groupOther.SuspendLayout();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// groupBox1
|
// groupBox1
|
||||||
@@ -57,11 +70,36 @@ namespace GHelper
|
|||||||
groupBox1.Dock = DockStyle.Top;
|
groupBox1.Dock = DockStyle.Top;
|
||||||
groupBox1.Location = new Point(10, 10);
|
groupBox1.Location = new Point(10, 10);
|
||||||
groupBox1.Name = "groupBox1";
|
groupBox1.Name = "groupBox1";
|
||||||
groupBox1.Size = new Size(751, 242);
|
groupBox1.Size = new Size(756, 242);
|
||||||
groupBox1.TabIndex = 0;
|
groupBox1.TabIndex = 0;
|
||||||
groupBox1.TabStop = false;
|
groupBox1.TabStop = false;
|
||||||
groupBox1.Text = "Key Bindings";
|
groupBox1.Text = "Key Bindings";
|
||||||
//
|
//
|
||||||
|
// textFNF4
|
||||||
|
//
|
||||||
|
textFNF4.Location = new Point(411, 176);
|
||||||
|
textFNF4.Name = "textFNF4";
|
||||||
|
textFNF4.PlaceholderText = "action";
|
||||||
|
textFNF4.Size = new Size(320, 39);
|
||||||
|
textFNF4.TabIndex = 8;
|
||||||
|
//
|
||||||
|
// comboFNF4
|
||||||
|
//
|
||||||
|
comboFNF4.FormattingEnabled = true;
|
||||||
|
comboFNF4.Location = new Point(93, 175);
|
||||||
|
comboFNF4.Name = "comboFNF4";
|
||||||
|
comboFNF4.Size = new Size(312, 40);
|
||||||
|
comboFNF4.TabIndex = 7;
|
||||||
|
//
|
||||||
|
// labelFNF4
|
||||||
|
//
|
||||||
|
labelFNF4.AutoSize = true;
|
||||||
|
labelFNF4.Location = new Point(2, 178);
|
||||||
|
labelFNF4.Name = "labelFNF4";
|
||||||
|
labelFNF4.Size = new Size(90, 32);
|
||||||
|
labelFNF4.TabIndex = 6;
|
||||||
|
labelFNF4.Text = "FN+F4:";
|
||||||
|
//
|
||||||
// textM4
|
// textM4
|
||||||
//
|
//
|
||||||
textM4.Location = new Point(411, 113);
|
textM4.Location = new Point(411, 113);
|
||||||
@@ -114,36 +152,137 @@ namespace GHelper
|
|||||||
labelM3.TabIndex = 0;
|
labelM3.TabIndex = 0;
|
||||||
labelM3.Text = "M3:";
|
labelM3.Text = "M3:";
|
||||||
//
|
//
|
||||||
// textFNF4
|
// groupLight
|
||||||
//
|
//
|
||||||
textFNF4.Location = new Point(411, 176);
|
groupLight.Controls.Add(labelSpeed);
|
||||||
textFNF4.Name = "textFNF4";
|
groupLight.Controls.Add(comboKeyboardSpeed);
|
||||||
textFNF4.PlaceholderText = "action";
|
groupLight.Controls.Add(checkShutdown);
|
||||||
textFNF4.Size = new Size(320, 39);
|
groupLight.Controls.Add(checkSleep);
|
||||||
textFNF4.TabIndex = 8;
|
groupLight.Controls.Add(checkBoot);
|
||||||
|
groupLight.Controls.Add(checkAwake);
|
||||||
|
groupLight.Dock = DockStyle.Top;
|
||||||
|
groupLight.Location = new Point(10, 252);
|
||||||
|
groupLight.Name = "groupLight";
|
||||||
|
groupLight.Size = new Size(756, 304);
|
||||||
|
groupLight.TabIndex = 1;
|
||||||
|
groupLight.TabStop = false;
|
||||||
|
groupLight.Text = "Keyboard Backlight";
|
||||||
//
|
//
|
||||||
// comboFNF4
|
// labelSpeed
|
||||||
//
|
//
|
||||||
comboFNF4.FormattingEnabled = true;
|
labelSpeed.AutoSize = true;
|
||||||
comboFNF4.Location = new Point(93, 175);
|
labelSpeed.Location = new Point(25, 237);
|
||||||
comboFNF4.Name = "comboFNF4";
|
labelSpeed.Name = "labelSpeed";
|
||||||
comboFNF4.Size = new Size(312, 40);
|
labelSpeed.Size = new Size(198, 32);
|
||||||
comboFNF4.TabIndex = 7;
|
labelSpeed.TabIndex = 40;
|
||||||
|
labelSpeed.Text = "Animation Speed";
|
||||||
//
|
//
|
||||||
// labelFNF4
|
// comboKeyboardSpeed
|
||||||
//
|
//
|
||||||
labelFNF4.AutoSize = true;
|
comboKeyboardSpeed.BorderColor = Color.White;
|
||||||
labelFNF4.Location = new Point(2, 178);
|
comboKeyboardSpeed.ButtonColor = SystemColors.ControlLight;
|
||||||
labelFNF4.Name = "labelFNF4";
|
comboKeyboardSpeed.FlatStyle = FlatStyle.Flat;
|
||||||
labelFNF4.Size = new Size(90, 32);
|
comboKeyboardSpeed.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
labelFNF4.TabIndex = 6;
|
comboKeyboardSpeed.FormattingEnabled = true;
|
||||||
labelFNF4.Text = "FN+F4:";
|
comboKeyboardSpeed.ItemHeight = 32;
|
||||||
|
comboKeyboardSpeed.Items.AddRange(new object[] { "Slow", "Normal", "Fast" });
|
||||||
|
comboKeyboardSpeed.Location = new Point(230, 234);
|
||||||
|
comboKeyboardSpeed.Margin = new Padding(4, 10, 4, 8);
|
||||||
|
comboKeyboardSpeed.Name = "comboKeyboardSpeed";
|
||||||
|
comboKeyboardSpeed.Size = new Size(291, 40);
|
||||||
|
comboKeyboardSpeed.TabIndex = 39;
|
||||||
|
comboKeyboardSpeed.TabStop = false;
|
||||||
|
//
|
||||||
|
// checkShutdown
|
||||||
|
//
|
||||||
|
checkShutdown.AutoSize = true;
|
||||||
|
checkShutdown.Location = new Point(25, 185);
|
||||||
|
checkShutdown.Name = "checkShutdown";
|
||||||
|
checkShutdown.Size = new Size(154, 36);
|
||||||
|
checkShutdown.TabIndex = 3;
|
||||||
|
checkShutdown.Text = "Shutdown";
|
||||||
|
checkShutdown.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// checkSleep
|
||||||
|
//
|
||||||
|
checkSleep.AutoSize = true;
|
||||||
|
checkSleep.Location = new Point(25, 143);
|
||||||
|
checkSleep.Name = "checkSleep";
|
||||||
|
checkSleep.Size = new Size(105, 36);
|
||||||
|
checkSleep.TabIndex = 2;
|
||||||
|
checkSleep.Text = "Sleep";
|
||||||
|
checkSleep.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// checkBoot
|
||||||
|
//
|
||||||
|
checkBoot.AutoSize = true;
|
||||||
|
checkBoot.Location = new Point(25, 101);
|
||||||
|
checkBoot.Name = "checkBoot";
|
||||||
|
checkBoot.Size = new Size(96, 36);
|
||||||
|
checkBoot.TabIndex = 1;
|
||||||
|
checkBoot.Text = "Boot";
|
||||||
|
checkBoot.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// checkAwake
|
||||||
|
//
|
||||||
|
checkAwake.AutoSize = true;
|
||||||
|
checkAwake.Location = new Point(25, 59);
|
||||||
|
checkAwake.Name = "checkAwake";
|
||||||
|
checkAwake.Size = new Size(115, 36);
|
||||||
|
checkAwake.TabIndex = 0;
|
||||||
|
checkAwake.Text = "Awake";
|
||||||
|
checkAwake.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// groupOther
|
||||||
|
//
|
||||||
|
groupOther.Controls.Add(checkNoOverdrive);
|
||||||
|
groupOther.Controls.Add(checkKeyboardAuto);
|
||||||
|
groupOther.Controls.Add(checkTopmost);
|
||||||
|
groupOther.Dock = DockStyle.Top;
|
||||||
|
groupOther.Location = new Point(10, 556);
|
||||||
|
groupOther.Name = "groupOther";
|
||||||
|
groupOther.Size = new Size(756, 225);
|
||||||
|
groupOther.TabIndex = 2;
|
||||||
|
groupOther.TabStop = false;
|
||||||
|
groupOther.Text = "Other";
|
||||||
|
//
|
||||||
|
// checkKeyboardAuto
|
||||||
|
//
|
||||||
|
checkKeyboardAuto.AutoSize = true;
|
||||||
|
checkKeyboardAuto.Location = new Point(25, 51);
|
||||||
|
checkKeyboardAuto.Name = "checkKeyboardAuto";
|
||||||
|
checkKeyboardAuto.Size = new Size(712, 36);
|
||||||
|
checkKeyboardAuto.TabIndex = 2;
|
||||||
|
checkKeyboardAuto.Text = "Lower backlight brightness on battery and back when plugged";
|
||||||
|
checkKeyboardAuto.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// checkTopmost
|
||||||
|
//
|
||||||
|
checkTopmost.AutoSize = true;
|
||||||
|
checkTopmost.Location = new Point(25, 104);
|
||||||
|
checkTopmost.Name = "checkTopmost";
|
||||||
|
checkTopmost.Size = new Size(390, 36);
|
||||||
|
checkTopmost.TabIndex = 1;
|
||||||
|
checkTopmost.Text = "Keep app window always on top";
|
||||||
|
checkTopmost.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// checkNoOverdrive
|
||||||
|
//
|
||||||
|
checkNoOverdrive.AutoSize = true;
|
||||||
|
checkNoOverdrive.Location = new Point(25, 156);
|
||||||
|
checkNoOverdrive.Name = "checkNoOverdrive";
|
||||||
|
checkNoOverdrive.Size = new Size(307, 36);
|
||||||
|
checkNoOverdrive.TabIndex = 3;
|
||||||
|
checkNoOverdrive.Text = "Disable screen overdrive";
|
||||||
|
checkNoOverdrive.UseVisualStyleBackColor = true;
|
||||||
//
|
//
|
||||||
// Keyboard
|
// Keyboard
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(13F, 32F);
|
AutoScaleDimensions = new SizeF(13F, 32F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
ClientSize = new Size(771, 858);
|
ClientSize = new Size(776, 858);
|
||||||
|
Controls.Add(groupOther);
|
||||||
|
Controls.Add(groupLight);
|
||||||
Controls.Add(groupBox1);
|
Controls.Add(groupBox1);
|
||||||
FormBorderStyle = FormBorderStyle.FixedSingle;
|
FormBorderStyle = FormBorderStyle.FixedSingle;
|
||||||
MaximizeBox = false;
|
MaximizeBox = false;
|
||||||
@@ -153,9 +292,13 @@ namespace GHelper
|
|||||||
Padding = new Padding(10);
|
Padding = new Padding(10);
|
||||||
ShowIcon = false;
|
ShowIcon = false;
|
||||||
ShowInTaskbar = false;
|
ShowInTaskbar = false;
|
||||||
Text = "Keyboard";
|
Text = "Extra Settings";
|
||||||
groupBox1.ResumeLayout(false);
|
groupBox1.ResumeLayout(false);
|
||||||
groupBox1.PerformLayout();
|
groupBox1.PerformLayout();
|
||||||
|
groupLight.ResumeLayout(false);
|
||||||
|
groupLight.PerformLayout();
|
||||||
|
groupOther.ResumeLayout(false);
|
||||||
|
groupOther.PerformLayout();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,5 +314,16 @@ namespace GHelper
|
|||||||
private TextBox textFNF4;
|
private TextBox textFNF4;
|
||||||
private RComboBox comboFNF4;
|
private RComboBox comboFNF4;
|
||||||
private Label labelFNF4;
|
private Label labelFNF4;
|
||||||
|
private GroupBox groupLight;
|
||||||
|
private CheckBox checkSleep;
|
||||||
|
private CheckBox checkBoot;
|
||||||
|
private CheckBox checkAwake;
|
||||||
|
private CheckBox checkShutdown;
|
||||||
|
private Label labelSpeed;
|
||||||
|
private RComboBox comboKeyboardSpeed;
|
||||||
|
private GroupBox groupOther;
|
||||||
|
private CheckBox checkTopmost;
|
||||||
|
private CheckBox checkKeyboardAuto;
|
||||||
|
private CheckBox checkNoOverdrive;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -60,6 +60,66 @@ namespace GHelper
|
|||||||
SetKeyCombo(comboFNF4, textFNF4, "fnf4");
|
SetKeyCombo(comboFNF4, textFNF4, "fnf4");
|
||||||
|
|
||||||
Shown += Keyboard_Shown;
|
Shown += Keyboard_Shown;
|
||||||
|
|
||||||
|
comboKeyboardSpeed.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
|
comboKeyboardSpeed.DataSource = new BindingSource(Aura.GetSpeeds(), null);
|
||||||
|
comboKeyboardSpeed.DisplayMember = "Value";
|
||||||
|
comboKeyboardSpeed.ValueMember = "Key";
|
||||||
|
comboKeyboardSpeed.SelectedValue = Aura.Speed;
|
||||||
|
comboKeyboardSpeed.SelectedValueChanged += ComboKeyboardSpeed_SelectedValueChanged;
|
||||||
|
|
||||||
|
checkAwake.Checked = !(Program.config.getConfig("keyboard_awake") == 0);
|
||||||
|
checkBoot.Checked = !(Program.config.getConfig("keyboard_boot") == 0);
|
||||||
|
checkSleep.Checked = !(Program.config.getConfig("keyboard_sleep") == 0);
|
||||||
|
checkShutdown.Checked = !(Program.config.getConfig("keyboard_shutdown") == 0);
|
||||||
|
|
||||||
|
checkAwake.CheckedChanged += CheckPower_CheckedChanged;
|
||||||
|
checkBoot.CheckedChanged += CheckPower_CheckedChanged;
|
||||||
|
checkSleep.CheckedChanged += CheckPower_CheckedChanged;
|
||||||
|
checkShutdown.CheckedChanged += CheckPower_CheckedChanged;
|
||||||
|
|
||||||
|
checkTopmost.Checked = (Program.config.getConfig("topmost") == 1);
|
||||||
|
checkTopmost.CheckedChanged += CheckTopmost_CheckedChanged; ;
|
||||||
|
|
||||||
|
checkKeyboardAuto.Checked = (Program.config.getConfig("keyboard_auto") == 1);
|
||||||
|
checkKeyboardAuto.CheckedChanged += CheckKeyboardAuto_CheckedChanged;
|
||||||
|
|
||||||
|
checkNoOverdrive.Checked = (Program.config.getConfig("no_overdrive") == 1);
|
||||||
|
checkNoOverdrive.CheckedChanged += CheckNoOverdrive_CheckedChanged;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckNoOverdrive_CheckedChanged(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Program.config.setConfig("no_overdrive", (checkNoOverdrive.Checked ? 1 : 0));
|
||||||
|
Program.settingsForm.AutoScreen(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckKeyboardAuto_CheckedChanged(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Program.config.setConfig("keyboard_auto", (checkKeyboardAuto.Checked ? 1 : 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckTopmost_CheckedChanged(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Program.config.setConfig("topmost", (checkTopmost.Checked ? 1 : 0));
|
||||||
|
Program.settingsForm.TopMost = checkTopmost.Checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckPower_CheckedChanged(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Program.config.setConfig("keyboard_awake", (checkAwake.Checked ? 1 : 0));
|
||||||
|
Program.config.setConfig("keyboard_boot", (checkBoot.Checked ? 1 : 0));
|
||||||
|
Program.config.setConfig("keyboard_sleep", (checkSleep.Checked ? 1 : 0));
|
||||||
|
Program.config.setConfig("keyboard_shutdown", (checkShutdown.Checked ? 1 : 0));
|
||||||
|
|
||||||
|
Aura.ApplyAuraPower(checkAwake.Checked, checkBoot.Checked, checkSleep.Checked, checkShutdown.Checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ComboKeyboardSpeed_SelectedValueChanged(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Program.config.setConfig("aura_speed", (int)comboKeyboardSpeed.SelectedValue);
|
||||||
|
Program.settingsForm.SetAura();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Xml.Linq;
|
||||||
using static Tools.ScreenInterrogatory;
|
using static Tools.ScreenInterrogatory;
|
||||||
|
|
||||||
namespace Tools
|
namespace Tools
|
||||||
@@ -588,7 +590,7 @@ public class NativeMethods
|
|||||||
return laptopScreen;
|
return laptopScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int GetRefreshRate()
|
public static int GetRefreshRate(bool max = false)
|
||||||
{
|
{
|
||||||
DEVMODE dm = CreateDevmode();
|
DEVMODE dm = CreateDevmode();
|
||||||
|
|
||||||
@@ -598,11 +600,23 @@ public class NativeMethods
|
|||||||
if (laptopScreen is null)
|
if (laptopScreen is null)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (0 != NativeMethods.EnumDisplaySettingsEx(laptopScreen, NativeMethods.ENUM_CURRENT_SETTINGS, ref dm))
|
if (max)
|
||||||
{
|
{
|
||||||
frequency = dm.dmDisplayFrequency;
|
int i = 0;
|
||||||
|
while (0 != NativeMethods.EnumDisplaySettingsEx(laptopScreen, i, ref dm))
|
||||||
|
{
|
||||||
|
if (dm.dmDisplayFrequency > frequency) frequency = dm.dmDisplayFrequency;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
if (0 != NativeMethods.EnumDisplaySettingsEx(laptopScreen, NativeMethods.ENUM_CURRENT_SETTINGS, ref dm))
|
||||||
|
{
|
||||||
|
frequency = dm.dmDisplayFrequency;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return frequency;
|
return frequency;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -660,7 +674,6 @@ public class NativeMethods
|
|||||||
|
|
||||||
PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid);
|
PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid);
|
||||||
|
|
||||||
/*
|
|
||||||
var hrDC = PowerWriteDCValueIndex(
|
var hrDC = PowerWriteDCValueIndex(
|
||||||
IntPtr.Zero,
|
IntPtr.Zero,
|
||||||
activeSchemeGuid,
|
activeSchemeGuid,
|
||||||
@@ -669,8 +682,8 @@ public class NativeMethods
|
|||||||
boost);
|
boost);
|
||||||
|
|
||||||
PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid);
|
PowerSetActiveScheme(IntPtr.Zero, activeSchemeGuid);
|
||||||
*/
|
|
||||||
|
|
||||||
|
Logger.WriteLine("Boost " + boost);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetPowerScheme(int mode)
|
public static void SetPowerScheme(int mode)
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Management;
|
using System.Management;
|
||||||
using System.Reflection;
|
|
||||||
using System.Text.Json;
|
|
||||||
|
|
||||||
namespace GHelper
|
namespace GHelper
|
||||||
{
|
{
|
||||||
@@ -23,15 +21,24 @@ namespace GHelper
|
|||||||
public static SettingsForm settingsForm = new SettingsForm();
|
public static SettingsForm settingsForm = new SettingsForm();
|
||||||
public static ToastForm toast = new ToastForm();
|
public static ToastForm toast = new ToastForm();
|
||||||
|
|
||||||
private static IntPtr unRegPowerNotify;
|
public static IntPtr unRegPowerNotify;
|
||||||
private static IntPtr ds;
|
|
||||||
|
|
||||||
private static long lastAuto;
|
private static long lastAuto;
|
||||||
private static long lastTheme;
|
private static long lastTheme;
|
||||||
|
private static PowerLineStatus isPlugged = PowerLineStatus.Unknown;
|
||||||
|
|
||||||
// The main entry point for the application
|
// The main entry point for the application
|
||||||
public static void Main()
|
public static void Main()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (Process.GetProcesses().Count(p => p.ProcessName == "GHelper") > 1)
|
||||||
|
{
|
||||||
|
MessageBox.Show("G-Helper is already running. Check system tray for an icon.", "App already running", MessageBoxButtons.OK);
|
||||||
|
Application.Exit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
wmi = new ASUSWmi();
|
wmi = new ASUSWmi();
|
||||||
@@ -52,10 +59,9 @@ namespace GHelper
|
|||||||
|
|
||||||
Application.EnableVisualStyles();
|
Application.EnableVisualStyles();
|
||||||
|
|
||||||
SystemEvents.UserPreferenceChanged += new
|
SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(SystemEvents_UserPreferenceChanged);
|
||||||
UserPreferenceChangedEventHandler(SystemEvents_UserPreferenceChanged);
|
|
||||||
|
|
||||||
ds = settingsForm.Handle;
|
var ds = settingsForm.Handle;
|
||||||
|
|
||||||
trayIcon.MouseClick += TrayIcon_MouseClick;
|
trayIcon.MouseClick += TrayIcon_MouseClick;
|
||||||
|
|
||||||
@@ -71,16 +77,9 @@ namespace GHelper
|
|||||||
SetAutoModes();
|
SetAutoModes();
|
||||||
HardwareMonitor.RecreateGpuTemperatureProvider();
|
HardwareMonitor.RecreateGpuTemperatureProvider();
|
||||||
|
|
||||||
// Subscribing for monitor power on events
|
|
||||||
var settingGuid = new NativeMethods.PowerSettingGuid();
|
|
||||||
unRegPowerNotify = NativeMethods.RegisterPowerSettingNotification(ds, settingGuid.ConsoleDisplayState, NativeMethods.DEVICE_NOTIFY_WINDOW_HANDLE);
|
|
||||||
|
|
||||||
// Subscribing for system power change events
|
// Subscribing for system power change events
|
||||||
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
|
||||||
|
|
||||||
settingsForm.SetVersionLabel("Version: " + Assembly.GetExecutingAssembly().GetName().Version);
|
|
||||||
CheckForUpdates();
|
|
||||||
|
|
||||||
|
|
||||||
if (Environment.CurrentDirectory.Trim('\\') == Application.StartupPath.Trim('\\'))
|
if (Environment.CurrentDirectory.Trim('\\') == Application.StartupPath.Trim('\\'))
|
||||||
{
|
{
|
||||||
@@ -103,7 +102,7 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
case UserPreferenceCategory.General:
|
case UserPreferenceCategory.General:
|
||||||
Debug.WriteLine("Theme Changed");
|
Debug.WriteLine("Theme Changed");
|
||||||
Thread.Sleep(500);
|
Thread.Sleep(1000);
|
||||||
settingsForm.InitTheme(false);
|
settingsForm.InitTheme(false);
|
||||||
|
|
||||||
if (settingsForm.fans is not null && settingsForm.fans.Text != "")
|
if (settingsForm.fans is not null && settingsForm.fans.Text != "")
|
||||||
@@ -117,67 +116,32 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static async void CheckForUpdates()
|
|
||||||
{
|
|
||||||
|
|
||||||
try
|
public static void SetAutoModes()
|
||||||
{
|
|
||||||
using (var httpClient = new HttpClient())
|
|
||||||
{
|
|
||||||
httpClient.DefaultRequestHeaders.Add("User-Agent", "C# App");
|
|
||||||
var json = await httpClient.GetStringAsync("https://api.github.com/repos/seerge/g-helper/releases/latest");
|
|
||||||
var config = JsonSerializer.Deserialize<JsonElement>(json);
|
|
||||||
var tag = config.GetProperty("tag_name").ToString().Replace("v", "");
|
|
||||||
var url = config.GetProperty("assets")[0].GetProperty("browser_download_url").ToString();
|
|
||||||
|
|
||||||
var gitVersion = new Version(tag);
|
|
||||||
var appVersion = new Version(Assembly.GetExecutingAssembly().GetName().Version.ToString());
|
|
||||||
if (gitVersion.CompareTo(appVersion) > 0)
|
|
||||||
{
|
|
||||||
settingsForm.BeginInvoke(delegate
|
|
||||||
{
|
|
||||||
settingsForm.SetVersionLabel("Download Update: " + tag, url);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Logger.WriteLine("Failed to check for updates:"+ ex.Message);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void SetAutoModes(bool wait = false)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastAuto) < 2000) return;
|
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastAuto) < 2000) return;
|
||||||
lastAuto = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
lastAuto = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
||||||
|
|
||||||
PowerLineStatus isPlugged = SystemInformation.PowerStatus.PowerLineStatus;
|
isPlugged = SystemInformation.PowerStatus.PowerLineStatus;
|
||||||
|
|
||||||
Logger.WriteLine("AutoSetting for " + isPlugged.ToString());
|
Logger.WriteLine("AutoSetting for " + isPlugged.ToString());
|
||||||
|
|
||||||
settingsForm.SetBatteryChargeLimit(config.getConfig("charge_limit"));
|
settingsForm.SetBatteryChargeLimit(config.getConfig("charge_limit"));
|
||||||
|
settingsForm.AutoPerformance();
|
||||||
|
|
||||||
settingsForm.AutoPerformance(isPlugged);
|
bool switched = settingsForm.AutoGPUMode();
|
||||||
|
if (!switched) settingsForm.AutoScreen();
|
||||||
|
|
||||||
// waiting a bit before turning off dGPU
|
settingsForm.SetMatrix();
|
||||||
// if (wait && isPlugged != PowerLineStatus.Online) Thread.Sleep(3000);
|
|
||||||
|
|
||||||
bool switched = settingsForm.AutoGPUMode(isPlugged);
|
|
||||||
if (!switched) settingsForm.AutoScreen(isPlugged);
|
|
||||||
|
|
||||||
settingsForm.SetMatrix(isPlugged);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
private static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (SystemInformation.PowerStatus.PowerLineStatus == isPlugged) return;
|
||||||
|
|
||||||
Logger.WriteLine("Windows - Power Mode Changed");
|
Logger.WriteLine("Windows - Power Mode Changed");
|
||||||
SetAutoModes(true);
|
settingsForm.AutoKeyboard();
|
||||||
|
SetAutoModes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
131
app/Settings.Designer.cs
generated
131
app/Settings.Designer.cs
generated
@@ -35,11 +35,12 @@ namespace GHelper
|
|||||||
checkMatrix = new CheckBox();
|
checkMatrix = new CheckBox();
|
||||||
tableLayoutMatrix = new TableLayoutPanel();
|
tableLayoutMatrix = new TableLayoutPanel();
|
||||||
comboMatrix = new RComboBox();
|
comboMatrix = new RComboBox();
|
||||||
buttonMatrix = new RButton();
|
|
||||||
comboMatrixRunning = new RComboBox();
|
comboMatrixRunning = new RComboBox();
|
||||||
|
buttonMatrix = new RButton();
|
||||||
pictureMatrix = new PictureBox();
|
pictureMatrix = new PictureBox();
|
||||||
labelMatrix = new Label();
|
labelMatrix = new Label();
|
||||||
panelBattery = new Panel();
|
panelBattery = new Panel();
|
||||||
|
labelModel = new Label();
|
||||||
labelVersion = new Label();
|
labelVersion = new Label();
|
||||||
labelBattery = new Label();
|
labelBattery = new Label();
|
||||||
pictureBattery = new PictureBox();
|
pictureBattery = new PictureBox();
|
||||||
@@ -79,12 +80,12 @@ namespace GHelper
|
|||||||
labelSreen = new Label();
|
labelSreen = new Label();
|
||||||
panelKeyboard = new Panel();
|
panelKeyboard = new Panel();
|
||||||
tableLayoutKeyboard = new TableLayoutPanel();
|
tableLayoutKeyboard = new TableLayoutPanel();
|
||||||
buttonKeyboard = new RButton();
|
|
||||||
comboKeyboard = new RComboBox();
|
comboKeyboard = new RComboBox();
|
||||||
panelColor = new Panel();
|
panelColor = new Panel();
|
||||||
pictureColor2 = new PictureBox();
|
pictureColor2 = new PictureBox();
|
||||||
pictureColor = new PictureBox();
|
pictureColor = new PictureBox();
|
||||||
buttonKeyboardColor = new RButton();
|
buttonKeyboardColor = new RButton();
|
||||||
|
buttonKeyboard = new RButton();
|
||||||
pictureKeyboard = new PictureBox();
|
pictureKeyboard = new PictureBox();
|
||||||
labelKeyboard = new Label();
|
labelKeyboard = new Label();
|
||||||
panelMatrix.SuspendLayout();
|
panelMatrix.SuspendLayout();
|
||||||
@@ -144,20 +145,20 @@ namespace GHelper
|
|||||||
tableLayoutMatrix.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
tableLayoutMatrix.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
tableLayoutMatrix.AutoSize = true;
|
tableLayoutMatrix.AutoSize = true;
|
||||||
tableLayoutMatrix.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
tableLayoutMatrix.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
tableLayoutMatrix.ColumnCount = 4;
|
tableLayoutMatrix.ColumnCount = 3;
|
||||||
tableLayoutMatrix.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
tableLayoutMatrix.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
tableLayoutMatrix.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
tableLayoutMatrix.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
tableLayoutMatrix.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
tableLayoutMatrix.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
tableLayoutMatrix.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
tableLayoutMatrix.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
tableLayoutMatrix.Controls.Add(comboMatrix, 0, 0);
|
tableLayoutMatrix.Controls.Add(comboMatrix, 0, 0);
|
||||||
tableLayoutMatrix.Controls.Add(buttonMatrix, 2, 0);
|
|
||||||
tableLayoutMatrix.Controls.Add(comboMatrixRunning, 1, 0);
|
tableLayoutMatrix.Controls.Add(comboMatrixRunning, 1, 0);
|
||||||
|
tableLayoutMatrix.Controls.Add(buttonMatrix, 2, 0);
|
||||||
tableLayoutMatrix.Location = new Point(16, 52);
|
tableLayoutMatrix.Location = new Point(16, 52);
|
||||||
tableLayoutMatrix.Margin = new Padding(8);
|
tableLayoutMatrix.Margin = new Padding(8);
|
||||||
tableLayoutMatrix.Name = "tableLayoutMatrix";
|
tableLayoutMatrix.Name = "tableLayoutMatrix";
|
||||||
tableLayoutMatrix.RowCount = 1;
|
tableLayoutMatrix.RowCount = 1;
|
||||||
tableLayoutMatrix.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
tableLayoutMatrix.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
||||||
tableLayoutMatrix.Size = new Size(772, 60);
|
tableLayoutMatrix.Size = new Size(771, 60);
|
||||||
tableLayoutMatrix.TabIndex = 43;
|
tableLayoutMatrix.TabIndex = 43;
|
||||||
//
|
//
|
||||||
// comboMatrix
|
// comboMatrix
|
||||||
@@ -172,28 +173,10 @@ namespace GHelper
|
|||||||
comboMatrix.Location = new Point(4, 10);
|
comboMatrix.Location = new Point(4, 10);
|
||||||
comboMatrix.Margin = new Padding(4, 10, 4, 8);
|
comboMatrix.Margin = new Padding(4, 10, 4, 8);
|
||||||
comboMatrix.Name = "comboMatrix";
|
comboMatrix.Name = "comboMatrix";
|
||||||
comboMatrix.Size = new Size(185, 40);
|
comboMatrix.Size = new Size(249, 40);
|
||||||
comboMatrix.TabIndex = 41;
|
comboMatrix.TabIndex = 41;
|
||||||
comboMatrix.TabStop = false;
|
comboMatrix.TabStop = false;
|
||||||
//
|
//
|
||||||
// buttonMatrix
|
|
||||||
//
|
|
||||||
buttonMatrix.Activated = false;
|
|
||||||
buttonMatrix.BackColor = Color.FromArgb(230, 230, 230);
|
|
||||||
buttonMatrix.BorderColor = Color.Transparent;
|
|
||||||
buttonMatrix.BorderRadius = 2;
|
|
||||||
buttonMatrix.Dock = DockStyle.Top;
|
|
||||||
buttonMatrix.FlatAppearance.BorderSize = 0;
|
|
||||||
buttonMatrix.FlatStyle = FlatStyle.Flat;
|
|
||||||
buttonMatrix.Location = new Point(390, 8);
|
|
||||||
buttonMatrix.Margin = new Padding(4, 8, 4, 8);
|
|
||||||
buttonMatrix.Name = "buttonMatrix";
|
|
||||||
buttonMatrix.Secondary = true;
|
|
||||||
buttonMatrix.Size = new Size(185, 44);
|
|
||||||
buttonMatrix.TabIndex = 43;
|
|
||||||
buttonMatrix.Text = "Picture / Gif";
|
|
||||||
buttonMatrix.UseVisualStyleBackColor = false;
|
|
||||||
//
|
|
||||||
// comboMatrixRunning
|
// comboMatrixRunning
|
||||||
//
|
//
|
||||||
comboMatrixRunning.BorderColor = Color.White;
|
comboMatrixRunning.BorderColor = Color.White;
|
||||||
@@ -203,13 +186,31 @@ namespace GHelper
|
|||||||
comboMatrixRunning.FormattingEnabled = true;
|
comboMatrixRunning.FormattingEnabled = true;
|
||||||
comboMatrixRunning.ItemHeight = 32;
|
comboMatrixRunning.ItemHeight = 32;
|
||||||
comboMatrixRunning.Items.AddRange(new object[] { "Binary Banner", "Rog Logo", "Picture", "Clock" });
|
comboMatrixRunning.Items.AddRange(new object[] { "Binary Banner", "Rog Logo", "Picture", "Clock" });
|
||||||
comboMatrixRunning.Location = new Point(197, 10);
|
comboMatrixRunning.Location = new Point(261, 10);
|
||||||
comboMatrixRunning.Margin = new Padding(4, 10, 4, 8);
|
comboMatrixRunning.Margin = new Padding(4, 10, 4, 8);
|
||||||
comboMatrixRunning.Name = "comboMatrixRunning";
|
comboMatrixRunning.Name = "comboMatrixRunning";
|
||||||
comboMatrixRunning.Size = new Size(185, 40);
|
comboMatrixRunning.Size = new Size(249, 40);
|
||||||
comboMatrixRunning.TabIndex = 42;
|
comboMatrixRunning.TabIndex = 42;
|
||||||
comboMatrixRunning.TabStop = false;
|
comboMatrixRunning.TabStop = false;
|
||||||
//
|
//
|
||||||
|
// buttonMatrix
|
||||||
|
//
|
||||||
|
buttonMatrix.Activated = false;
|
||||||
|
buttonMatrix.BackColor = Color.FromArgb(230, 230, 230);
|
||||||
|
buttonMatrix.BorderColor = Color.Transparent;
|
||||||
|
buttonMatrix.BorderRadius = 2;
|
||||||
|
buttonMatrix.Dock = DockStyle.Top;
|
||||||
|
buttonMatrix.FlatAppearance.BorderSize = 0;
|
||||||
|
buttonMatrix.FlatStyle = FlatStyle.Flat;
|
||||||
|
buttonMatrix.Location = new Point(518, 8);
|
||||||
|
buttonMatrix.Margin = new Padding(4, 8, 4, 8);
|
||||||
|
buttonMatrix.Name = "buttonMatrix";
|
||||||
|
buttonMatrix.Secondary = true;
|
||||||
|
buttonMatrix.Size = new Size(249, 44);
|
||||||
|
buttonMatrix.TabIndex = 43;
|
||||||
|
buttonMatrix.Text = "Picture / Gif";
|
||||||
|
buttonMatrix.UseVisualStyleBackColor = false;
|
||||||
|
//
|
||||||
// pictureMatrix
|
// pictureMatrix
|
||||||
//
|
//
|
||||||
pictureMatrix.BackgroundImage = Properties.Resources.icons8_matrix_desktop_48;
|
pictureMatrix.BackgroundImage = Properties.Resources.icons8_matrix_desktop_48;
|
||||||
@@ -236,6 +237,7 @@ namespace GHelper
|
|||||||
//
|
//
|
||||||
panelBattery.AutoSize = true;
|
panelBattery.AutoSize = true;
|
||||||
panelBattery.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
panelBattery.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
|
panelBattery.Controls.Add(labelModel);
|
||||||
panelBattery.Controls.Add(labelVersion);
|
panelBattery.Controls.Add(labelVersion);
|
||||||
panelBattery.Controls.Add(labelBattery);
|
panelBattery.Controls.Add(labelBattery);
|
||||||
panelBattery.Controls.Add(pictureBattery);
|
panelBattery.Controls.Add(pictureBattery);
|
||||||
@@ -246,15 +248,27 @@ namespace GHelper
|
|||||||
panelBattery.Margin = new Padding(8);
|
panelBattery.Margin = new Padding(8);
|
||||||
panelBattery.Name = "panelBattery";
|
panelBattery.Name = "panelBattery";
|
||||||
panelBattery.Padding = new Padding(0, 0, 0, 12);
|
panelBattery.Padding = new Padding(0, 0, 0, 12);
|
||||||
panelBattery.Size = new Size(810, 158);
|
panelBattery.Size = new Size(810, 163);
|
||||||
panelBattery.TabIndex = 34;
|
panelBattery.TabIndex = 34;
|
||||||
//
|
//
|
||||||
|
// labelModel
|
||||||
|
//
|
||||||
|
labelModel.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
|
labelModel.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
|
labelModel.ForeColor = SystemColors.ControlDark;
|
||||||
|
labelModel.Location = new Point(291, 119);
|
||||||
|
labelModel.Margin = new Padding(8, 0, 8, 0);
|
||||||
|
labelModel.Name = "labelModel";
|
||||||
|
labelModel.Size = new Size(492, 32);
|
||||||
|
labelModel.TabIndex = 38;
|
||||||
|
labelModel.TextAlign = ContentAlignment.TopRight;
|
||||||
|
//
|
||||||
// labelVersion
|
// labelVersion
|
||||||
//
|
//
|
||||||
labelVersion.AutoSize = true;
|
labelVersion.AutoSize = true;
|
||||||
labelVersion.Font = new Font("Segoe UI", 9F, FontStyle.Underline, GraphicsUnit.Point);
|
labelVersion.Font = new Font("Segoe UI", 9F, FontStyle.Underline, GraphicsUnit.Point);
|
||||||
labelVersion.ForeColor = SystemColors.ControlDark;
|
labelVersion.ForeColor = SystemColors.ControlDark;
|
||||||
labelVersion.Location = new Point(25, 109);
|
labelVersion.Location = new Point(25, 119);
|
||||||
labelVersion.Margin = new Padding(8, 0, 8, 0);
|
labelVersion.Margin = new Padding(8, 0, 8, 0);
|
||||||
labelVersion.Name = "labelVersion";
|
labelVersion.Name = "labelVersion";
|
||||||
labelVersion.Size = new Size(44, 32);
|
labelVersion.Size = new Size(44, 32);
|
||||||
@@ -316,7 +330,7 @@ namespace GHelper
|
|||||||
panelFooter.Controls.Add(buttonQuit);
|
panelFooter.Controls.Add(buttonQuit);
|
||||||
panelFooter.Controls.Add(checkStartup);
|
panelFooter.Controls.Add(checkStartup);
|
||||||
panelFooter.Dock = DockStyle.Top;
|
panelFooter.Dock = DockStyle.Top;
|
||||||
panelFooter.Location = new Point(10, 1084);
|
panelFooter.Location = new Point(10, 1089);
|
||||||
panelFooter.Margin = new Padding(8);
|
panelFooter.Margin = new Padding(8);
|
||||||
panelFooter.Name = "panelFooter";
|
panelFooter.Name = "panelFooter";
|
||||||
panelFooter.Padding = new Padding(0, 0, 0, 10);
|
panelFooter.Padding = new Padding(0, 0, 0, 10);
|
||||||
@@ -863,40 +877,22 @@ namespace GHelper
|
|||||||
tableLayoutKeyboard.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
tableLayoutKeyboard.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
||||||
tableLayoutKeyboard.AutoSize = true;
|
tableLayoutKeyboard.AutoSize = true;
|
||||||
tableLayoutKeyboard.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
tableLayoutKeyboard.AutoSizeMode = AutoSizeMode.GrowAndShrink;
|
||||||
tableLayoutKeyboard.ColumnCount = 4;
|
tableLayoutKeyboard.ColumnCount = 3;
|
||||||
tableLayoutKeyboard.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
tableLayoutKeyboard.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
tableLayoutKeyboard.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
tableLayoutKeyboard.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
tableLayoutKeyboard.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
tableLayoutKeyboard.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
tableLayoutKeyboard.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
tableLayoutKeyboard.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
|
||||||
tableLayoutKeyboard.Controls.Add(buttonKeyboard, 2, 0);
|
|
||||||
tableLayoutKeyboard.Controls.Add(comboKeyboard, 0, 0);
|
tableLayoutKeyboard.Controls.Add(comboKeyboard, 0, 0);
|
||||||
tableLayoutKeyboard.Controls.Add(panelColor, 1, 0);
|
tableLayoutKeyboard.Controls.Add(panelColor, 1, 0);
|
||||||
|
tableLayoutKeyboard.Controls.Add(buttonKeyboard, 2, 0);
|
||||||
tableLayoutKeyboard.Location = new Point(16, 50);
|
tableLayoutKeyboard.Location = new Point(16, 50);
|
||||||
tableLayoutKeyboard.Margin = new Padding(8);
|
tableLayoutKeyboard.Margin = new Padding(8);
|
||||||
tableLayoutKeyboard.Name = "tableLayoutKeyboard";
|
tableLayoutKeyboard.Name = "tableLayoutKeyboard";
|
||||||
tableLayoutKeyboard.RowCount = 1;
|
tableLayoutKeyboard.RowCount = 1;
|
||||||
tableLayoutKeyboard.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
tableLayoutKeyboard.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
|
||||||
tableLayoutKeyboard.Size = new Size(772, 60);
|
tableLayoutKeyboard.Size = new Size(771, 60);
|
||||||
tableLayoutKeyboard.TabIndex = 39;
|
tableLayoutKeyboard.TabIndex = 39;
|
||||||
//
|
//
|
||||||
// buttonKeyboard
|
|
||||||
//
|
|
||||||
buttonKeyboard.Activated = false;
|
|
||||||
buttonKeyboard.BackColor = Color.FromArgb(230, 230, 230);
|
|
||||||
buttonKeyboard.BorderColor = Color.Transparent;
|
|
||||||
buttonKeyboard.BorderRadius = 2;
|
|
||||||
buttonKeyboard.Dock = DockStyle.Top;
|
|
||||||
buttonKeyboard.FlatAppearance.BorderSize = 0;
|
|
||||||
buttonKeyboard.FlatStyle = FlatStyle.Flat;
|
|
||||||
buttonKeyboard.Location = new Point(390, 8);
|
|
||||||
buttonKeyboard.Margin = new Padding(4, 8, 4, 8);
|
|
||||||
buttonKeyboard.Name = "buttonKeyboard";
|
|
||||||
buttonKeyboard.Secondary = true;
|
|
||||||
buttonKeyboard.Size = new Size(185, 44);
|
|
||||||
buttonKeyboard.TabIndex = 37;
|
|
||||||
buttonKeyboard.Text = "Extra";
|
|
||||||
buttonKeyboard.UseVisualStyleBackColor = false;
|
|
||||||
//
|
|
||||||
// comboKeyboard
|
// comboKeyboard
|
||||||
//
|
//
|
||||||
comboKeyboard.BorderColor = Color.White;
|
comboKeyboard.BorderColor = Color.White;
|
||||||
@@ -906,11 +902,11 @@ namespace GHelper
|
|||||||
comboKeyboard.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
comboKeyboard.Font = new Font("Segoe UI", 9F, FontStyle.Regular, GraphicsUnit.Point);
|
||||||
comboKeyboard.FormattingEnabled = true;
|
comboKeyboard.FormattingEnabled = true;
|
||||||
comboKeyboard.ItemHeight = 32;
|
comboKeyboard.ItemHeight = 32;
|
||||||
comboKeyboard.Items.AddRange(new object[] { "Static", "Breathe", "Strobe", "Rainbow", "Dingding" });
|
comboKeyboard.Items.AddRange(new object[] { "Static", "Breathe", "Rainbow", "Strobe" });
|
||||||
comboKeyboard.Location = new Point(4, 10);
|
comboKeyboard.Location = new Point(4, 10);
|
||||||
comboKeyboard.Margin = new Padding(4, 10, 4, 8);
|
comboKeyboard.Margin = new Padding(4, 10, 4, 8);
|
||||||
comboKeyboard.Name = "comboKeyboard";
|
comboKeyboard.Name = "comboKeyboard";
|
||||||
comboKeyboard.Size = new Size(185, 40);
|
comboKeyboard.Size = new Size(249, 40);
|
||||||
comboKeyboard.TabIndex = 35;
|
comboKeyboard.TabIndex = 35;
|
||||||
comboKeyboard.TabStop = false;
|
comboKeyboard.TabStop = false;
|
||||||
//
|
//
|
||||||
@@ -921,16 +917,16 @@ namespace GHelper
|
|||||||
panelColor.Controls.Add(pictureColor);
|
panelColor.Controls.Add(pictureColor);
|
||||||
panelColor.Controls.Add(buttonKeyboardColor);
|
panelColor.Controls.Add(buttonKeyboardColor);
|
||||||
panelColor.Dock = DockStyle.Fill;
|
panelColor.Dock = DockStyle.Fill;
|
||||||
panelColor.Location = new Point(197, 8);
|
panelColor.Location = new Point(261, 8);
|
||||||
panelColor.Margin = new Padding(4, 8, 4, 8);
|
panelColor.Margin = new Padding(4, 8, 4, 8);
|
||||||
panelColor.Name = "panelColor";
|
panelColor.Name = "panelColor";
|
||||||
panelColor.Size = new Size(185, 44);
|
panelColor.Size = new Size(249, 44);
|
||||||
panelColor.TabIndex = 36;
|
panelColor.TabIndex = 36;
|
||||||
//
|
//
|
||||||
// pictureColor2
|
// pictureColor2
|
||||||
//
|
//
|
||||||
pictureColor2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
pictureColor2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
pictureColor2.Location = new Point(123, 12);
|
pictureColor2.Location = new Point(188, 12);
|
||||||
pictureColor2.Margin = new Padding(8);
|
pictureColor2.Margin = new Padding(8);
|
||||||
pictureColor2.Name = "pictureColor2";
|
pictureColor2.Name = "pictureColor2";
|
||||||
pictureColor2.Size = new Size(20, 20);
|
pictureColor2.Size = new Size(20, 20);
|
||||||
@@ -940,7 +936,7 @@ namespace GHelper
|
|||||||
// pictureColor
|
// pictureColor
|
||||||
//
|
//
|
||||||
pictureColor.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
pictureColor.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||||
pictureColor.Location = new Point(151, 12);
|
pictureColor.Location = new Point(215, 12);
|
||||||
pictureColor.Margin = new Padding(8);
|
pictureColor.Margin = new Padding(8);
|
||||||
pictureColor.Name = "pictureColor";
|
pictureColor.Name = "pictureColor";
|
||||||
pictureColor.Size = new Size(20, 20);
|
pictureColor.Size = new Size(20, 20);
|
||||||
@@ -960,11 +956,29 @@ namespace GHelper
|
|||||||
buttonKeyboardColor.Margin = new Padding(4, 8, 4, 8);
|
buttonKeyboardColor.Margin = new Padding(4, 8, 4, 8);
|
||||||
buttonKeyboardColor.Name = "buttonKeyboardColor";
|
buttonKeyboardColor.Name = "buttonKeyboardColor";
|
||||||
buttonKeyboardColor.Secondary = false;
|
buttonKeyboardColor.Secondary = false;
|
||||||
buttonKeyboardColor.Size = new Size(185, 44);
|
buttonKeyboardColor.Size = new Size(249, 44);
|
||||||
buttonKeyboardColor.TabIndex = 39;
|
buttonKeyboardColor.TabIndex = 39;
|
||||||
buttonKeyboardColor.Text = "Color ";
|
buttonKeyboardColor.Text = "Color";
|
||||||
buttonKeyboardColor.UseVisualStyleBackColor = false;
|
buttonKeyboardColor.UseVisualStyleBackColor = false;
|
||||||
//
|
//
|
||||||
|
// buttonKeyboard
|
||||||
|
//
|
||||||
|
buttonKeyboard.Activated = false;
|
||||||
|
buttonKeyboard.BackColor = Color.FromArgb(230, 230, 230);
|
||||||
|
buttonKeyboard.BorderColor = Color.Transparent;
|
||||||
|
buttonKeyboard.BorderRadius = 2;
|
||||||
|
buttonKeyboard.Dock = DockStyle.Top;
|
||||||
|
buttonKeyboard.FlatAppearance.BorderSize = 0;
|
||||||
|
buttonKeyboard.FlatStyle = FlatStyle.Flat;
|
||||||
|
buttonKeyboard.Location = new Point(518, 8);
|
||||||
|
buttonKeyboard.Margin = new Padding(4, 8, 4, 8);
|
||||||
|
buttonKeyboard.Name = "buttonKeyboard";
|
||||||
|
buttonKeyboard.Secondary = true;
|
||||||
|
buttonKeyboard.Size = new Size(249, 44);
|
||||||
|
buttonKeyboard.TabIndex = 37;
|
||||||
|
buttonKeyboard.Text = "Extra";
|
||||||
|
buttonKeyboard.UseVisualStyleBackColor = false;
|
||||||
|
//
|
||||||
// pictureKeyboard
|
// pictureKeyboard
|
||||||
//
|
//
|
||||||
pictureKeyboard.BackgroundImage = Properties.Resources.icons8_keyboard_48;
|
pictureKeyboard.BackgroundImage = Properties.Resources.icons8_keyboard_48;
|
||||||
@@ -1103,5 +1117,6 @@ namespace GHelper
|
|||||||
private RButton buttonKeyboardColor;
|
private RButton buttonKeyboardColor;
|
||||||
private RButton buttonFans;
|
private RButton buttonFans;
|
||||||
private Label labelMidFan;
|
private Label labelMidFan;
|
||||||
|
private Label labelModel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
319
app/Settings.cs
319
app/Settings.cs
@@ -2,6 +2,9 @@
|
|||||||
using Starlight.AnimeMatrix;
|
using Starlight.AnimeMatrix;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Drawing.Imaging;
|
using System.Drawing.Imaging;
|
||||||
|
using System.Globalization;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text.Json;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
|
|
||||||
namespace GHelper
|
namespace GHelper
|
||||||
@@ -23,7 +26,8 @@ namespace GHelper
|
|||||||
public Keyboard keyb;
|
public Keyboard keyb;
|
||||||
|
|
||||||
static AnimeMatrixDevice mat;
|
static AnimeMatrixDevice mat;
|
||||||
static long lastTip;
|
static int matrixTick = 0;
|
||||||
|
static long lastRefresh;
|
||||||
|
|
||||||
public SettingsForm()
|
public SettingsForm()
|
||||||
{
|
{
|
||||||
@@ -57,8 +61,6 @@ namespace GHelper
|
|||||||
|
|
||||||
VisibleChanged += SettingsForm_VisibleChanged;
|
VisibleChanged += SettingsForm_VisibleChanged;
|
||||||
|
|
||||||
trackBattery.Scroll += trackBatteryChange;
|
|
||||||
|
|
||||||
button60Hz.Click += Button60Hz_Click;
|
button60Hz.Click += Button60Hz_Click;
|
||||||
button120Hz.Click += Button120Hz_Click;
|
button120Hz.Click += Button120Hz_Click;
|
||||||
buttonScreenAuto.Click += ButtonScreenAuto_Click;
|
buttonScreenAuto.Click += ButtonScreenAuto_Click;
|
||||||
@@ -66,10 +68,6 @@ namespace GHelper
|
|||||||
|
|
||||||
buttonQuit.Click += ButtonQuit_Click;
|
buttonQuit.Click += ButtonQuit_Click;
|
||||||
|
|
||||||
comboKeyboard.DropDownStyle = ComboBoxStyle.DropDownList;
|
|
||||||
comboKeyboard.SelectedIndex = 0;
|
|
||||||
comboKeyboard.SelectedValueChanged += ComboKeyboard_SelectedValueChanged;
|
|
||||||
|
|
||||||
buttonKeyboardColor.Click += ButtonKeyboardColor_Click;
|
buttonKeyboardColor.Click += ButtonKeyboardColor_Click;
|
||||||
|
|
||||||
buttonFans.Click += ButtonFans_Click;
|
buttonFans.Click += ButtonFans_Click;
|
||||||
@@ -117,6 +115,7 @@ namespace GHelper
|
|||||||
button120Hz.MouseMove += Button120Hz_MouseHover;
|
button120Hz.MouseMove += Button120Hz_MouseHover;
|
||||||
button120Hz.MouseLeave += ButtonScreen_MouseLeave;
|
button120Hz.MouseLeave += ButtonScreen_MouseLeave;
|
||||||
|
|
||||||
|
trackBattery.ValueChanged += TrackBattery_ValueChanged;
|
||||||
Program.trayIcon.MouseMove += TrayIcon_MouseMove;
|
Program.trayIcon.MouseMove += TrayIcon_MouseMove;
|
||||||
|
|
||||||
//buttonStandard.Image = (Image)(new Bitmap(buttonStandard.Image, new Size(16, 16)));
|
//buttonStandard.Image = (Image)(new Bitmap(buttonStandard.Image, new Size(16, 16)));
|
||||||
@@ -124,26 +123,89 @@ namespace GHelper
|
|||||||
aTimer = new System.Timers.Timer(500);
|
aTimer = new System.Timers.Timer(500);
|
||||||
aTimer.Elapsed += OnTimedEvent;
|
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();
|
||||||
|
int trim = model.LastIndexOf("_");
|
||||||
|
if (trim > 0) model = model.Substring(0, trim);
|
||||||
|
|
||||||
|
labelModel.Text = model;
|
||||||
|
|
||||||
|
this.TopMost = Program.config.getConfig("topmost") == 1;
|
||||||
|
|
||||||
|
Task.Run(async () =>
|
||||||
|
{
|
||||||
|
await Task.Delay(TimeSpan.FromSeconds(5));
|
||||||
|
CheckForUpdatesAsync();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void TrackBattery_ValueChanged(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SetBatteryChargeLimit(trackBattery.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async void CheckForUpdatesAsync()
|
||||||
|
{
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
using (var httpClient = new HttpClient())
|
||||||
|
{
|
||||||
|
httpClient.DefaultRequestHeaders.Add("User-Agent", "C# App");
|
||||||
|
var json = await httpClient.GetStringAsync("https://api.github.com/repos/seerge/g-helper/releases/latest");
|
||||||
|
var config = JsonSerializer.Deserialize<JsonElement>(json);
|
||||||
|
var tag = config.GetProperty("tag_name").ToString().Replace("v", "");
|
||||||
|
var url = config.GetProperty("assets")[0].GetProperty("browser_download_url").ToString();
|
||||||
|
|
||||||
|
var gitVersion = new Version(tag);
|
||||||
|
var appVersion = new Version(Assembly.GetExecutingAssembly().GetName().Version.ToString());
|
||||||
|
|
||||||
|
if (gitVersion.CompareTo(appVersion) > 0)
|
||||||
|
{
|
||||||
|
BeginInvoke(delegate
|
||||||
|
{
|
||||||
|
SetVersionLabel("Download Update: " + tag, url);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.WriteLine("Latest version");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
//Logger.WriteLine("Failed to check for updates:" + ex.Message);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void TrayIcon_MouseMove(object? sender, MouseEventArgs e)
|
private static void TrayIcon_MouseMove(object? sender, MouseEventArgs e)
|
||||||
{
|
{
|
||||||
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastTip) < 2000) return;
|
|
||||||
lastTip = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
|
||||||
RefreshSensors();
|
RefreshSensors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void OnTimedEvent(Object? source, ElapsedEventArgs? e)
|
private static void OnTimedEvent(Object? source, ElapsedEventArgs? e)
|
||||||
{
|
{
|
||||||
aTimer.Interval = 2000;
|
RefreshSensors();
|
||||||
if (Program.settingsForm.Visible)
|
|
||||||
RefreshSensors();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button120Hz_MouseHover(object? sender, EventArgs e)
|
private void Button120Hz_MouseHover(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
labelTipScreen.Text = "Max refresh rate + screen overdrive for lower latency";
|
labelTipScreen.Text = "Max refresh rate for lower latency";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button60Hz_MouseHover(object? sender, EventArgs e)
|
private void Button60Hz_MouseHover(object? sender, EventArgs e)
|
||||||
@@ -191,18 +253,19 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
Program.config.setConfig("gpu_auto", (Program.config.getConfig("gpu_auto") == 1) ? 0 : 1);
|
Program.config.setConfig("gpu_auto", (Program.config.getConfig("gpu_auto") == 1) ? 0 : 1);
|
||||||
VisualiseGPUMode();
|
VisualiseGPUMode();
|
||||||
AutoGPUMode(SystemInformation.PowerStatus.PowerLineStatus);
|
AutoGPUMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonScreenAuto_Click(object? sender, EventArgs e)
|
private void ButtonScreenAuto_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("screen_auto", 1);
|
Program.config.setConfig("screen_auto", 1);
|
||||||
InitScreen();
|
InitScreen();
|
||||||
AutoScreen(SystemInformation.PowerStatus.PowerLineStatus);
|
AutoScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void WndProc(ref Message m)
|
protected override void WndProc(ref Message m)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch (m.Msg)
|
switch (m.Msg)
|
||||||
{
|
{
|
||||||
case NativeMethods.WM_POWERBROADCAST:
|
case NativeMethods.WM_POWERBROADCAST:
|
||||||
@@ -213,6 +276,7 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
Logger.WriteLine("Monitor Power Off");
|
Logger.WriteLine("Monitor Power Off");
|
||||||
|
SetBatteryChargeLimit(Program.config.getConfig("charge_limit"));
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
Logger.WriteLine("Monitor Power On");
|
Logger.WriteLine("Monitor Power On");
|
||||||
@@ -233,12 +297,12 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void SetVersionLabel(string label, string url = null)
|
void SetVersionLabel(string label, string url = null)
|
||||||
{
|
{
|
||||||
labelVersion.Text = label;
|
labelVersion.Text = label;
|
||||||
if (url is not null)
|
if (url is not null)
|
||||||
{
|
{
|
||||||
versionUrl = url;
|
this.versionUrl = url;
|
||||||
labelVersion.ForeColor = Color.Red;
|
labelVersion.ForeColor = Color.Red;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -293,7 +357,27 @@ namespace GHelper
|
|||||||
mat.PresentNextFrame();
|
mat.PresentNextFrame();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
mat.PresentText(DateTime.Now.ToString("H:mm:ss"));
|
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));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,7 +479,7 @@ namespace GHelper
|
|||||||
SetMatrix();
|
SetMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetMatrix(PowerLineStatus Plugged = PowerLineStatus.Online)
|
public void SetMatrix()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (mat is null) return;
|
if (mat is null) return;
|
||||||
@@ -418,7 +502,7 @@ namespace GHelper
|
|||||||
|
|
||||||
mat.SetProvider();
|
mat.SetProvider();
|
||||||
|
|
||||||
if (brightness == 0 || (auto && Plugged != PowerLineStatus.Online))
|
if (brightness == 0 || (auto && SystemInformation.PowerStatus.PowerLineStatus != PowerLineStatus.Online))
|
||||||
{
|
{
|
||||||
mat.SetDisplayState(false);
|
mat.SetDisplayState(false);
|
||||||
}
|
}
|
||||||
@@ -452,19 +536,20 @@ namespace GHelper
|
|||||||
private void LabelCPUFan_Click(object? sender, EventArgs e)
|
private void LabelCPUFan_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("fan_rpm", (Program.config.getConfig("fan_rpm") == 1) ? 0 : 1);
|
Program.config.setConfig("fan_rpm", (Program.config.getConfig("fan_rpm") == 1) ? 0 : 1);
|
||||||
RefreshSensors();
|
RefreshSensors(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PictureColor2_Click(object? sender, EventArgs e)
|
private void PictureColor2_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
ColorDialog colorDlg = new ColorDialog();
|
ColorDialog colorDlg = new ColorDialog();
|
||||||
colorDlg.AllowFullOpen = false;
|
colorDlg.AllowFullOpen = true;
|
||||||
colorDlg.Color = pictureColor2.BackColor;
|
colorDlg.Color = pictureColor2.BackColor;
|
||||||
|
|
||||||
if (colorDlg.ShowDialog() == DialogResult.OK)
|
if (colorDlg.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
SetAuraColor(color2: colorDlg.Color);
|
Program.config.setConfig("aura_color2", colorDlg.Color.ToArgb());
|
||||||
|
SetAura();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -509,45 +594,34 @@ namespace GHelper
|
|||||||
private void ButtonKeyboardColor_Click(object? sender, EventArgs e)
|
private void ButtonKeyboardColor_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (sender is null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Button but = (Button)sender;
|
|
||||||
|
|
||||||
ColorDialog colorDlg = new ColorDialog();
|
ColorDialog colorDlg = new ColorDialog();
|
||||||
colorDlg.AllowFullOpen = false;
|
colorDlg.AllowFullOpen = true;
|
||||||
colorDlg.Color = pictureColor.BackColor;
|
colorDlg.Color = pictureColor.BackColor;
|
||||||
|
|
||||||
if (colorDlg.ShowDialog() == DialogResult.OK)
|
if (colorDlg.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
SetAuraColor(color1: colorDlg.Color);
|
Program.config.setConfig("aura_color", colorDlg.Color.ToArgb());
|
||||||
|
SetAura();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitAura()
|
public void InitAura()
|
||||||
{
|
{
|
||||||
int mode = Program.config.getConfig("aura_mode");
|
Aura.Mode = Program.config.getConfig("aura_mode");
|
||||||
int colorCode = Program.config.getConfig("aura_color");
|
Aura.Speed = Program.config.getConfig("aura_speed");
|
||||||
int colorCode2 = Program.config.getConfig("aura_color2");
|
Aura.SetColor(Program.config.getConfig("aura_color"));
|
||||||
|
Aura.SetColor2(Program.config.getConfig("aura_color2"));
|
||||||
|
|
||||||
int speed = Program.config.getConfig("aura_speed");
|
comboKeyboard.DropDownStyle = ComboBoxStyle.DropDownList;
|
||||||
|
comboKeyboard.DataSource = new BindingSource(Aura.GetModes(), null);
|
||||||
|
comboKeyboard.DisplayMember = "Value";
|
||||||
|
comboKeyboard.ValueMember = "Key";
|
||||||
|
comboKeyboard.SelectedValue = Aura.Mode;
|
||||||
|
comboKeyboard.SelectedValueChanged += ComboKeyboard_SelectedValueChanged;
|
||||||
|
|
||||||
Color color = Color.FromArgb(255, 255, 255);
|
pictureColor.BackColor = Aura.Color1;
|
||||||
Color color2 = Color.FromArgb(0, 0, 0);
|
pictureColor2.BackColor = Aura.Color2;
|
||||||
|
pictureColor2.Visible = Aura.HasSecondColor();
|
||||||
if (mode == -1)
|
|
||||||
mode = 0;
|
|
||||||
|
|
||||||
if (colorCode != -1)
|
|
||||||
color = Color.FromArgb(colorCode);
|
|
||||||
|
|
||||||
if (colorCode2 != -1)
|
|
||||||
color2 = Color.FromArgb(colorCode2);
|
|
||||||
|
|
||||||
SetAuraColor(color, color2, false);
|
|
||||||
SetAuraMode(mode, false);
|
|
||||||
|
|
||||||
Aura.Mode = mode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitMatrix()
|
public void InitMatrix()
|
||||||
@@ -577,67 +651,36 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void SetAuraColor(Color? color1 = null, Color? color2 = null, bool apply = true)
|
public void SetAura()
|
||||||
{
|
{
|
||||||
|
Aura.Mode = Program.config.getConfig("aura_mode");
|
||||||
if (color1 is not null)
|
Aura.Speed = Program.config.getConfig("aura_speed");
|
||||||
{
|
Aura.SetColor(Program.config.getConfig("aura_color"));
|
||||||
Aura.Color1 = (Color)color1;
|
Aura.SetColor2(Program.config.getConfig("aura_color2"));
|
||||||
Program.config.setConfig("aura_color", Aura.Color1.ToArgb());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (color2 is not null)
|
|
||||||
{
|
|
||||||
Aura.Color2 = (Color)color2;
|
|
||||||
Program.config.setConfig("aura_color2", Aura.Color2.ToArgb());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (apply)
|
|
||||||
Aura.ApplyAura();
|
|
||||||
|
|
||||||
pictureColor.BackColor = Aura.Color1;
|
pictureColor.BackColor = Aura.Color1;
|
||||||
pictureColor2.BackColor = Aura.Color2;
|
pictureColor2.BackColor = Aura.Color2;
|
||||||
}
|
pictureColor2.Visible = Aura.HasSecondColor();
|
||||||
|
|
||||||
public void SetAuraMode(int mode = 0, bool apply = true)
|
Aura.ApplyAura();
|
||||||
{
|
|
||||||
|
|
||||||
//Debug.WriteLine(mode);
|
|
||||||
|
|
||||||
if (mode > 4) mode = 0;
|
|
||||||
|
|
||||||
pictureColor2.Visible = (mode == Aura.Breathe);
|
|
||||||
|
|
||||||
if (Aura.Mode == mode) return; // same mode
|
|
||||||
|
|
||||||
Aura.Mode = mode;
|
|
||||||
|
|
||||||
Program.config.setConfig("aura_mode", mode);
|
|
||||||
|
|
||||||
comboKeyboard.SelectedValueChanged -= ComboKeyboard_SelectedValueChanged;
|
|
||||||
comboKeyboard.SelectedIndex = mode;
|
|
||||||
comboKeyboard.SelectedValueChanged += ComboKeyboard_SelectedValueChanged;
|
|
||||||
|
|
||||||
if (apply)
|
|
||||||
Aura.ApplyAura();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CycleAuraMode()
|
public void CycleAuraMode()
|
||||||
{
|
{
|
||||||
SetAuraMode(Program.config.getConfig("aura_mode") + 1);
|
if (comboKeyboard.SelectedIndex < comboKeyboard.Items.Count - 1)
|
||||||
|
comboKeyboard.SelectedIndex += 1;
|
||||||
|
else
|
||||||
|
comboKeyboard.SelectedIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ComboKeyboard_SelectedValueChanged(object? sender, EventArgs e)
|
private void ComboKeyboard_SelectedValueChanged(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is null)
|
Program.config.setConfig("aura_mode", (int)comboKeyboard.SelectedValue);
|
||||||
return;
|
SetAura();
|
||||||
|
|
||||||
ComboBox cmb = (ComboBox)sender;
|
|
||||||
SetAuraMode(cmb.SelectedIndex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void Button120Hz_Click(object? sender, EventArgs e)
|
private void Button120Hz_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("screen_auto", 0);
|
Program.config.setConfig("screen_auto", 0);
|
||||||
@@ -668,8 +711,7 @@ namespace GHelper
|
|||||||
|
|
||||||
if (frequency >= 1000)
|
if (frequency >= 1000)
|
||||||
{
|
{
|
||||||
frequency = Program.config.getConfig("max_frequency");
|
frequency = NativeMethods.GetRefreshRate(true);
|
||||||
if (frequency <= 60) frequency = 120;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frequency > 0)
|
if (frequency > 0)
|
||||||
@@ -679,8 +721,12 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (overdrive >= 0)
|
if (overdrive >= 0)
|
||||||
|
{
|
||||||
|
if (Program.config.getConfig("no_overdrive") == 1) overdrive = 0;
|
||||||
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive);
|
Program.wmi.DeviceSet(ASUSWmi.ScreenOverdrive, overdrive);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (miniled >= 0)
|
if (miniled >= 0)
|
||||||
{
|
{
|
||||||
Program.wmi.DeviceSet(ASUSWmi.ScreenMiniled, miniled);
|
Program.wmi.DeviceSet(ASUSWmi.ScreenMiniled, miniled);
|
||||||
@@ -695,11 +741,13 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
|
|
||||||
int frequency = NativeMethods.GetRefreshRate();
|
int frequency = NativeMethods.GetRefreshRate();
|
||||||
int maxFrequency = Program.config.getConfig("max_frequency");
|
int maxFrequency = NativeMethods.GetRefreshRate(true);
|
||||||
|
|
||||||
bool screenAuto = (Program.config.getConfig("screen_auto") == 1);
|
bool screenAuto = (Program.config.getConfig("screen_auto") == 1);
|
||||||
|
bool overdriveSetting = (Program.config.getConfig("no_overdrive") != 1);
|
||||||
|
|
||||||
int overdrive = Program.wmi.DeviceGet(ASUSWmi.ScreenOverdrive);
|
int overdrive = Program.wmi.DeviceGet(ASUSWmi.ScreenOverdrive);
|
||||||
|
|
||||||
int miniled = Program.wmi.DeviceGet(ASUSWmi.ScreenMiniled);
|
int miniled = Program.wmi.DeviceGet(ASUSWmi.ScreenMiniled);
|
||||||
|
|
||||||
bool screenEnabled = (frequency >= 0);
|
bool screenEnabled = (frequency >= 0);
|
||||||
@@ -725,18 +773,14 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
button60Hz.Activated = true;
|
button60Hz.Activated = true;
|
||||||
}
|
}
|
||||||
else
|
else if (frequency > 60)
|
||||||
{
|
{
|
||||||
if (frequency > 60)
|
|
||||||
maxFrequency = frequency;
|
|
||||||
|
|
||||||
Program.config.setConfig("max_frequency", maxFrequency);
|
|
||||||
button120Hz.Activated = true;
|
button120Hz.Activated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maxFrequency > 60)
|
if (maxFrequency > 60)
|
||||||
{
|
{
|
||||||
button120Hz.Text = maxFrequency.ToString() + "Hz + OD";
|
button120Hz.Text = maxFrequency.ToString() + "Hz" + (overdriveSetting ? " + OD" : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (miniled >= 0)
|
if (miniled >= 0)
|
||||||
@@ -795,9 +839,12 @@ namespace GHelper
|
|||||||
return " Fan: " + Math.Min(Math.Round(fan / 0.6), 100).ToString() + "%"; // relatively to 6000 rpm
|
return " Fan: " + Math.Min(Math.Round(fan / 0.6), 100).ToString() + "%"; // relatively to 6000 rpm
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void RefreshSensors()
|
private static 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 cpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.CPU_Fan));
|
||||||
string gpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.GPU_Fan));
|
string gpuFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.GPU_Fan));
|
||||||
string midFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.Mid_Fan));
|
string midFan = FormatFan(Program.wmi.DeviceGet(ASUSWmi.Mid_Fan));
|
||||||
@@ -886,6 +933,12 @@ namespace GHelper
|
|||||||
|
|
||||||
if (Program.config.getConfig("mid_fan") == 1)
|
if (Program.config.getConfig("mid_fan") == 1)
|
||||||
Program.wmi.SetFanCurve(2, Program.config.getFanConfig(2));
|
Program.wmi.SetFanCurve(2, Program.config.getFanConfig(2));
|
||||||
|
|
||||||
|
labelPerf.Text = "Performance Mode+";
|
||||||
|
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
labelPerf.Text = "Performance Mode";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Program.config.getConfigPerf("auto_apply_power") == 1)
|
if (Program.config.getConfigPerf("auto_apply_power") == 1)
|
||||||
@@ -900,6 +953,10 @@ namespace GHelper
|
|||||||
timer.Start();
|
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 = ASUSWmi.PerformanceBalanced, bool notify = false)
|
||||||
@@ -959,6 +1016,7 @@ namespace GHelper
|
|||||||
{
|
{
|
||||||
fans.InitFans();
|
fans.InitFans();
|
||||||
fans.InitPower();
|
fans.InitPower();
|
||||||
|
fans.InitBoost();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -971,8 +1029,23 @@ namespace GHelper
|
|||||||
SetPerformanceMode(Program.config.getConfig("performance_mode") + 1, true);
|
SetPerformanceMode(Program.config.getConfig("performance_mode") + 1, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AutoPerformance(PowerLineStatus Plugged = PowerLineStatus.Online)
|
|
||||||
|
public void AutoKeyboard()
|
||||||
{
|
{
|
||||||
|
if (Program.config.getConfig("keyboard_auto") != 1) return;
|
||||||
|
|
||||||
|
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
|
||||||
|
Program.wmi.DeviceSet(ASUSWmi.UniversalControl, ASUSWmi.KB_Light_Up);
|
||||||
|
else
|
||||||
|
Program.wmi.DeviceSet(ASUSWmi.UniversalControl, ASUSWmi.KB_Light_Down);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AutoPerformance()
|
||||||
|
{
|
||||||
|
var Plugged = SystemInformation.PowerStatus.PowerLineStatus;
|
||||||
|
|
||||||
int mode = Program.config.getConfig("performance_" + (int)Plugged);
|
int mode = Program.config.getConfig("performance_" + (int)Plugged);
|
||||||
if (mode != -1)
|
if (mode != -1)
|
||||||
SetPerformanceMode(mode, true);
|
SetPerformanceMode(mode, true);
|
||||||
@@ -981,11 +1054,11 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void AutoScreen(PowerLineStatus Plugged = PowerLineStatus.Online)
|
public void AutoScreen(bool force = false)
|
||||||
{
|
{
|
||||||
if (Program.config.getConfig("screen_auto") != 1) return;
|
if (!force && Program.config.getConfig("screen_auto") != 1) return;
|
||||||
|
|
||||||
if (Plugged == PowerLineStatus.Online)
|
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
|
||||||
SetScreen(1000, 1);
|
SetScreen(1000, 1);
|
||||||
else
|
else
|
||||||
SetScreen(60, 0);
|
SetScreen(60, 0);
|
||||||
@@ -993,9 +1066,11 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AutoGPUMode(PowerLineStatus Plugged = PowerLineStatus.Online)
|
public bool AutoGPUMode()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
var Plugged = SystemInformation.PowerStatus.PowerLineStatus;
|
||||||
|
|
||||||
bool GpuAuto = Program.config.getConfig("gpu_auto") == 1;
|
bool GpuAuto = Program.config.getConfig("gpu_auto") == 1;
|
||||||
if (!GpuAuto) return false;
|
if (!GpuAuto) return false;
|
||||||
|
|
||||||
@@ -1033,8 +1108,7 @@ namespace GHelper
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tableLayoutKeyboard.ColumnCount = 0;
|
//tableLayoutMatrix.ColumnCount = 0;
|
||||||
tableLayoutMatrix.ColumnCount = 0;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1084,7 +1158,7 @@ namespace GHelper
|
|||||||
|
|
||||||
labelGPU.Text = "GPU Mode: Changing ...";
|
labelGPU.Text = "GPU Mode: Changing ...";
|
||||||
|
|
||||||
new Thread(() =>
|
Thread t = new Thread(() =>
|
||||||
{
|
{
|
||||||
Thread.CurrentThread.IsBackground = true;
|
Thread.CurrentThread.IsBackground = true;
|
||||||
|
|
||||||
@@ -1099,14 +1173,13 @@ namespace GHelper
|
|||||||
Program.settingsForm.BeginInvoke(delegate
|
Program.settingsForm.BeginInvoke(delegate
|
||||||
{
|
{
|
||||||
InitGPUMode();
|
InitGPUMode();
|
||||||
HardwareMonitor.RecreateGpuTemperatureProviderWithRetry();
|
HardwareMonitor.RecreateGpuTemperatureProviderWithDelay();
|
||||||
Thread.Sleep(500);
|
Thread.Sleep(500);
|
||||||
AutoScreen(SystemInformation.PowerStatus.PowerLineStatus);
|
AutoScreen();
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
{
|
|
||||||
|
|
||||||
}.Start();
|
t.Start();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1162,7 +1235,6 @@ namespace GHelper
|
|||||||
if (changed)
|
if (changed)
|
||||||
{
|
{
|
||||||
Program.config.setConfig("gpu_mode", GPUMode);
|
Program.config.setConfig("gpu_mode", GPUMode);
|
||||||
HardwareMonitor.RecreateGpuTemperatureProviderWithRetry();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (restart)
|
if (restart)
|
||||||
@@ -1254,19 +1326,12 @@ namespace GHelper
|
|||||||
|
|
||||||
labelBatteryTitle.Text = "Battery Charge Limit: " + limit.ToString() + "%";
|
labelBatteryTitle.Text = "Battery Charge Limit: " + limit.ToString() + "%";
|
||||||
trackBattery.Value = limit;
|
trackBattery.Value = limit;
|
||||||
Program.wmi.DeviceSet(ASUSWmi.BatteryLimit, limit);
|
|
||||||
|
|
||||||
|
Program.wmi.DeviceSet(ASUSWmi.BatteryLimit, limit);
|
||||||
Program.config.setConfig("charge_limit", limit);
|
Program.config.setConfig("charge_limit", limit);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void trackBatteryChange(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (sender is null) return;
|
|
||||||
TrackBar bar = (TrackBar)sender;
|
|
||||||
SetBatteryChargeLimit(bar.Value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
18
debloat.bat
18
debloat.bat
@@ -7,11 +7,13 @@ sc STOP ASUSSystemAnalysis
|
|||||||
sc STOP ASUSSystemDiagnosis
|
sc STOP ASUSSystemDiagnosis
|
||||||
sc STOP ArmouryCrateControlInterface
|
sc STOP ArmouryCrateControlInterface
|
||||||
|
|
||||||
sc DELETE AsusAppService
|
sc config AsusAppService start= disabled
|
||||||
sc DELETE ASUSLinkNear
|
sc config ASUSLinkNear start= disabled
|
||||||
sc DELETE ASUSLinkRemote
|
sc config ASUSLinkRemote start= disabled
|
||||||
sc DELETE ASUSSoftwareManager
|
sc config ASUSSoftwareManager start= disabled
|
||||||
sc DELETE ASUSSwitch
|
sc config ASUSSwitch start= disabled
|
||||||
sc DELETE ASUSSystemAnalysis
|
sc config ASUSSystemAnalysis start= disabled
|
||||||
sc DELETE ASUSSystemDiagnosis
|
sc config ASUSSystemDiagnosis start= disabled
|
||||||
sc DELETE ArmouryCrateControlInterface
|
sc config ArmouryCrateControlInterface start= disabled
|
||||||
|
|
||||||
|
set /p asd="Hit enter to finish"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# [G-Helper (GHelper)](https://github.com/seerge/g-helper)
|
# [G-Helper (GHelper)](https://github.com/seerge/g-helper)
|
||||||
|
|
||||||
[](https://GitHub.com/seerge/g-helper/releases/) [](https://GitHub.com/seerge/g-helper/releases/) [](https://GitHub.com/seerge/g-helper/stargazers/)
|
[](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 ROG Zephyrus G14, G15, Flow X13, Flow X16, and other models
|
## Open source Armoury Crate alternative for Asus laptops such as ROG Zephyrus G14, G15, Flow X13, Flow X16, TUF 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.
|
A small utility that allows you to do almost everything you could do with Armoury Crate but without extra bloat and unnecessary services.
|
||||||
|
|
||||||
@@ -11,6 +11,7 @@ A small utility that allows you to do almost everything you could do with Armour
|
|||||||
1. Seamless and automatic GPU switching (without asking you to close all apps, etc)
|
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)
|
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
|
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
|
||||||
|
|
||||||
### [:floppy_disk: Download latest release](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
|
### [:floppy_disk: Download latest release](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
|
||||||
|
|
||||||
@@ -55,21 +56,36 @@ PPTs are shown for G14 2022, for other models PPTs will be different as they are
|
|||||||
1. Eco mode : only low power integrated GPU enabled, iGPU drives built in display
|
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
|
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)
|
3. Ultimate mode: iGPU and dGPU enabled, but dGPU drives built in display (supported only on G14 2022 model)
|
||||||
4. Optimized (formely existed as a checkbox): disables dGPU on battery (Eco) and enables when plugged (Standard)
|
4. Optimized (formerly existed as a checkbox): disables dGPU on battery (Eco) and enables when plugged (Standard)
|
||||||
|
|
||||||
### :question: FAQ
|
## :question: FAQ
|
||||||
|
|
||||||
#### How do I stop Armory Crate install popup appearing every time I press M4 / Rog key?
|
### How do I stop Armory Crate install popup appearing every time I press M4 / Rog key?
|
||||||
Go to BIOS (F2 on boot), open Advanced Settings and disable "Armory Control Intrerface"
|
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
|
||||||
|
|
||||||
#### Why Ultimate GPU mode is not available on my laptop?
|
### Why Ultimate GPU mode is not available on my laptop?
|
||||||
Ultimate mode is supported (by hardware) only on G14 2022 (and possibly other models from 2022+)
|
Ultimate mode is supported (by hardware) only on G14 2022 (and possibly other models from 2022+)
|
||||||
|
|
||||||
#### App doesn't start / or crashes, what should I do ?
|
### 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)
|
||||||
|
|
||||||
|
### 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.
|
||||||
|
|
||||||
|
### How do I change fan % to fan RPM?
|
||||||
|
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
|
||||||
|
|
||||||
|
### 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.
|
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.
|
||||||
|
|
||||||
#### How do I uninstall 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 perfromance mode (for example balanced) and clicking "Factory defaults" under Fans + Power.
|
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.
|
||||||
|
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
@@ -85,7 +101,7 @@ G-helper is a single exe, and it doesn't install anything in the system. To remo
|
|||||||
|
|
||||||
- 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.
|
- 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.
|
||||||
|
|
||||||
- It's not recommended to use an app in combination with Armory 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.
|
- 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.
|
||||||
|
|
||||||
Note: Doesn't need administrator privileges to run!
|
Note: Doesn't need administrator privileges to run!
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
Reference in New Issue
Block a user