Skip to content

Commit

Permalink
Init Screenpad brightness on start #3301
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Oct 26, 2024
1 parent 5e96e3e commit 1321b2e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/Input/InputDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,13 @@ public static void SetScreenpad(int delta)
Program.toast.RunToast($"Screen Pad {toast}", delta > 0 ? ToastIcon.BrightnessUp : ToastIcon.BrightnessDown);
}

public static void InitScreenpad()
{
if (!AppConfig.IsDUO()) return;
int brightness = AppConfig.Get("screenpad");
if (brightness >= 0) ApplyScreenpadAction(brightness);
}

static void LaunchProcess(string command = "")
{
if (string.IsNullOrEmpty(command)) return;
Expand Down
7 changes: 6 additions & 1 deletion app/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,12 @@ public static bool SetAutoModes(bool powerChanged = false, bool init = false)
Logger.WriteLine("AutoSetting for " + isPlugged.ToString());

BatteryControl.AutoBattery(init);
if (init) screenControl.InitMiniled();

if (init)
{
screenControl.InitMiniled();
InputDispatcher.InitScreenpad();
}

inputDispatcher.Init();

Expand Down

0 comments on commit 1321b2e

Please sign in to comment.