Skip to content

Commit

Permalink
Added Optimal Display Brightness #3430
Browse files Browse the repository at this point in the history
seerge committed Dec 23, 2024
1 parent b58c808 commit 2feb6f9
Showing 3 changed files with 371 additions and 342 deletions.
2 changes: 2 additions & 0 deletions app/AsusACPI.cs
Original file line number Diff line number Diff line change
@@ -83,6 +83,8 @@ public class AsusACPI
public const uint ScreenMiniled2 = 0x0005002E;
public const uint ScreenFHD = 0x0005001C;

public const uint ScreenOptimalBrightness = 0x0005002A;

public const uint DevsCPUFan = 0x00110022;
public const uint DevsGPUFan = 0x00110023;

701 changes: 359 additions & 342 deletions app/Extra.Designer.cs

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions app/Extra.cs
Original file line number Diff line number Diff line change
@@ -425,6 +425,11 @@ public Extra()
checkStatusLed.Checked = (statusLed > 0);
checkStatusLed.CheckedChanged += CheckLEDStatus_CheckedChanged;

var optimalBrightness = Program.acpi.DeviceGet(AsusACPI.ScreenOptimalBrightness);
checkOptimalBrightness.Visible = optimalBrightness >= 0;
checkOptimalBrightness.Checked = (optimalBrightness > 0);
checkOptimalBrightness.CheckedChanged += CheckOptimalBrightness_CheckedChanged;


checkBWIcon.Checked = AppConfig.IsBWIcon();
checkBWIcon.CheckedChanged += CheckBWIcon_CheckedChanged;
@@ -453,6 +458,11 @@ public Extra()

}

private void CheckOptimalBrightness_CheckedChanged(object? sender, EventArgs e)
{
Program.acpi.DeviceSet(AsusACPI.ScreenOptimalBrightness, checkOptimalBrightness.Checked ? 1 : 0, "Optimal Brightness");
}

private void CheckPerKeyRGB_CheckedChanged(object? sender, EventArgs e)
{
AppConfig.Set("per_key_rgb", (checkPerKeyRGB.Checked ? 1 : 0));

0 comments on commit 2feb6f9

Please sign in to comment.