Skip to content

Commit

Permalink
Option to skip PowerMode setting #3287
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Oct 25, 2024
1 parent 5e4bd13 commit 5e96e3e
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions app/Mode/ModeControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,30 +110,24 @@ public void SetPerformanceMode(int mode = -1, bool notify = false)

if (notify) Toast();

// Power plan from config or defaulting to balanced
if (AppConfig.GetModeString("scheme") is not null)
PowerNative.SetPowerPlan(AppConfig.GetModeString("scheme"));
else
PowerNative.SetBalancedPowerPlan();
if (!AppConfig.Is("skip_powermode"))
{
// Power plan from config or defaulting to balanced
if (AppConfig.GetModeString("scheme") is not null)
PowerNative.SetPowerPlan(AppConfig.GetModeString("scheme"));
else
PowerNative.SetBalancedPowerPlan();

// Windows power mode
if (AppConfig.GetModeString("powermode") is not null)
PowerNative.SetPowerMode(AppConfig.GetModeString("powermode"));
else
PowerNative.SetPowerMode(Modes.GetBase(mode));
// Windows power mode
if (AppConfig.GetModeString("powermode") is not null)
PowerNative.SetPowerMode(AppConfig.GetModeString("powermode"));
else
PowerNative.SetPowerMode(Modes.GetBase(mode));
}

// CPU Boost setting override
if (AppConfig.GetMode("auto_boost") != -1)
PowerNative.SetCPUBoost(AppConfig.GetMode("auto_boost"));

//BatteryControl.SetBatteryChargeLimit();

/*
if (NativeMethods.PowerGetEffectiveOverlayScheme(out Guid activeScheme) == 0)
{
Debug.WriteLine("Effective :" + activeScheme);
}
*/
PowerNative.SetCPUBoost(AppConfig.GetMode("auto_boost"));

settings.FansInit();
}
Expand Down Expand Up @@ -162,7 +156,8 @@ public void CyclePerformanceMode(bool back = false)
modeToggleTimer.Start();
Modes.SetCurrent(Modes.GetNext(back));
Toast();
} else
}
else
{
SetPerformanceMode(Modes.GetNext(back), true);
}
Expand Down Expand Up @@ -385,7 +380,7 @@ public void SetGPUPower()
if (gpu_power >= AsusACPI.MinGPUPower && gpu_power <= AsusACPI.MaxGPUPower && Program.acpi.DeviceGet(AsusACPI.GPU_POWER) >= 0)
Program.acpi.DeviceSet(AsusACPI.GPU_POWER, gpu_power, "PowerLimit TGP (GPU VAR)");

if (gpu_boost >= AsusACPI.MinGPUBoost && gpu_boost <= AsusACPI.MaxGPUBoost && Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0)
if (gpu_boost >= AsusACPI.MinGPUBoost && gpu_boost <= AsusACPI.MaxGPUBoost && Program.acpi.DeviceGet(AsusACPI.PPT_GPUC0) >= 0)
boostResult = Program.acpi.DeviceSet(AsusACPI.PPT_GPUC0, gpu_boost, "PowerLimit C0 (GPU BOOST)");

if (gpu_temp >= AsusACPI.MinGPUTemp && gpu_temp <= AsusACPI.MaxGPUTemp && Program.acpi.DeviceGet(AsusACPI.PPT_GPUC2) >= 0)
Expand Down

0 comments on commit 5e96e3e

Please sign in to comment.