mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9e25b6358 | ||
|
|
fb4a0cf3db | ||
|
|
b534becbf5 | ||
|
|
99316da55e | ||
|
|
cf92e04501 | ||
|
|
39514d89f6 | ||
|
|
293ab6f35d | ||
|
|
f2967fcc79 | ||
|
|
e060feaf09 | ||
|
|
178f61a98d | ||
|
|
79b8d6fa14 | ||
|
|
007f6ef1a3 | ||
|
|
1637f36d1d | ||
|
|
0f3f54c50a | ||
|
|
aff667345d | ||
|
|
b14ee181f9 |
31
.github/workflows/main.yml
vendored
Normal file
31
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
name: Main
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*.*"
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
mkdir release
|
||||||
|
cp *.exe ./release
|
||||||
|
cp ghelper.ps1 ./release
|
||||||
|
zip -r g14-helper.zip ./release
|
||||||
|
|
||||||
|
- name: Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
g14-helper.zip
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ A small windows system tray utility that allows you to switch between 3 main GPU
|
|||||||
2. Standard mode (Windows Hybrid) : iGPU and dGPU (Radeon 6700s/6800s) enabled, iGPU drives built in display
|
2. Standard mode (Windows Hybrid) : iGPU and dGPU (Radeon 6700s/6800s) enabled, iGPU drives built in display
|
||||||
3. Ultimate mode: iGPU and dGPU enabled, but dGPU drives built in display
|
3. Ultimate mode: iGPU and dGPU enabled, but dGPU drives built in display
|
||||||
|
|
||||||
##UPDATE: February 12, 2023
|
## UPDATE: February 12, 2023
|
||||||
|
|
||||||
1. Added switching of **Performance profiles (including default fan curves)** is also available! switching happens via same ASUS WMI low level commands. Profiles are same as in Armory Crate - Silent, Balanced and Turbo.
|
1. Added switching of **Performance profiles (including default fan curves)** is also available! switching happens via same ASUS WMI low level commands. Profiles are same as in Armory Crate - Silent, Balanced and Turbo.
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
$taskName = "G14Helper"
|
|
||||||
$task = Get-ScheduledTask -TaskName $taskName -ErrorAction SilentlyContinue
|
|
||||||
if ($task -ne $null)
|
|
||||||
{
|
|
||||||
Unregister-ScheduledTask -TaskName $taskName -Confirm:$false
|
|
||||||
}
|
|
||||||
|
|
||||||
$scriptDir = Split-Path $PSCommandPath -Parent
|
|
||||||
|
|
||||||
# TODO: EDIT THIS STUFF AS NEEDED...
|
|
||||||
$action = New-ScheduledTaskAction -Execute "$scriptDir\g14-helper.exe"
|
|
||||||
$trigger = New-ScheduledTaskTrigger -AtLogon
|
|
||||||
$settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries
|
|
||||||
|
|
||||||
$principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -RunLevel Highest
|
|
||||||
$definition = New-ScheduledTask -Action $action -Principal $principal -Trigger $trigger -Settings $settings -Description "Run $($taskName) at Logon"
|
|
||||||
|
|
||||||
Register-ScheduledTask -TaskName $taskName -InputObject $definition
|
|
||||||
BIN
g14-helper.exe
BIN
g14-helper.exe
Binary file not shown.
@@ -1,2 +1,2 @@
|
|||||||
ps2exe .\gpu.ps1 g14-helper.exe -title 'G14 Helper' -DPIAware -winFormsDPIAware -requireAdmin -iconFile 'standard.ico' -noConsole -copyright 'G14 Helper Tool' -noOutput
|
ps2exe .\ghelper.ps1 g14-helper.exe -title 'G14 Helper' -DPIAware -winFormsDPIAware -requireAdmin -iconFile 'standard.ico' -noConsole -copyright 'G14 Helper Tool' -noOutput
|
||||||
.\g14-helper.exe
|
.\g14-helper.exe
|
||||||
@@ -17,7 +17,7 @@ Function Get-PSScriptPath {
|
|||||||
function SetAutostart () {
|
function SetAutostart () {
|
||||||
$taskName = "G14Helper"
|
$taskName = "G14Helper"
|
||||||
$task = Get-ScheduledTask -TaskName $taskName -ErrorAction SilentlyContinue
|
$task = Get-ScheduledTask -TaskName $taskName -ErrorAction SilentlyContinue
|
||||||
if ($task -ne $null) {return }
|
if ($null -ne $task) {return }
|
||||||
|
|
||||||
$scriptDir = Get-PSScriptPath
|
$scriptDir = Get-PSScriptPath
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ function SetAutostart () {
|
|||||||
|
|
||||||
function CheckAutostart () {
|
function CheckAutostart () {
|
||||||
$task = Get-ScheduledTask -TaskName "G14Helper" -ErrorAction SilentlyContinue
|
$task = Get-ScheduledTask -TaskName "G14Helper" -ErrorAction SilentlyContinue
|
||||||
$Menu_Autostart.Checked = ($task -ne $null)
|
$Menu_Autostart.Checked = ($null -ne $task)
|
||||||
}
|
}
|
||||||
|
|
||||||
function DisableAutostart () {
|
function DisableAutostart () {
|
||||||
@@ -190,8 +190,8 @@ $icon_ultimate = [Drawing.Icon][IO.MemoryStream][Convert]::FromBase64String("AAA
|
|||||||
|
|
||||||
# Init Config and Log
|
# Init Config and Log
|
||||||
$ghelper_app_path = "$($env:LOCALAPPDATA)\GHelper"
|
$ghelper_app_path = "$($env:LOCALAPPDATA)\GHelper"
|
||||||
$ghelper_config_path = "$($env:LOCALAPPDATA)\GHelper\config.json"
|
$ghelper_config_path = "$ghelper_app_path\config.json"
|
||||||
$ghelper_log_path = "$($env:LOCALAPPDATA)\GHelper\log.txt"
|
$ghelper_log_path = "$ghelper_app_path\log.txt"
|
||||||
|
|
||||||
New-Item -ItemType Directory -Force -Path $ghelper_app_path
|
New-Item -ItemType Directory -Force -Path $ghelper_app_path
|
||||||
|
|
||||||
@@ -203,6 +203,7 @@ $Main_Tool_Icon.Visible = $true
|
|||||||
|
|
||||||
$Menu_Perf_Title = New-Object System.Windows.Forms.MenuItem("Mode")
|
$Menu_Perf_Title = New-Object System.Windows.Forms.MenuItem("Mode")
|
||||||
$Menu_Perf_Title.Enabled = $false
|
$Menu_Perf_Title.Enabled = $false
|
||||||
|
|
||||||
$Menu_Perf_Silent = New-Object System.Windows.Forms.MenuItem("Silent")
|
$Menu_Perf_Silent = New-Object System.Windows.Forms.MenuItem("Silent")
|
||||||
$Menu_Perf_Balanced = New-Object System.Windows.Forms.MenuItem("Balanced")
|
$Menu_Perf_Balanced = New-Object System.Windows.Forms.MenuItem("Balanced")
|
||||||
$Menu_Perf_Turbo = New-Object System.Windows.Forms.MenuItem("Turbo")
|
$Menu_Perf_Turbo = New-Object System.Windows.Forms.MenuItem("Turbo")
|
||||||
@@ -229,30 +230,46 @@ $Menu_Autostart = New-Object System.Windows.Forms.MenuItem("Run on startup")
|
|||||||
$Menu_Exit = New-Object System.Windows.Forms.MenuItem("Exit")
|
$Menu_Exit = New-Object System.Windows.Forms.MenuItem("Exit")
|
||||||
|
|
||||||
$contextmenu = New-Object System.Windows.Forms.ContextMenu
|
$contextmenu = New-Object System.Windows.Forms.ContextMenu
|
||||||
|
|
||||||
|
$contextmenu.MenuItems.AddRange($Menu_Perf_Title)
|
||||||
|
$contextmenu.MenuItems.AddRange($Menu_Perf_Silent)
|
||||||
|
$contextmenu.MenuItems.AddRange($Menu_Perf_Balanced)
|
||||||
|
$contextmenu.MenuItems.AddRange($Menu_Perf_Turbo)
|
||||||
|
$contextmenu.MenuItems.AddRange("-")
|
||||||
|
|
||||||
|
$contextmenu.MenuItems.AddRange($Menu_Title)
|
||||||
|
$contextmenu.MenuItems.AddRange($Menu_Eco)
|
||||||
|
$contextmenu.MenuItems.AddRange($Menu_Standard)
|
||||||
|
$contextmenu.MenuItems.AddRange($Menu_Ultimate)
|
||||||
|
$contextmenu.MenuItems.AddRange("-")
|
||||||
|
|
||||||
|
$contextmenu.MenuItems.AddRange($Menu_RR)
|
||||||
|
$contextmenu.MenuItems.AddRange($Menu_RR60)
|
||||||
|
$contextmenu.MenuItems.AddRange($Menu_RR120)
|
||||||
|
$contextmenu.MenuItems.AddRange($Menu_OD)
|
||||||
|
|
||||||
|
$contextmenu.MenuItems.AddRange("-")
|
||||||
|
|
||||||
|
$Menu_Charge60 = New-Object System.Windows.Forms.MenuItem("60%")
|
||||||
|
$Menu_Charge80 = New-Object System.Windows.Forms.MenuItem("80%")
|
||||||
|
$Menu_Charge100 = New-Object System.Windows.Forms.MenuItem("100%")
|
||||||
|
|
||||||
|
$Submenu_Charge = New-Object System.Windows.Forms.MenuItem("Charge Limit")
|
||||||
|
$Submenu_Charge.MenuItems.AddRange($Menu_Charge60)
|
||||||
|
$Submenu_Charge.MenuItems.AddRange($Menu_Charge80)
|
||||||
|
$Submenu_Charge.MenuItems.AddRange($Menu_Charge100)
|
||||||
|
$contextmenu.MenuItems.AddRange($Submenu_Charge)
|
||||||
|
|
||||||
|
|
||||||
|
$contextmenu.MenuItems.AddRange("-")
|
||||||
|
$contextmenu.MenuItems.AddRange($Menu_Autostart)
|
||||||
|
|
||||||
|
$contextmenu.MenuItems.AddRange("-")
|
||||||
|
$contextmenu.MenuItems.AddRange($Menu_Exit)
|
||||||
|
|
||||||
|
|
||||||
$Main_Tool_Icon.ContextMenu = $contextmenu
|
$Main_Tool_Icon.ContextMenu = $contextmenu
|
||||||
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange($Menu_Perf_Title)
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange($Menu_Perf_Silent)
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange($Menu_Perf_Balanced)
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange($Menu_Perf_Turbo)
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange("-")
|
|
||||||
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange($Menu_Title)
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange($Menu_Eco)
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange($Menu_Standard)
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange($Menu_Ultimate)
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange("-")
|
|
||||||
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange($Menu_RR)
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange($Menu_RR60)
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange($Menu_RR120)
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange($Menu_OD)
|
|
||||||
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange("-")
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange($Menu_Autostart)
|
|
||||||
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange("-")
|
|
||||||
$Main_Tool_Icon.contextMenu.MenuItems.AddRange($Menu_Exit)
|
|
||||||
|
|
||||||
# Hardware Initialisation
|
# Hardware Initialisation
|
||||||
|
|
||||||
@@ -393,6 +410,33 @@ function SetPeformanceMode ($performance_mode = 0) {
|
|||||||
WriteLog("Performance set to "+$performance_mode)
|
WriteLog("Performance set to "+$performance_mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function SetChargeLimit ($charge_limit = 100) {
|
||||||
|
|
||||||
|
$Menu_Charge60.Checked = $false;
|
||||||
|
$Menu_Charge80.Checked = $false;
|
||||||
|
$Menu_Charge100.Checked = $false;
|
||||||
|
|
||||||
|
switch ($charge_limit)
|
||||||
|
{
|
||||||
|
60 {
|
||||||
|
$Menu_Charge60.Checked = $true
|
||||||
|
}
|
||||||
|
80 {
|
||||||
|
$Menu_Charge80.Checked = $true
|
||||||
|
}
|
||||||
|
Default {
|
||||||
|
$Menu_Charge100.Checked = $true
|
||||||
|
$charge_limit = 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveConfigSetting -Name 'charge_limit' -Value $charge_limit
|
||||||
|
$Submenu_Charge.Text = "Charge Limit: $charge_limit%"
|
||||||
|
Invoke-CimMethod $asushw -MethodName DEVS -Arguments @{Device_ID=0x00120057 ; Control_status=$charge_limit }
|
||||||
|
WriteLog("Charge limit set to "+$charge_limit)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function SetPanelOverdrive ($overdrive = 1) {
|
function SetPanelOverdrive ($overdrive = 1) {
|
||||||
SaveConfigSetting -Name 'panel_overdrive' -Value $overdrive
|
SaveConfigSetting -Name 'panel_overdrive' -Value $overdrive
|
||||||
Invoke-CimMethod $asushw -MethodName DEVS -Arguments @{Device_ID=$device_overdrive ; Control_status=$overdrive }
|
Invoke-CimMethod $asushw -MethodName DEVS -Arguments @{Device_ID=$device_overdrive ; Control_status=$overdrive }
|
||||||
@@ -487,7 +531,7 @@ function UIGPUMode ($gpu_mode) {
|
|||||||
$Main_Tool_Icon.Icon = $icon_eco
|
$Main_Tool_Icon.Icon = $icon_eco
|
||||||
}
|
}
|
||||||
"ultimate" {
|
"ultimate" {
|
||||||
$script:title_gpu = "GPU: dGPU exclusive"
|
$script:title_gpu = "GPU: dGPU"
|
||||||
$Menu_Ultimate.Checked = $true
|
$Menu_Ultimate.Checked = $true
|
||||||
$Main_Tool_Icon.Icon = $icon_ultimate
|
$Main_Tool_Icon.Icon = $icon_ultimate
|
||||||
}
|
}
|
||||||
@@ -507,6 +551,7 @@ LoadConfig
|
|||||||
|
|
||||||
SetPeformanceMode(GetConfigSetting('performance_mode'))
|
SetPeformanceMode(GetConfigSetting('performance_mode'))
|
||||||
SetPanelOverdrive(GetConfigSetting('panel_overdrive'))
|
SetPanelOverdrive(GetConfigSetting('panel_overdrive'))
|
||||||
|
SetChargeLimit(GetConfigSetting('charge_limit'))
|
||||||
|
|
||||||
GetGPUMode
|
GetGPUMode
|
||||||
|
|
||||||
@@ -566,6 +611,18 @@ $Menu_RR120.add_Click({
|
|||||||
CheckScreen
|
CheckScreen
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$Menu_Charge60.add_Click({
|
||||||
|
SetChargeLimit(60)
|
||||||
|
})
|
||||||
|
|
||||||
|
$Menu_Charge80.add_Click({
|
||||||
|
SetChargeLimit(80)
|
||||||
|
})
|
||||||
|
|
||||||
|
$Menu_Charge100.add_Click({
|
||||||
|
SetChargeLimit(100)
|
||||||
|
})
|
||||||
|
|
||||||
$Menu_OD.add_Click({
|
$Menu_OD.add_Click({
|
||||||
if ($Menu_OD.Checked) {
|
if ($Menu_OD.Checked) {
|
||||||
SetPanelOverdrive(0)
|
SetPanelOverdrive(0)
|
||||||
BIN
resources/icons8-charging-battery-48.png
Normal file
BIN
resources/icons8-charging-battery-48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 421 B |
BIN
resources/icons8-laptop-48.png
Normal file
BIN
resources/icons8-laptop-48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 260 B |
BIN
resources/icons8-speed-48.png
Normal file
BIN
resources/icons8-speed-48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 885 B |
BIN
resources/icons8-video-card-48.png
Normal file
BIN
resources/icons8-video-card-48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 400 B |
Reference in New Issue
Block a user