diff --git a/README.md b/README.md index dcae593b..b67b92af 100644 --- a/README.md +++ b/README.md @@ -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. -------- diff --git a/g14-helper.exe b/g14-helper.exe index a66bcbef..7d105f32 100644 Binary files a/g14-helper.exe and b/g14-helper.exe differ diff --git a/gpu.ps1 b/gpu.ps1 index 71e8ffa7..6538bfd9 100644 --- a/gpu.ps1 +++ b/gpu.ps1 @@ -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);