Compare commits

...

30 Commits

Author SHA1 Message Date
Serge
ebb8de4103 UI tweaks 2024-04-01 18:33:24 +02:00
Serge
8a4d553591 UI Tweaks 2024-04-01 18:24:51 +02:00
Serge
c25ec71104 Merge branch 'main' of https://github.com/seerge/g-helper 2024-04-01 18:23:21 +02:00
Serge
6a9cf45490 Aura fix for GU502 https://github.com/seerge/g-helper/issues/2359 2024-04-01 18:23:19 +02:00
Serge
11da574c48 New Crowdin updates (#2356)
* New translations strings.resx (Romanian)

* New translations strings.resx (French)

* New translations strings.resx (Spanish)

* New translations strings.resx (German)

* New translations strings.resx (Hungarian)

* New translations strings.resx (Italian)

* New translations strings.resx (Korean)

* New translations strings.resx (Lithuanian)

* New translations strings.resx (Polish)

* New translations strings.resx (Portuguese)

* New translations strings.resx (Turkish)

* New translations strings.resx (Ukrainian)

* New translations strings.resx (Chinese Simplified)

* New translations strings.resx (Chinese Traditional)

* New translations strings.resx (Vietnamese)

* New translations strings.resx (Portuguese, Brazilian)

* New translations strings.resx (Indonesian)
2024-04-01 16:12:19 +02:00
Serge
98a22802a0 Version bump 2024-04-01 15:56:48 +02:00
Serge
5594be868b Cleanup 2024-04-01 15:23:17 +02:00
Serge
13c2e725fa Ryzen power cleanup 2024-04-01 15:08:38 +02:00
Serge
11e0dc2df3 Reapply timer 2024-04-01 14:55:00 +02:00
Serge
6758bde975 Re-apply ryzen power limits for old models https://github.com/seerge/g-helper/issues/2355 2024-04-01 14:46:36 +02:00
Serge
ed92dd236f SPPT tweak for old devices https://github.com/seerge/g-helper/issues/2355 2024-04-01 14:31:28 +02:00
Serge
3fc5d6a124 Added option to lock screen https://github.com/seerge/g-helper/issues/2352 2024-04-01 14:22:29 +02:00
Serge
351566e24a Nvidia-smi tweaks 2024-04-01 14:14:28 +02:00
Serge
65b40a4f7a Disregard inadequate nvidia-smi readings for GPU power 2024-04-01 14:03:17 +02:00
Serge
e2a8688581 UI Tweaks 2024-04-01 12:16:25 +02:00
Serge
9445c1c60b Aura tweaks for Strix 2024 https://github.com/seerge/g-helper/issues/2344 2024-04-01 11:23:58 +02:00
Serge
9be602b230 Minor tweaks 2024-04-01 11:23:19 +02:00
Serge
2f83ae7cf6 Correct BIOS versions for swapped fan curves 2024-03-31 22:32:28 +02:00
Serge
ead49d117e UI Tweaks 2024-03-31 20:13:26 +02:00
Serge
9c0e2b4123 UI Tweaks 2024-03-31 20:09:30 +02:00
Serge
0355ca1420 Visual modes for Vivobooks https://github.com/seerge/g-helper/issues/2342 2024-03-31 19:25:01 +02:00
Serge
b5274ae9be Vivobook Visual modes and gamuts https://github.com/seerge/g-helper/issues/2342 2024-03-31 16:42:05 +02:00
Serge
0fc261cfa7 Battery report cleanup 2024-03-31 11:58:01 +02:00
Serge
efa2f0760a Battery report tweaks https://github.com/seerge/g-helper/issues/2311 2024-03-31 11:54:56 +02:00
Serge
822391c98f Added S15 OLED https://github.com/seerge/g-helper/issues/2342 2024-03-31 11:39:37 +02:00
Serge
22ffa19114 Merge branch 'main' of https://github.com/seerge/g-helper 2024-03-30 20:23:26 +01:00
Serge
af90645d6d Ally UI fix https://github.com/seerge/g-helper/issues/2341 2024-03-30 20:23:24 +01:00
Serge
a5590a9ed6 New Crowdin updates (#2323)
* New translations strings.resx (Polish)

* New translations strings.resx (Ukrainian)
2024-03-30 18:26:40 +01:00
Serge
ed8f056c6e Minor UI fix https://github.com/seerge/g-helper/issues/2339 2024-03-30 16:23:30 +01:00
Serge
0b2c962386 Maximize button for Fans+Power https://github.com/seerge/g-helper/issues/2312 2024-03-28 14:43:04 +01:00
36 changed files with 256 additions and 70 deletions

View File

@@ -406,7 +406,7 @@ public static class AppConfig
public static bool IsOLED() public static bool IsOLED()
{ {
return ContainsModel("OLED") || IsSlash() || ContainsModel("M7600") || ContainsModel("UX64") || ContainsModel("UX34") || ContainsModel("UX53") || ContainsModel("K360") || ContainsModel("X150") || ContainsModel("M350") || ContainsModel("K650") || ContainsModel("UM53") || ContainsModel("K660") || ContainsModel("UX84") || ContainsModel("M650") || ContainsModel("K340"); return ContainsModel("OLED") || IsSlash() || ContainsModel("M7600") || ContainsModel("UX64") || ContainsModel("UX34") || ContainsModel("UX53") || ContainsModel("K360") || ContainsModel("X150") || ContainsModel("M350") || ContainsModel("K650") || ContainsModel("UM53") || ContainsModel("K660") || ContainsModel("UX84") || ContainsModel("M650") || ContainsModel("K340") || ContainsModel("K350");
} }
public static bool IsNoOverdrive() public static bool IsNoOverdrive()
@@ -442,7 +442,7 @@ public static class AppConfig
public static bool IsNoDirectRGB() public static bool IsNoDirectRGB()
{ {
return ContainsModel("GA503") || ContainsModel("G533Q") || IsSlash(); return ContainsModel("GA503") || ContainsModel("G533Q") || ContainsModel("GU502") || IsSlash();
} }
public static bool IsStrixNumpad() public static bool IsStrixNumpad()
@@ -535,7 +535,10 @@ public static class AppConfig
try try
{ {
var (bios, model) = GetBiosAndModel(); var (bios, model) = GetBiosAndModel();
return (Int32.Parse(bios) == 317 || Int32.Parse(bios) == 316); var biosVersion = Int32.Parse(bios);
if (ContainsModel("GA503RM") && biosVersion == 317) return true;
if ((ContainsModel("GA503RS") || ContainsModel("GA503RW")) && biosVersion == 316) return true;
return false;
} }
catch catch
{ {

View File

@@ -1,4 +1,7 @@
namespace GHelper.Battery using GHelper.Helpers;
using System.Diagnostics;
namespace GHelper.Battery
{ {
internal class BatteryControl internal class BatteryControl
{ {
@@ -42,5 +45,25 @@
Program.settingsForm.VisualiseBattery(limit); Program.settingsForm.VisualiseBattery(limit);
} }
public static void BatteryReport()
{
var reportDir = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
try
{
var cmd = new Process();
cmd.StartInfo.WorkingDirectory = reportDir;
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.FileName = "powershell";
cmd.StartInfo.Arguments = "powercfg /batteryreport; explorer battery-report.html";
cmd.Start();
}
catch (Exception ex)
{
Logger.WriteLine(ex.Message);
}
}
} }
} }

View File

@@ -47,7 +47,7 @@ namespace GHelper.Display
info.monitorFriendlyDeviceName == internalName) info.monitorFriendlyDeviceName == internalName)
{ {
if (log) Logger.WriteLine(info.monitorFriendlyDeviceName + " HDR: " + colorInfo.advancedColorEnabled + " " + colorInfo.bitsPerColorChannel + " " + colorInfo.value + " " + colorInfo.wideColorEnforced); if (log) Logger.WriteLine(info.monitorFriendlyDeviceName + " HDR: " + colorInfo.advancedColorEnabled + " " + colorInfo.bitsPerColorChannel + " " + colorInfo.value + " " + colorInfo.wideColorEnforced);
return colorInfo.advancedColorEnabled && colorInfo.bitsPerColorChannel > 8; return colorInfo.advancedColorEnabled && (colorInfo.bitsPerColorChannel > 8 || !colorInfo.wideColorEnforced);
} }
} }

