Compare commits

..

11 Commits

Author SHA1 Message Date
Serge
77e63f7703 Version bump 2024-03-28 12:57:18 +01:00
Serge
8e686aded3 Merge branch 'main' of https://github.com/seerge/g-helper 2024-03-28 12:56:19 +01:00
Serge
f866f724b2 Generate battery report in user home directory https://github.com/seerge/g-helper/issues/2311 2024-03-28 12:56:17 +01:00
Serge
29408c4256 Update README.md 2024-03-28 03:37:59 +01:00
Serge
c77a87f435 Improved HDR detection 2024-03-27 23:56:13 +01:00
Serge
66a1774d78 Merge branch 'main' of https://github.com/seerge/g-helper 2024-03-27 18:25:56 +01:00
Serge
2532aadb13 Generate battery report when clicking on battery health #2311 2024-03-27 18:25:54 +01:00
Serge
2ba6c9de20 New Crowdin updates (#2310)
* 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)

* New translations strings.resx (Spanish)

* New translations strings.resx (Chinese Traditional)
2024-03-27 18:19:45 +01:00
Vaibhav Garg
e6938ea5cf Add Delay to Screenpad Actions (#2305)
* Add Delay to Screenpad Actions

Added "screenpad_delay" config

* revert .net version

revert .net version
2024-03-27 18:19:36 +01:00
Serge
5bf60e24b5 Improved USB-C charger detection for Optimized mode https://github.com/seerge/g-helper/issues/2143 2024-03-27 18:19:21 +01:00
Serge
731a6c845f Allow clicking on visual-modes label to enable them again 2024-03-27 18:11:57 +01:00
25 changed files with 121 additions and 27 deletions

View File

@@ -6,7 +6,7 @@ namespace GHelper.Display
public class ScreenCCD
{
public static bool GetHDRStatus(bool log = false)
public static bool GetHDRStatus(bool log = true)
{
var err = GetDisplayConfigBufferSizes(QDC.QDC_ONLY_ACTIVE_PATHS, out var pathCount, out var modeCount);
if (err != 0)
@@ -46,8 +46,8 @@ namespace GHelper.Display
info.outputTechnology == DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY.DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DISPLAYPORT_EMBEDDED ||
info.monitorFriendlyDeviceName == internalName)
{
if (log) Logger.WriteLine(info.monitorFriendlyDeviceName + " HDR: " + colorInfo.advancedColorEnabled);
return colorInfo.advancedColorEnabled;
if (log) Logger.WriteLine(info.monitorFriendlyDeviceName + " HDR: " + colorInfo.advancedColorEnabled + " " + colorInfo.bitsPerColorChannel + " " + colorInfo.value + " " + colorInfo.wideColorEnforced);
return colorInfo.advancedColorEnabled && colorInfo.bitsPerColorChannel > 8;
}
}

View File

@@ -40,6 +40,8 @@ namespace GHelper.Display
private static System.Timers.Timer brightnessTimer = new System.Timers.Timer(200);
public const int DefaultColorTemp = 50;
public static bool forceVisual = false;
static VisualControl()
{
brightnessTimer.Elapsed += BrightnessTimerTimer_Elapsed;
@@ -129,8 +131,8 @@ namespace GHelper.Display
if (mode == SplendidCommand.None) return;
if (mode == SplendidCommand.Default && init) return; // Skip default setting on init
if (ScreenCCD.GetHDRStatus(true)) return;
if (ScreenNative.GetRefreshRate(ScreenNative.FindLaptopScreen(true)) < 0) return;
if (!forceVisual && ScreenCCD.GetHDRStatus(true)) return;
if (!forceVisual && ScreenNative.GetRefreshRate(ScreenNative.FindLaptopScreen(true)) < 0) return;
if (whiteBalance != DefaultColorTemp && !init) ProcessHelper.RunAsAdmin();

View File

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

View File

@@ -190,7 +190,7 @@ namespace GHelper.Gpu
int chargerMode = Program.acpi.DeviceGet(AsusACPI.ChargerMode);
Logger.WriteLine("ChargerStatus: " + chargerMode);
if (chargerMode < 0) return true;
if (chargerMode <= 0) return true;
return (chargerMode & AsusACPI.ChargerBarrel) > 0;
}

View File

@@ -809,14 +809,14 @@ namespace GHelper.Input
public static void ToggleScreenpad()
{
int toggle = AppConfig.Is("screenpad_toggle") ? 0 : 1;
int brightness = AppConfig.Get("screenpad", 100);
int brightness = toggle == 0 ? -10 : AppConfig.Get("screenpad", 100);
Program.acpi.DeviceSet(AsusACPI.ScreenPadToggle, toggle, "ScreenpadToggle");
if (toggle > 0) Program.acpi.DeviceSet(AsusACPI.ScreenPadBrightness, Math.Max(brightness * 255 / 100, 0), "Screenpad");
Debug.WriteLine($"Screenpad toggle = {toggle}");
ApplyScreenpadAction(brightness, true);
AppConfig.Set("screenpad_toggle", toggle);
Program.toast.RunToast($"Screen Pad " + (toggle == 1 ? "On" : "Off"), toggle > 0 ? ToastIcon.BrightnessUp : ToastIcon.BrightnessDown);
}
@@ -851,6 +851,37 @@ namespace GHelper.Input
}
private static System.Threading.Timer screenpadActionTimer;
private static int screenpadBrightnessToSet;
public static void ApplyScreenpadAction(int brightness, bool doToggle = false)
{
var delay = AppConfig.Get("screenpad_delay", 1500);
//Action
Action<int> action = (b) =>
{
if (b >= 0) Program.acpi.DeviceSet(AsusACPI.ScreenPadToggle, 1, "ScreenpadOn");
Program.acpi.DeviceSet(AsusACPI.ScreenPadBrightness, Math.Max(b * 255 / 100, 0), "Screenpad");
if (b < 0) Program.acpi.DeviceSet(AsusACPI.ScreenPadToggle, 0, "ScreenpadOff");
};
if(delay <= 0 || (brightness > 0 && brightness < 100 && doToggle == false)) //instant action
{
action(brightness);
}
else //delayed action
{
//Timer Approach
if (screenpadActionTimer == null)
{
screenpadActionTimer = new System.Threading.Timer(_ => action(screenpadBrightnessToSet), null, Timeout.Infinite, Timeout.Infinite);
}
//Start Timer
screenpadBrightnessToSet = brightness;
screenpadActionTimer.Change(delay, Timeout.Infinite);
}
}
public static void SetScreenpad(int delta)
{
int brightness = AppConfig.Get("screenpad", 100);
@@ -860,7 +891,6 @@ namespace GHelper.Input
if (brightness < 0) brightness = 100;
else if (brightness >= 100) brightness = 0;
else brightness = -10;
}
else
{
@@ -869,11 +899,7 @@ namespace GHelper.Input
AppConfig.Set("screenpad", brightness);
if (brightness >= 0) Program.acpi.DeviceSet(AsusACPI.ScreenPadToggle, 1, "ScreenpadOn");
Program.acpi.DeviceSet(AsusACPI.ScreenPadBrightness, Math.Max(brightness * 255 / 100, 0), "Screenpad");
if (brightness < 0) Program.acpi.DeviceSet(AsusACPI.ScreenPadToggle, 0, "ScreenpadOff");
ApplyScreenpadAction(brightness);
string toast;
@@ -882,10 +908,8 @@ namespace GHelper.Input
else toast = brightness.ToString() + "%";
Program.toast.RunToast($"Screen Pad {toast}", delta > 0 ? ToastIcon.BrightnessUp : ToastIcon.BrightnessDown);
}
static void LaunchProcess(string command = "")
{

View File

@@ -494,6 +494,9 @@ Trotzdem fortfahren?</value>
<data name="LaptopScreen" xml:space="preserve">
<value>Laptopbildschirm</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Deckel</value>
</data>
@@ -768,10 +771,10 @@ Trotzdem fortfahren?</value>
<value>Darstellungsmodus</value>
</data>
<data name="VisualModesHDR" xml:space="preserve">
<value>Visual Modes are not available when HDR is active</value>
<value>Darstellungsmodi sind nicht verfügbar, wenn HDR aktiv ist.</value>
</data>
<data name="VisualModesScreen" xml:space="preserve">
<value>Visual Modes are not available when laptop screen is off</value>
<value>Darstellungsmodi sind nicht verfügbar, wenn Laptop-Bildschirm aus ist.</value>
</data>
<data name="VolumeDown" xml:space="preserve">
<value>Lautstärke verringern</value>

View File

@@ -494,6 +494,9 @@
<data name="LaptopScreen" xml:space="preserve">
<value>Pantalla del portátil</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>Indicadores de estado LED</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Tapa</value>
</data>
@@ -768,10 +771,10 @@
<value>Modo visual</value>
</data>
<data name="VisualModesHDR" xml:space="preserve">
<value>Visual Modes are not available when HDR is active</value>
<value>Los modos visuales no están disponibles cuando el HDR está activo</value>
</data>
<data name="VisualModesScreen" xml:space="preserve">
<value>Visual Modes are not available when laptop screen is off</value>
<value>Los modos visuales no están disponibles cuando la pantalla portátil está apagada</value>
</data>
<data name="VolumeDown" xml:space="preserve">
<value>Bajar volumen</value>

View File

@@ -494,6 +494,9 @@ Voulez-vous continuer ?</value>
<data name="LaptopScreen" xml:space="preserve">
<value>Écran</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Capot</value>
</data>

View File

@@ -494,6 +494,9 @@ Do you still want to continue?</value>
<data name="LaptopScreen" xml:space="preserve">
<value>Laptop kijelző</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Fedél</value>
</data>

View File

@@ -494,6 +494,9 @@ Apakah Anda masih ingin melanjutkan?</value>
<data name="LaptopScreen" xml:space="preserve">
<value>Layar Laptop</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Lid</value>
</data>

View File

@@ -494,6 +494,9 @@ Sei sicuro di voler continuare?</value>
<data name="LaptopScreen" xml:space="preserve">
<value>Schermo Laptop</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Lid</value>
</data>

View File

@@ -494,6 +494,9 @@
<data name="LaptopScreen" xml:space="preserve">
<value>화면</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>덮개</value>
</data>

View File

@@ -494,6 +494,9 @@ Vis tiek norite tęsti?</value>
<data name="LaptopScreen" xml:space="preserve">
<value>Ekranas</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Dangtis</value>
</data>

View File

@@ -494,6 +494,9 @@ Nadal chcesz kontynuować?</value>
<data name="LaptopScreen" xml:space="preserve">
<value>Ekran laptopa</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Pokrywa</value>
</data>

View File

@@ -494,6 +494,9 @@ Do you still want to continue?</value>
<data name="LaptopScreen" xml:space="preserve">
<value>Tela</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Tampa</value>
</data>

View File

@@ -494,6 +494,9 @@ Quer prosseguir?</value>
<data name="LaptopScreen" xml:space="preserve">
<value>Ecrã</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Tampa</value>
</data>

View File

@@ -494,6 +494,9 @@
<data name="LaptopScreen" xml:space="preserve">
<value>Ecran Laptop</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Capac</value>
</data>

View File

@@ -494,6 +494,9 @@ Yine de devam etmek istiyor musunuz?</value>
<data name="LaptopScreen" xml:space="preserve">
<value>Laptop Ekranı</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Kapak</value>
</data>

View File

@@ -494,6 +494,9 @@
<data name="LaptopScreen" xml:space="preserve">
<value>Дисплей</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Кришка</value>
</data>

View File

@@ -494,6 +494,9 @@ Do you still want to continue?</value>
<data name="LaptopScreen" xml:space="preserve">
<value>Màn hình Laptop</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>Màn gập</value>
</data>

View File

@@ -494,6 +494,9 @@
<data name="LaptopScreen" xml:space="preserve">
<value>笔记本屏幕</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED Status Indicators</value>
</data>
<data name="Lid" xml:space="preserve">
<value>盖子</value>
</data>

View File

@@ -494,6 +494,9 @@
<data name="LaptopScreen" xml:space="preserve">
<value>螢幕顯示</value>
</data>
<data name="LEDStatusIndicators" xml:space="preserve">
<value>LED狀態指示器</value>
</data>
<data name="Lid" xml:space="preserve">
<value>螢幕背蓋</value>
</data>
@@ -768,10 +771,10 @@
<value>色域模式</value>
</data>
<data name="VisualModesHDR" xml:space="preserve">
<value>Visual Modes are not available when HDR is active</value>
<value>HDR開啟時不支援色域模式</value>
</data>
<data name="VisualModesScreen" xml:space="preserve">
<value>Visual Modes are not available when laptop screen is off</value>
<value>筆電螢幕闔上時不支援色域模式</value>
</data>
<data name="VolumeDown" xml:space="preserve">
<value>音量降低</value>

View File

@@ -1408,6 +1408,7 @@ namespace GHelper
labelCharge.Size = new Size(461, 56);
labelCharge.TabIndex = 40;
labelCharge.TextAlign = ContentAlignment.MiddleRight;
labelCharge.Cursor = Cursors.Hand;
//
// panelPeripherals
//
@@ -1705,6 +1706,7 @@ namespace GHelper
//
// labelVisual
//
labelVisual.Cursor = Cursors.Hand;
labelVisual.ForeColor = SystemColors.GrayText;
labelVisual.Location = new Point(20, 170);
labelVisual.Margin = new Padding(4, 0, 4, 0);
@@ -1874,7 +1876,7 @@ namespace GHelper
AutoScaleMode = AutoScaleMode.Dpi;
AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink;
ClientSize = new Size(849, 1559);
ClientSize = new Size(849, 2045);
Controls.Add(panelFooter);
Controls.Add(panelVersion);
Controls.Add(panelBattery);

View File

@@ -256,10 +256,25 @@ namespace GHelper
VisualiseFnLock();
buttonFnLock.Click += ButtonFnLock_Click;
labelVisual.Click += LabelVisual_Click;
labelCharge.Click += LabelCharge_Click;
panelPerformance.Focus();
InitVisual();
}
private void LabelCharge_Click(object? sender, EventArgs e)
{
var report = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + "\\battery-report.html";
ProcessHelper.RunCMD("powershell", $"powercfg /batteryreport /output \"{report}\"");
ProcessHelper.RunCMD("explorer", $"\"{report}\"");
}
private void LabelVisual_Click(object? sender, EventArgs e)
{
labelVisual.Visible = false;
VisualControl.forceVisual = true;
}
public void InitVisual()
{

View File

@@ -1,7 +1,7 @@
# G-Helper - Lightweight control tool for Asus laptops
[![United24](https://raw.githubusercontent.com/seerge/g-helper/main/docs/ua.png)](https://u24.gov.ua/)
[![GitHub release](https://img.shields.io/github/release/seerge/g-helper)](https://GitHub.com/seerge/g-helper/releases/)
[![Github all releases](https://img.shields.io/github/downloads/seerge/g-helper/total)](https://GitHub.com/seerge/g-helper/releases/) [![GitHub stars](https://img.shields.io/github/stars/seerge/g-helper.svg?style=social)](https://GitHub.com/seerge/g-helper/stargazers/)
[![Github all releases](https://img.shields.io/github/downloads/seerge/g-helper/total)](https://GitHub.com/seerge/g-helper/releases/) [![GitHub stars](https://img.shields.io/github/stars/seerge/g-helper.svg?style=social)](https://GitHub.com/seerge/g-helper/stargazers/) <sup>[中文版点这里](https://github.com/seerge/g-helper/blob/main/docs/README.zh-CN.md)</sup>
Small and lightweight Armoury Crate alternative for Asus laptops offering almost same functionality without extra load and unnecessary services.
Works with all popular models, such as ROG Zephyrus G14, G15, G16, M16, Flow X13, Flow X16, Flow Z13, TUF Series, Strix / Scar Series, ProArt, Vivobook, Zenbook, ROG Ally and many more!