mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79cd773632 | ||
|
|
897de4ed27 | ||
|
|
afa6dbb542 | ||
|
|
80fbee2609 | ||
|
|
e1c83da19b | ||
|
|
59b5888632 | ||
|
|
cd74c62908 | ||
|
|
000fbe466f |
@@ -111,8 +111,6 @@ namespace GHelper.AnimeMatrix
|
|||||||
deviceSlash.SetEnabled(true);
|
deviceSlash.SetEnabled(true);
|
||||||
deviceSlash.Init();
|
deviceSlash.Init();
|
||||||
|
|
||||||
deviceSlash.SetLidMode(false);
|
|
||||||
|
|
||||||
switch ((SlashMode)running)
|
switch ((SlashMode)running)
|
||||||
{
|
{
|
||||||
case SlashMode.Static:
|
case SlashMode.Static:
|
||||||
@@ -150,6 +148,11 @@ namespace GHelper.AnimeMatrix
|
|||||||
{
|
{
|
||||||
bool matrixLid = AppConfig.Is("matrix_lid");
|
bool matrixLid = AppConfig.Is("matrix_lid");
|
||||||
|
|
||||||
|
if (deviceSlash is not null)
|
||||||
|
{
|
||||||
|
deviceSlash.SetLidMode(!matrixLid && AppConfig.Is("slash_sleep"));
|
||||||
|
}
|
||||||
|
|
||||||
if (matrixLid || force)
|
if (matrixLid || force)
|
||||||
{
|
{
|
||||||
Logger.WriteLine($"Matrix LidClosed: {lidClose}");
|
Logger.WriteLine($"Matrix LidClosed: {lidClose}");
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ namespace GHelper.AnimeMatrix
|
|||||||
|
|
||||||
public void SetLidMode(bool status)
|
public void SetLidMode(bool status)
|
||||||
{
|
{
|
||||||
Set(CreatePacket([0xD8, 0x00, 0x00, 0x02, 0xA5, status ? (byte)0x80 : (byte)0x00]), $"DisableLidClose {status}");
|
Set(CreatePacket([0xD8, 0x00, 0x00, 0x02, 0xA5, status ? (byte)0x80 : (byte)0x00]), $"SlashLidCloseAnimation {status}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetSleepActive(bool status)
|
public void SetSleepActive(bool status)
|
||||||
|
|||||||
@@ -302,27 +302,32 @@ public static class AppConfig
|
|||||||
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case 1:
|
case AsusACPI.PerformanceTurbo:
|
||||||
if (device == AsusFan.GPU)
|
switch (device)
|
||||||
curve = StringToBytes("14-3F-44-48-4C-50-54-62-16-1F-26-2D-39-47-55-5F");
|
{
|
||||||
else
|
case AsusFan.GPU:
|
||||||
curve = StringToBytes("14-3F-44-48-4C-50-54-62-11-1A-22-29-34-43-51-5A");
|
return StringToBytes("14-3F-44-48-4C-50-54-62-16-1F-26-2D-39-47-55-5F");
|
||||||
break;
|
default:
|
||||||
case 2:
|
return StringToBytes("14-3F-44-48-4C-50-54-62-11-1A-22-29-34-43-51-5A");
|
||||||
if (device == AsusFan.GPU)
|
}
|
||||||
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-08-11-11-1D-1D-26-26-2D");
|
case AsusACPI.PerformanceSilent:
|
||||||
else
|
switch (device)
|
||||||
curve = StringToBytes("3C-41-42-46-47-4B-4C-62-03-0C-0C-16-16-22-22-29");
|
{
|
||||||
break;
|
case AsusFan.GPU:
|
||||||
|
return StringToBytes("3C-41-42-46-47-4B-4C-62-08-11-11-1D-1D-26-26-2D");
|
||||||
|
default:
|
||||||
|
return StringToBytes("3C-41-42-46-47-4B-4C-62-03-0C-0C-16-16-22-22-29");
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
if (device == AsusFan.GPU)
|
switch (device)
|
||||||
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-0C-16-1D-1F-26-2D-34-4A");
|
{
|
||||||
else
|
case AsusFan.GPU:
|
||||||
curve = StringToBytes("3A-3D-40-44-48-4D-51-62-08-11-16-1A-22-29-30-45");
|
return StringToBytes("3A-3D-40-44-48-4D-51-62-0C-16-1D-1F-26-2D-34-4A");
|
||||||
break;
|
default:
|
||||||
|
return StringToBytes("3A-3D-40-44-48-4D-51-62-08-11-16-1A-22-29-30-45");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return curve;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetModeString(string name)
|
public static string GetModeString(string name)
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ namespace GHelper.Display
|
|||||||
|
|
||||||
private static int _brightness = 100;
|
private static int _brightness = 100;
|
||||||
private static bool _init = true;
|
private static bool _init = true;
|
||||||
|
private static bool _download = true;
|
||||||
private static string? _splendidPath = null;
|
private static string? _splendidPath = null;
|
||||||
|
|
||||||
private static System.Timers.Timer brightnessTimer = new System.Timers.Timer(200);
|
private static System.Timers.Timer brightnessTimer = new System.Timers.Timer(200);
|
||||||
@@ -217,6 +218,11 @@ namespace GHelper.Display
|
|||||||
{
|
{
|
||||||
Logger.WriteLine("Gamut setting refused, reverting.");
|
Logger.WriteLine("Gamut setting refused, reverting.");
|
||||||
RunSplendid(SplendidCommand.GamutMode, 0, (int)GetDefaultGamut());
|
RunSplendid(SplendidCommand.GamutMode, 0, (int)GetDefaultGamut());
|
||||||
|
if (ProcessHelper.IsUserAdministrator() && _download)
|
||||||
|
{
|
||||||
|
_download = false;
|
||||||
|
ColorProfileHelper.InstallProfile();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (result == 1 && _init)
|
if (result == 1 && _init)
|
||||||
{
|
{
|
||||||
@@ -262,8 +268,13 @@ namespace GHelper.Display
|
|||||||
if (result == 0) return;
|
if (result == 0) return;
|
||||||
if (result == -1)
|
if (result == -1)
|
||||||
{
|
{
|
||||||
Logger.WriteLine("Visual setting refused, reverting.");
|
Logger.WriteLine("Visual mode setting refused, reverting.");
|
||||||
RunSplendid(SplendidCommand.Default, 0, DefaultColorTemp);
|
RunSplendid(SplendidCommand.Default, 0, DefaultColorTemp);
|
||||||
|
if (ProcessHelper.IsUserAdministrator() && _download)
|
||||||
|
{
|
||||||
|
_download = false;
|
||||||
|
ColorProfileHelper.InstallProfile();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (result == 1 && _init)
|
if (result == 1 && _init)
|
||||||
{
|
{
|
||||||
@@ -356,7 +367,7 @@ namespace GHelper.Display
|
|||||||
public static int SetBrightness(int brightness = -1, int delta = 0)
|
public static int SetBrightness(int brightness = -1, int delta = 0)
|
||||||
{
|
{
|
||||||
if (!AppConfig.IsOLED()) return -1;
|
if (!AppConfig.IsOLED()) return -1;
|
||||||
if (brightness < 0) GetBrightness();
|
if (brightness < 0) brightness = GetBrightness();
|
||||||
|
|
||||||
_brightness = Math.Max(0, Math.Min(100, brightness + delta));
|
_brightness = Math.Max(0, Math.Min(100, brightness + delta));
|
||||||
AppConfig.Set(IsOnBattery() ? "brightness_battery" : "brightness", _brightness);
|
AppConfig.Set(IsOnBattery() ? "brightness_battery" : "brightness", _brightness);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||||
<AssemblyVersion>0.191</AssemblyVersion>
|
<AssemblyVersion>0.192</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
|
|||||||
@@ -278,6 +278,7 @@ namespace GHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (SystemInformation.PowerStatus.PowerLineStatus == isPlugged) return;
|
if (SystemInformation.PowerStatus.PowerLineStatus == isPlugged) return;
|
||||||
|
if (AppConfig.Is("disable_power_event")) return;
|
||||||
SetAutoModes(true);
|
SetAutoModes(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user