View File

@@ -5,6 +5,10 @@ namespace GHelper.Display
{ {
public enum SplendidGamut : int public enum SplendidGamut : int
{ {
VivoNative = 0,
VivoSRGB = 1,
VivoDCIP3 = 3,
ViviDisplayP3 = 4,
Native = 50, Native = 50,
sRGB = 51, sRGB = 51,
DCIP3 = 53, DCIP3 = 53,
@@ -15,6 +19,11 @@ namespace GHelper.Display
{ {
None = -1, None = -1,
VivoNormal = 1,
VivoVivid = 2,
VivoManual = 6,
VivoEycare = 7,
Init = 10, Init = 10,
DimmingAsus = 9, DimmingAsus = 9,
DimmingVisual = 19, DimmingVisual = 19,
@@ -52,29 +61,39 @@ namespace GHelper.Display
return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\ASUS\\GameVisual"; return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\ASUS\\GameVisual";
} }
public static string GetVivobookPath()
{
return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\ASUS\\ASUS System Control Interface\\ASUSOptimization\\Splendid";
}
public static Dictionary<SplendidGamut, string> GetGamutModes() public static Dictionary<SplendidGamut, string> GetGamutModes()
{ {
bool isVivo = AppConfig.IsVivoZenbook();
Dictionary<SplendidGamut, string> _modes = new Dictionary<SplendidGamut, string>(); Dictionary<SplendidGamut, string> _modes = new Dictionary<SplendidGamut, string>();
string gameVisualPath = GetGameVisualPath(); string iccPath = isVivo ? GetVivobookPath() : GetGameVisualPath();
if (!Directory.Exists(gameVisualPath))
if (!Directory.Exists(iccPath))
{ {
Logger.WriteLine(gameVisualPath + " doesn't exit"); Logger.WriteLine(iccPath + " doesn't exit");
return _modes; return _modes;
} }
try try
{ {
DirectoryInfo d = new DirectoryInfo(GetGameVisualPath()); DirectoryInfo d = new DirectoryInfo(iccPath);
FileInfo[] icms = d.GetFiles("*.icm"); FileInfo[] icms = d.GetFiles("*.icm");
if (icms.Length == 0) return _modes; if (icms.Length == 0) return _modes;
_modes.Add(SplendidGamut.Native, "Gamut: Native"); _modes.Add(isVivo ? SplendidGamut.VivoNative : SplendidGamut.Native, "Gamut: Native");
foreach (FileInfo icm in icms) foreach (FileInfo icm in icms)
{ {
if (icm.Name.Contains("sRGB")) _modes.Add(SplendidGamut.sRGB, "Gamut: sRGB"); //Logger.WriteLine(icm.FullName);
if (icm.Name.Contains("DCIP3")) _modes.Add(SplendidGamut.DCIP3, "Gamut: DCIP3"); if (icm.Name.Contains("sRGB")) _modes.Add(isVivo ? SplendidGamut.VivoSRGB : SplendidGamut.sRGB, "Gamut: sRGB");
if (icm.Name.Contains("DisplayP3")) _modes.Add(SplendidGamut.DisplayP3, "Gamut: DisplayP3"); if (icm.Name.Contains("DCIP3")) _modes.Add(isVivo ? SplendidGamut.VivoDCIP3 : SplendidGamut.DCIP3, "Gamut: DCIP3");
if (icm.Name.Contains("DisplayP3")) _modes.Add(isVivo ? SplendidGamut.ViviDisplayP3 : SplendidGamut.DisplayP3, "Gamut: DisplayP3");
} }
return _modes; return _modes;
} }
@@ -87,6 +106,18 @@ namespace GHelper.Display
public static Dictionary<SplendidCommand, string> GetVisualModes() public static Dictionary<SplendidCommand, string> GetVisualModes()
{ {
if (AppConfig.IsVivoZenbook())
{
return new Dictionary<SplendidCommand, string>
{
{ SplendidCommand.VivoNormal, "Default" },
{ SplendidCommand.VivoVivid, "Vivid" },
{ SplendidCommand.VivoManual, "Manual" },
{ SplendidCommand.VivoEycare, "Eyecare" },
};
}
return new Dictionary<SplendidCommand, string> return new Dictionary<SplendidCommand, string>
{ {
{ SplendidCommand.Default, "Default"}, { SplendidCommand.Default, "Default"},
@@ -114,6 +145,18 @@ namespace GHelper.Display
}; };
} }
public static Dictionary<int, string> GetEyeCares()
{
return new Dictionary<int, string>
{
{ 0, "0"},
{ 1, "1"},
{ 2, "2"},
{ 3, "3"},
{ 4, "4"},
};
}
public static void SetGamut(int mode = 50) public static void SetGamut(int mode = 50)
{ {
if (RunSplendid(SplendidCommand.GamutMode, 0, mode)) return; if (RunSplendid(SplendidCommand.GamutMode, 0, mode)) return;
@@ -136,7 +179,24 @@ namespace GHelper.Display
if (whiteBalance != DefaultColorTemp && !init) ProcessHelper.RunAsAdmin(); if (whiteBalance != DefaultColorTemp && !init) ProcessHelper.RunAsAdmin();
int balance = mode == SplendidCommand.Eyecare ? 2 : whiteBalance; int? balance;
switch (mode) {
case SplendidCommand.Eyecare:
balance = 2;
break;
case SplendidCommand.VivoNormal:
case SplendidCommand.VivoVivid:
balance = null;
break;
case SplendidCommand.VivoEycare:
balance = Math.Abs(whiteBalance - 50) * 4 / 50;
break;
default:
balance = whiteBalance;
break;
}
if (RunSplendid(mode, 0, balance)) return; if (RunSplendid(mode, 0, balance)) return;
if (_init) if (_init)

View File

@@ -30,6 +30,7 @@ namespace GHelper
{"aura", Properties.Strings.ToggleAura}, {"aura", Properties.Strings.ToggleAura},
{"performance", Properties.Strings.PerformanceMode}, {"performance", Properties.Strings.PerformanceMode},
{"screen", Properties.Strings.ToggleScreen}, {"screen", Properties.Strings.ToggleScreen},
{"lock", Properties.Strings.LockScreen},
{"miniled", Properties.Strings.ToggleMiniled}, {"miniled", Properties.Strings.ToggleMiniled},
{"fnlock", Properties.Strings.ToggleFnLock}, {"fnlock", Properties.Strings.ToggleFnLock},
{"brightness_down", Properties.Strings.BrightnessDown}, {"brightness_down", Properties.Strings.BrightnessDown},

6
app/Fans.Designer.cs generated
View File

@@ -220,10 +220,10 @@ namespace GHelper
panelFans.Controls.Add(tableFanCharts); panelFans.Controls.Add(tableFanCharts);
panelFans.Controls.Add(panelTitleFans); panelFans.Controls.Add(panelTitleFans);
panelFans.Controls.Add(panelApplyFans); panelFans.Controls.Add(panelApplyFans);
panelFans.Dock = DockStyle.Left; panelFans.Dock = DockStyle.Fill;
panelFans.Location = new Point(530, 0); panelFans.Location = new Point(530, 0);
panelFans.Margin = new Padding(0); panelFans.Margin = new Padding(0);
panelFans.MaximumSize = new Size(816, 0); //panelFans.MaximumSize = new Size(816, 0);
panelFans.MinimumSize = new Size(816, 0); panelFans.MinimumSize = new Size(816, 0);
panelFans.Name = "panelFans"; panelFans.Name = "panelFans";
panelFans.Padding = new Padding(0, 0, 10, 0); panelFans.Padding = new Padding(0, 0, 10, 0);
@@ -1685,7 +1685,7 @@ namespace GHelper
Controls.Add(panelFans); Controls.Add(panelFans);
Controls.Add(panelSliders); Controls.Add(panelSliders);
Margin = new Padding(4, 2, 4, 2); Margin = new Padding(4, 2, 4, 2);
MaximizeBox = false; MaximizeBox = true;
MinimizeBox = false; MinimizeBox = false;
MinimumSize = new Size(26, 1100); MinimumSize = new Size(26, 1100);
Name = "Fans"; Name = "Fans";

View File

@@ -1261,7 +1261,7 @@ namespace GHelper
labelTip.Text = Math.Floor(curPoint.XValue) + "C, " + ChartYLabel((int)curPoint.YValues[0], device, " " + Properties.Strings.RPM); labelTip.Text = Math.Floor(curPoint.XValue) + "C, " + ChartYLabel((int)curPoint.YValues[0], device, " " + Properties.Strings.RPM);
labelTip.Top = e.Y + ((Control)sender).Top; labelTip.Top = e.Y + ((Control)sender).Top;
labelTip.Left = e.X - 50; labelTip.Left = Math.Min(chart.Width - labelTip.Width - 20, e.X - 50);
} }
catch catch

View File

@@ -15,7 +15,7 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly> <ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.164</AssemblyVersion> <AssemblyVersion>0.165</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -30,6 +30,14 @@ public static class NvidiaSmi
return false; // Return false if the "Display Active" status is not found return false; // Return false if the "Display Active" status is not found
} }
public static int GetDefaultMaxGPUPower()
{
if (AppConfig.ContainsModel("GU605")) return 125;
if (AppConfig.ContainsModel("GA403")) return 90;
if (AppConfig.ContainsModel("FA607")) return 140;
else return 175;
}
public static int GetMaxGPUPower() public static int GetMaxGPUPower()
{ {
string output = RunNvidiaSmiCommand("--query-gpu=power.max_limit --format csv,noheader,nounits"); string output = RunNvidiaSmiCommand("--query-gpu=power.max_limit --format csv,noheader,nounits");
@@ -38,10 +46,10 @@ public static class NvidiaSmi
if (float.TryParse(output, out float floatValue)) if (float.TryParse(output, out float floatValue))
{ {
int intValue = (int)floatValue; int intValue = (int)floatValue;
return intValue; if (intValue >= 50 && intValue <= 175) return intValue;
} }
return -1; return GetDefaultMaxGPUPower();
} }
private static string RunNvidiaSmiCommand(string arguments = "-i 0 -q") private static string RunNvidiaSmiCommand(string arguments = "-i 0 -q")

View File

@@ -971,7 +971,7 @@
// //
// checkController // checkController
// //
checkController.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; checkController.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
checkController.AutoSize = true; checkController.AutoSize = true;
checkController.BackColor = SystemColors.ControlLight; checkController.BackColor = SystemColors.ControlLight;
checkController.Location = new Point(650, 41); checkController.Location = new Point(650, 41);

View File

@@ -473,6 +473,10 @@ namespace GHelper.Input
case "screenshot": case "screenshot":
KeyboardHook.KeyPress(Keys.Snapshot); KeyboardHook.KeyPress(Keys.Snapshot);
break; break;
case "lock":
Logger.WriteLine("Screen lock");
NativeMethods.LockScreen();
break;
case "screen": case "screen":
Logger.WriteLine("Screen off toggle"); Logger.WriteLine("Screen off toggle");
NativeMethods.TurnOffScreen(); NativeMethods.TurnOffScreen();

View File

@@ -15,6 +15,7 @@ namespace GHelper.Mode
private int _cpuUV = 0; private int _cpuUV = 0;
private int _igpuUV = 0; private int _igpuUV = 0;
private bool _ryzenPower = false;
static System.Timers.Timer reapplyTimer = default!; static System.Timers.Timer reapplyTimer = default!;
@@ -27,7 +28,8 @@ namespace GHelper.Mode
private void ReapplyTimer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e) private void ReapplyTimer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e)
{ {
SetCPUTemp(AppConfig.GetMode("cpu_temp"), false); SetCPUTemp(AppConfig.GetMode("cpu_temp"));
SetRyzenPower();
} }
public void AutoPerformance(bool powerChanged = false) public void AutoPerformance(bool powerChanged = false)
@@ -222,6 +224,34 @@ namespace GHelper.Mode
settings.SetModeLabel(Properties.Strings.PerformanceMode + ": " + Modes.GetCurrentName() + (customFans ? "+" : "") + ((customPower > 0) ? " " + customPower + "W" : "")); settings.SetModeLabel(Properties.Strings.PerformanceMode + ": " + Modes.GetCurrentName() + (customFans ? "+" : "") + ((customPower > 0) ? " " + customPower + "W" : ""));
} }
public void SetRyzenPower(bool init = false)
{
if (init) _ryzenPower = true;
if (!_ryzenPower) return;
if (!RyzenControl.IsRingExsists()) return;
if (!AppConfig.IsMode("auto_apply_power")) return;
int limit_total = AppConfig.GetMode("limit_total");
int limit_slow = AppConfig.GetMode("limit_slow", limit_total);
if (limit_total > AsusACPI.MaxTotal) return;
if (limit_total < AsusACPI.MinTotal) return;
var stapmResult = SendCommand.set_stapm_limit((uint)limit_total * 1000);
if (init) Logger.WriteLine($"STAPM: {limit_total} {stapmResult}");
var stapmResult2 = SendCommand.set_stapm2_limit((uint)limit_total * 1000);
if (init) Logger.WriteLine($"STAPM2: {limit_total} {stapmResult2}");
var slowResult = SendCommand.set_slow_limit((uint)limit_slow * 1000);
if (init) Logger.WriteLine($"SLOW: {limit_slow} {slowResult}");
var fastResult = SendCommand.set_fast_limit((uint)limit_slow * 1000);
if (init) Logger.WriteLine($"FAST: {limit_slow} {fastResult}");
}
public void SetPower(bool launchAsAdmin = false) public void SetPower(bool launchAsAdmin = false)
{ {
@@ -258,19 +288,7 @@ namespace GHelper.Mode
if (ProcessHelper.IsUserAdministrator()) if (ProcessHelper.IsUserAdministrator())
{ {
var stapmResult = SendCommand.set_stapm_limit((uint)limit_total * 1000); SetRyzenPower(true);
Logger.WriteLine($"STAPM: {limit_total} {stapmResult}");
var stapmResult2 = SendCommand.set_stapm2_limit((uint)limit_total * 1000);
Logger.WriteLine($"STAPM2: {limit_total} {stapmResult2}");
var slowResult = SendCommand.set_slow_limit((uint)limit_total * 1000);
Logger.WriteLine($"SLOW: {limit_total} {slowResult}");
var fastResult = SendCommand.set_fast_limit((uint)limit_total * 1000);
Logger.WriteLine($"FAST: {limit_total} {fastResult}");
customPower = limit_total;
} }
else if (launchAsAdmin) else if (launchAsAdmin)
{ {
@@ -351,22 +369,15 @@ namespace GHelper.Mode
} }
public void SetCPUTemp(int? cpuTemp, bool log = true) public void SetCPUTemp(int? cpuTemp, bool init = false)
{ {
if (cpuTemp >= RyzenControl.MinTemp && cpuTemp < RyzenControl.MaxTemp) if (cpuTemp >= RyzenControl.MinTemp && cpuTemp < RyzenControl.MaxTemp)
{ {
var resultCPU = SendCommand.set_tctl_temp((uint)cpuTemp); var resultCPU = SendCommand.set_tctl_temp((uint)cpuTemp);
if (log) Logger.WriteLine($"CPU Temp: {cpuTemp} {resultCPU}"); if (init) Logger.WriteLine($"CPU Temp: {cpuTemp} {resultCPU}");
var restultAPU = SendCommand.set_apu_skin_temp_limit((uint)cpuTemp); var restultAPU = SendCommand.set_apu_skin_temp_limit((uint)cpuTemp);
if (log) Logger.WriteLine($"APU Temp: {cpuTemp} {restultAPU}"); if (init) Logger.WriteLine($"APU Temp: {cpuTemp} {restultAPU}");
reapplyTimer.Enabled = AppConfig.IsMode("auto_uv");
}
else
{
reapplyTimer.Enabled = false;
} }
} }
@@ -409,18 +420,21 @@ namespace GHelper.Mode
{ {
SetUV(AppConfig.GetMode("cpu_uv", 0)); SetUV(AppConfig.GetMode("cpu_uv", 0));
SetUViGPU(AppConfig.GetMode("igpu_uv", 0)); SetUViGPU(AppConfig.GetMode("igpu_uv", 0));
SetCPUTemp(AppConfig.GetMode("cpu_temp")); SetCPUTemp(AppConfig.GetMode("cpu_temp"), true);
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.WriteLine("UV Error: " + ex.ToString()); Logger.WriteLine("UV Error: " + ex.ToString());
} }
reapplyTimer.Enabled = AppConfig.IsMode("auto_uv");
} }
public void ResetRyzen() public void ResetRyzen()
{ {
if (_cpuUV != 0) SetUV(0); if (_cpuUV != 0) SetUV(0);
if (_igpuUV != 0) SetUViGPU(0); if (_igpuUV != 0) SetUViGPU(0);
reapplyTimer.Enabled = false;
} }
public void AutoRyzen() public void AutoRyzen()

