mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Improved dimming
This commit is contained in:
@@ -405,7 +405,7 @@ public static class AppConfig
|
||||
|
||||
public static bool IsOLED()
|
||||
{
|
||||
return ContainsModel("OLED") || IsSlash() || ContainsModel("UX64") || ContainsModel("UX34") || ContainsModel("UX53") || ContainsModel("K360") || ContainsModel("X150");
|
||||
return ContainsModel("OLED") || IsSlash() || ContainsModel("UX64") || ContainsModel("UX34") || ContainsModel("UX53") || ContainsModel("K360") || ContainsModel("X150") || ContainsModel("M3500");
|
||||
}
|
||||
|
||||
public static bool IsStrix()
|
||||
@@ -572,6 +572,10 @@ public static class AppConfig
|
||||
return ContainsModel("G834") || ContainsModel("G614") || ContainsModel("G834") || ContainsModel("G634");
|
||||
}
|
||||
|
||||
public static bool IsROG()
|
||||
{
|
||||
return ContainsModel("ROG");
|
||||
}
|
||||
public static bool IsASUS()
|
||||
{
|
||||
return ContainsModel("ROG") || ContainsModel("TUF") || ContainsModel("Vivobook") || ContainsModel("Zenbook");
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using GHelper.Helpers;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace GHelper.Display
|
||||
{
|
||||
@@ -31,10 +32,16 @@ namespace GHelper.Display
|
||||
if (brightness >= 0) AppConfig.Set("brightness", brightness);
|
||||
else brightness = AppConfig.Get("brightness");
|
||||
|
||||
if (brightness >= 0) SetGamma(brightness);
|
||||
if (brightness >= 0) Task.Run(() =>
|
||||
{
|
||||
//Logger.WriteLine($"Brightness: {brightness}");
|
||||
var splendid = Environment.SystemDirectory + "\\DriverStore\\FileRepository\\asussci2.inf_amd64_f2eed2fae3b45a67\\ASUSOptimization\\AsusSplendid.exe";
|
||||
ProcessHelper.RunCMD(splendid, (AppConfig.IsROG() ? 19 : 9) + " 0 " + (40 + brightness * 0.6));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void SetGamma(int brightness = 100)
|
||||
{
|
||||
var bright = Math.Round((float)brightness / 200 + 0.5, 2);
|
||||
|
||||
@@ -101,8 +101,6 @@ namespace GHelper.Helpers
|
||||
if (Program.settingsForm.Visible)
|
||||
Program.screenControl.InitScreen();
|
||||
|
||||
Program.screenControl.SetBrightness();
|
||||
|
||||
}
|
||||
|
||||
private static int CheckAndSaveLidAction()
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace GHelper.Helpers
|
||||
}
|
||||
}
|
||||
|
||||
public static void RunCMD(string name, string args)
|
||||
public static string RunCMD(string name, string args)
|
||||
{
|
||||
var cmd = new Process();
|
||||
cmd.StartInfo.UseShellExecute = false;
|
||||
@@ -133,13 +133,13 @@ namespace GHelper.Helpers
|
||||
cmd.StartInfo.Arguments = args;
|
||||
cmd.Start();
|
||||
|
||||
Logger.WriteLine(args);
|
||||
|
||||
Logger.WriteLine(name + " " + args);
|
||||
string result = cmd.StandardOutput.ReadToEnd().Replace(Environment.NewLine, " ").Trim(' ');
|
||||
|
||||
Logger.WriteLine(result);
|
||||
|
||||
cmd.WaitForExit();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -267,9 +267,10 @@ namespace GHelper
|
||||
|
||||
int brightness = AppConfig.Get("brightness");
|
||||
if (brightness >= 0) sliderGamma.Value = brightness;
|
||||
labelGamma.Text = sliderGamma.Value + "%";
|
||||
|
||||
sliderGamma.ValueChanged += SliderGamma_ValueChanged;
|
||||
labelGamma.Text = sliderGamma.Value + "%";
|
||||
sliderGamma.MouseUp += SliderGamma_ValueChanged;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user