Last minute fix

This commit is contained in:
seerge
2023-02-12 21:52:08 +01:00
parent ef7a3d4431
commit 57e3cc418a
3 changed files with 14 additions and 5 deletions

View File

@@ -18,6 +18,8 @@ UPDATE: February 12, 2023
3. App will save settings and write a basic log of it's actions to APPDATA\LOCAL directory
4. App will reapply Panel Overdrive and Performance mode on each start (based on last setting from config)
Extra: **autostart.ps1** script to schedule autostart of the app (with admin privileges) on every user logon for convenience. Later will be integrated into main app.
--------

Binary file not shown.

17
gpu.ps1
View File

@@ -388,31 +388,38 @@ function SetGPUMode ($gpu_mode = "standard") {
if ($gpu_mode -eq $script:gpu_mode) {return}
$restart = $false;
$changed = $false;
if ($script:gpu_mode -eq "ultimate") {
$msgBox = [System.Windows.MessageBox]::Show('Switching off Ultimate Mode requires restart','Reboot now?','OKCancel')
if ($msgBox -eq 'OK') {
Invoke-CimMethod $asushw -MethodName DEVS -Arguments @{Device_ID=$device_mux ; Control_status=1 }
$restart = $true;
$restart = $true;
$changed = $true;
}
} elseif ($gpu_mode -eq "ultimate") {
$msgBox = [System.Windows.MessageBox]::Show('Ultimate mode requires restart','Reboot now?','OKCancel')
if ($msgBox -eq 'OK') {
Invoke-CimMethod $asushw -MethodName DEVS -Arguments @{Device_ID=$device_mux ; Control_status=0 }
$restart = $true;
$restart = $true;
$changed = $true;
}
} elseif ($gpu_mode -eq "eco") {
UIGPUMode($gpu_mode);
Invoke-CimMethod $asushw -MethodName DEVS -Arguments @{Device_ID=$device_eco ; Control_status=1 }
$changed = $true;
} elseif ($gpu_mode -eq "standard") {
UIGPUMode($gpu_mode);
Invoke-CimMethod $asushw -MethodName DEVS -Arguments @{Device_ID=$device_eco ; Control_status=0 }
$changed = $true;
}
$script:gpu_mode = $gpu_mode;
SaveConfigSetting -Name 'gpu_mode' -Value $gpu_mode
if ($changed) {
$script:gpu_mode = $gpu_mode;
SaveConfigSetting -Name 'gpu_mode' -Value $gpu_mode
WriteLog("GPU set to "+$gpu_mode)
}
WriteLog("GPU set to "+$gpu_mode)
if ($restart) {
UIGPUMode($gpu_mode);