View File

@@ -27,14 +27,25 @@ public class NativeMethods
private const int MONITOR_OFF = 2; private const int MONITOR_OFF = 2;
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); private static extern IntPtr SendMessage(nint hWnd, int hMsg, int wParam, int lParam);
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern uint FormatMessage(uint dwFlags, IntPtr lpSource, uint dwMessageId, uint dwLanguageId, out string lpBuffer, uint nSize, IntPtr Arguments); private static extern uint FormatMessage(uint dwFlags, IntPtr lpSource, uint dwMessageId, uint dwLanguageId, out string lpBuffer, uint nSize, IntPtr Arguments);
[DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool LockWorkStation();
public static void LockScreen()
{
LockWorkStation();
}
public static void TurnOffScreen() public static void TurnOffScreen()
{ {
IntPtr result = SendMessage(-1, WM_SYSCOMMAND, (IntPtr)SC_MONITORPOWER, (IntPtr)MONITOR_OFF); Form f = new Form();
IntPtr result = SendMessage(f.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF);
if (result == IntPtr.Zero) if (result == IntPtr.Zero)
{ {
int error = Marshal.GetLastWin32Error(); int error = Marshal.GetLastWin32Error();

View File

@@ -1223,6 +1223,15 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Lock Screen.
/// </summary>
internal static string LockScreen {
get {
return ResourceManager.GetString("LockScreen", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Logo. /// Looks up a localized string similar to Logo.
/// </summary> /// </summary>

View File

@@ -506,6 +506,9 @@ Trotzdem fortfahren?</value>
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Beleuchtung</value> <value>Beleuchtung</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logo</value> <value>Logo</value>
</data> </data>

View File

@@ -506,6 +506,9 @@
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Iluminación</value> <value>Iluminación</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logo</value> <value>Logo</value>
</data> </data>

View File

@@ -506,6 +506,9 @@ Voulez-vous continuer ?</value>
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Éclairage</value> <value>Éclairage</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logo</value> <value>Logo</value>
</data> </data>

View File

@@ -506,6 +506,9 @@ Do you still want to continue?</value>
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Világítás</value> <value>Világítás</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logó</value> <value>Logó</value>
</data> </data>

View File

@@ -506,6 +506,9 @@ Apakah Anda masih ingin melanjutkan?</value>
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Lighting</value> <value>Lighting</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logo</value> <value>Logo</value>
</data> </data>

View File

@@ -506,6 +506,9 @@ Sei sicuro di voler continuare?</value>
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Illuminazione</value> <value>Illuminazione</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logo</value> <value>Logo</value>
</data> </data>

View File

@@ -506,6 +506,9 @@
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>조명</value> <value>조명</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>로고</value> <value>로고</value>
</data> </data>

View File

@@ -506,6 +506,9 @@ Vis tiek norite tęsti?</value>
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Apšvietimas</value> <value>Apšvietimas</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logotipas</value> <value>Logotipas</value>
</data> </data>

View File

@@ -495,7 +495,7 @@ Nadal chcesz kontynuować?</value>
<value>Ekran laptopa</value> <value>Ekran laptopa</value>
</data> </data>
<data name="LEDStatusIndicators" xml:space="preserve"> <data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value> <value>Wskaźniki stanu</value>
</data> </data>
<data name="Lid" xml:space="preserve"> <data name="Lid" xml:space="preserve">
<value>Pokrywa</value> <value>Pokrywa</value>
@@ -506,6 +506,9 @@ Nadal chcesz kontynuować?</value>
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Oświetlenie</value> <value>Oświetlenie</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logo</value> <value>Logo</value>
</data> </data>
@@ -771,10 +774,10 @@ Nadal chcesz kontynuować?</value>
<value>Tryb wyświetlania</value> <value>Tryb wyświetlania</value>
</data> </data>
<data name="VisualModesHDR" xml:space="preserve"> <data name="VisualModesHDR" xml:space="preserve">
<value>Visual Modes are not available when HDR is active</value> <value>Tryby wyświetlania nie są dostępne, kiedy HDR jest włączone</value>
</data> </data>
<data name="VisualModesScreen" xml:space="preserve"> <data name="VisualModesScreen" xml:space="preserve">
<value>Visual Modes are not available when laptop screen is off</value> <value>Tryby wyświetlania nie są dostępne, kiedy ekran laptopa jest wyłączony</value>
</data> </data>
<data name="VolumeDown" xml:space="preserve"> <data name="VolumeDown" xml:space="preserve">
<value>Zmniejsz głośność</value> <value>Zmniejsz głośność</value>

View File

@@ -506,6 +506,9 @@ Do you still want to continue?</value>
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Lighting</value> <value>Lighting</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logo</value> <value>Logo</value>
</data> </data>

View File

@@ -506,6 +506,9 @@ Quer prosseguir?</value>
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Iluminação</value> <value>Iluminação</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logo</value> <value>Logo</value>
</data> </data>

View File

@@ -506,6 +506,9 @@ Do you still want to continue?</value>
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Lighting</value> <value>Lighting</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logo</value> <value>Logo</value>
</data> </data>

View File

@@ -506,6 +506,9 @@
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Iluminare</value> <value>Iluminare</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logo-ul</value> <value>Logo-ul</value>
</data> </data>

View File

@@ -506,6 +506,9 @@ Yine de devam etmek istiyor musunuz?</value>
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Işıklandırma</value> <value>Işıklandırma</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logo</value> <value>Logo</value>
</data> </data>

View File

@@ -495,7 +495,7 @@
<value>Дисплей</value> <value>Дисплей</value>
</data> </data>
<data name="LEDStatusIndicators" xml:space="preserve"> <data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value> <value>LED-Індикатори стану</value>
</data> </data>
<data name="Lid" xml:space="preserve"> <data name="Lid" xml:space="preserve">
<value>Кришка</value> <value>Кришка</value>
@@ -506,6 +506,9 @@
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Ілюмінація</value> <value>Ілюмінація</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Лого</value> <value>Лого</value>
</data> </data>
@@ -771,10 +774,10 @@
<value>Візуальний режим</value> <value>Візуальний режим</value>
</data> </data>
<data name="VisualModesHDR" xml:space="preserve"> <data name="VisualModesHDR" xml:space="preserve">
<value>Visual Modes are not available when HDR is active</value> <value>Візуальні режими недоступні, коли HDR активний</value>
</data> </data>
<data name="VisualModesScreen" xml:space="preserve"> <data name="VisualModesScreen" xml:space="preserve">
<value>Visual Modes are not available when laptop screen is off</value> <value>Візуальні режими недоступні, коли екран вимкнений</value>
</data> </data>
<data name="VolumeDown" xml:space="preserve"> <data name="VolumeDown" xml:space="preserve">
<value>Зменшення гучності</value> <value>Зменшення гучності</value>

View File

@@ -506,6 +506,9 @@ Do you still want to continue?</value>
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>Lighting</value> <value>Lighting</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logo</value> <value>Logo</value>
</data> </data>

View File

@@ -506,6 +506,9 @@
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>背光</value> <value>背光</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>徽标</value> <value>徽标</value>
</data> </data>

View File

@@ -506,6 +506,9 @@
<data name="Lighting" xml:space="preserve"> <data name="Lighting" xml:space="preserve">
<value>亮度</value> <value>亮度</value>
</data> </data>
<data name="LockScreen" xml:space="preserve">
<value>Lock Screen</value>
</data>
<data name="Logo" xml:space="preserve"> <data name="Logo" xml:space="preserve">
<value>Logo</value> <value>Logo</value>
</data> </data>

View File

@@ -1712,7 +1712,7 @@ namespace GHelper
labelVisual.Margin = new Padding(4, 0, 4, 0); labelVisual.Margin = new Padding(4, 0, 4, 0);
labelVisual.Name = "labelVisual"; labelVisual.Name = "labelVisual";
labelVisual.Padding = new Padding(4); labelVisual.Padding = new Padding(4);
labelVisual.Size = new Size(787, 52); labelVisual.Size = new Size(800, 52);
labelVisual.TabIndex = 42; labelVisual.TabIndex = 42;
labelVisual.Text = "Visual Modes are not available when HDR is active"; labelVisual.Text = "Visual Modes are not available when HDR is active";
labelVisual.Visible = false; labelVisual.Visible = false;
@@ -1866,7 +1866,7 @@ namespace GHelper
labelGammaTitle.Location = new Point(43, 0); labelGammaTitle.Location = new Point(43, 0);
labelGammaTitle.Margin = new Padding(4, 0, 4, 0); labelGammaTitle.Margin = new Padding(4, 0, 4, 0);
labelGammaTitle.Name = "labelGammaTitle"; labelGammaTitle.Name = "labelGammaTitle";
labelGammaTitle.Size = new Size(507, 32); labelGammaTitle.Size = new Size(540, 32);
labelGammaTitle.TabIndex = 37; labelGammaTitle.TabIndex = 37;
labelGammaTitle.Text = "Flicker-free Dimming"; labelGammaTitle.Text = "Flicker-free Dimming";
// //

View File

@@ -138,9 +138,9 @@ namespace GHelper
buttonOptimized.BorderColor = colorEco; buttonOptimized.BorderColor = colorEco;
buttonXGM.BorderColor = colorTurbo; buttonXGM.BorderColor = colorTurbo;
button60Hz.BorderColor = SystemColors.ActiveBorder; button60Hz.BorderColor = colorGray;
button120Hz.BorderColor = SystemColors.ActiveBorder; button120Hz.BorderColor = colorGray;
buttonScreenAuto.BorderColor = SystemColors.ActiveBorder; buttonScreenAuto.BorderColor = colorGray;
buttonMiniled.BorderColor = colorTurbo; buttonMiniled.BorderColor = colorTurbo;
buttonSilent.Click += ButtonSilent_Click; buttonSilent.Click += ButtonSilent_Click;
@@ -265,9 +265,7 @@ namespace GHelper
private void LabelCharge_Click(object? sender, EventArgs e) private void LabelCharge_Click(object? sender, EventArgs e)
{ {
var report = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "\\battery-report.html"; BatteryControl.BatteryReport();
ProcessHelper.RunCMD("powershell", $"powercfg /batteryreport /output \"{report}\"");
ProcessHelper.RunCMD("explorer", $"\"{report}\"");
} }
private void LabelVisual_Click(object? sender, EventArgs e) private void LabelVisual_Click(object? sender, EventArgs e)
@@ -1679,7 +1677,7 @@ namespace GHelper
sliderBattery.Value = limit; sliderBattery.Value = limit;
sliderBattery.AccessibleName = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%"; sliderBattery.AccessibleName = Properties.Strings.BatteryChargeLimit + ": " + limit.ToString() + "%";
sliderBattery.AccessibilityObject.Select(AccessibleSelection.TakeFocus); //sliderBattery.AccessibilityObject.Select(AccessibleSelection.TakeFocus);
VisualiseBatteryFull(); VisualiseBatteryFull();
} }

View File

@@ -10,6 +10,7 @@ namespace GHelper.UI
public static Color colorStandard = Color.FromArgb(255, 58, 174, 239); public static Color colorStandard = Color.FromArgb(255, 58, 174, 239);
public static Color colorTurbo = Color.FromArgb(255, 255, 32, 32); public static Color colorTurbo = Color.FromArgb(255, 255, 32, 32);
public static Color colorCustom = Color.FromArgb(255, 255, 128, 0); public static Color colorCustom = Color.FromArgb(255, 255, 128, 0);
public static Color colorGray = Color.FromArgb(255, 168, 168, 168);
public static Color buttonMain; public static Color buttonMain;

View File

@@ -438,8 +438,8 @@ namespace GHelper.USB
105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 139, 121, 122, 123, 124, 125, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 139, 121, 122, 123, 124, 125,
/* LCTL LFNC LWIN LALT SPC RALT RFNC RCTL ARWL ARWD ARWR PRT15 NM0 NMPD NMER */ /* LCTL LFNC LWIN LALT SPC RALT RFNC RCTL ARWL ARWD ARWR PRT15 NM0 NMPD NMER */
126, 127, 128, 129, 131, 135, 136, 137, 159, 160, 161, 142, 144, 145, 146, 126, 127, 128, 129, 131, 135, 136, 137, 159, 160, 161, 142, 144, 145, 146,
/* LB1 LB2 LB3 LB4 LB5 LB6 */ /* LB1 LB2 LB3 ARW? ARWL? ARWD? ARWR? LB4 LB5 LB6 */
174, 173, 172, 171, 170, 169, 174, 173, 172, 120, 140, 141, 143, 171, 170, 169,
/* KSTN LOGO LIDL LIDR */ /* KSTN LOGO LIDL LIDR */
0, 167, 176, 177, 0, 167, 176, 177,
@@ -462,8 +462,8 @@ namespace GHelper.USB
0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* LCTL LFNC LWIN LALT SPC RALT RFNC RCTL ARWL ARWD ARWR PRT15 NM0 NMPD NMER */ /* LCTL LFNC LWIN LALT SPC RALT RFNC RCTL ARWL ARWD ARWR PRT15 NM0 NMPD NMER */
0, 0, 0, 0, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
/* LB1 LB1 LB3 LB4 LB5 LB6 */ /* LB1 LB1 LB3 ARW? ARW? ARW? ARW? LB4 LB5 LB6 */
5, 5, 4, 6, 7, 7, 5, 5, 4, 3, 3, 3, 3, 6, 7, 7,
/* KSTN LOGO LIDL LIDR */ /* KSTN LOGO LIDL LIDR */
3, 0, 0, 3, 3, 0, 0, 3,
@@ -486,8 +486,8 @@ namespace GHelper.USB
0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
/* LCTL LFNC LWIN LALT SPC RALT RFNC RCTL ARWL ARWD ARWR PRT15 NM0 NMPD NMER */ /* LCTL LFNC LWIN LALT SPC RALT RFNC RCTL ARWL ARWD ARWR PRT15 NM0 NMPD NMER */
0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3,
/* LB1 LB1 LB3 LB4 LB5 LB6 */ /* LB1 LB1 LB3 ARW? ARW? ARW? ARW? LB4 LB5 LB6 */
5, 5, 4, 6, 7, 7, 5, 5, 4, 2, 2, 2, 3, 6, 7, 7,
/* KSTN LOGO LIDL LIDR */ /* KSTN LOGO LIDL LIDR */
3, 0, 0, 3, 3, 0, 0, 3,