From 0ba0654a2e7fbcede9bd35d031e5c89bf9d6b7c4 Mon Sep 17 00:00:00 2001 From: Justawildwolf <62820836+blusewill@users.noreply.github.com> Date: Fri, 22 Mar 2024 06:55:05 +0800 Subject: [PATCH] Change the Theme Configuration for low spec. (#1643) * Update close-old-issues.yaml * Compile Winutil * Update close-old-issues.yaml * Update close-old-issues.yaml * Update close-old-issues.yaml * Added New Dark Themes for Low Spec PC and added GPU Detection * Compile Winutil --------- Co-authored-by: Chris Titus Co-authored-by: ChrisTitusTech Co-authored-by: Chris Titus --- config/themes.json | 34 +++++++++++++++++++++++-- functions/private/Invoke-WinUtilGPU.ps1 | 29 +++++++++++++++++++++ scripts/main.ps1 | 9 +++++-- 3 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 functions/private/Invoke-WinUtilGPU.ps1 diff --git a/config/themes.json b/config/themes.json index 1055827f..fb23ca95 100644 --- a/config/themes.json +++ b/config/themes.json @@ -1,5 +1,5 @@ { - "Classic": { + "Classic": { "ComboBoxBackgroundColor": "#FFFFFF", "LabelboxForegroundColor": "#000000", "MainForegroundColor": "#000000", @@ -60,5 +60,35 @@ "BorderColor": "#FFAC1C", "BorderOpacity": "0.8", "ShadowPulse": "0:0:3" + }, + "Dark": { + "ComboBoxBackgroundColor": "#000000", + "LabelboxForegroundColor": "#FFEE58", + "MainForegroundColor": "#9CCC65", + "MainBackgroundColor": "#000000", + "LabelBackgroundColor": "#000000", + "LinkForegroundColor": "#add8e6", + "LinkHoverForegroundColor": "#FFFFFF", + "ComboBoxForegroundColor": "#FFEE58", + "ButtonInstallBackgroundColor": "#222222", + "ButtonTweaksBackgroundColor": "#333333", + "ButtonConfigBackgroundColor": "#444444", + "ButtonUpdatesBackgroundColor": "#555555", + "ButtonInstallForegroundColor": "#FFFFFF", + "ButtonTweaksForegroundColor": "#FFFFFF", + "ButtonConfigForegroundColor": "#FFFFFF", + "ButtonUpdatesForegroundColor": "#FFFFFF", + "ButtonBackgroundColor": "#000019", + "ButtonBackgroundPressedColor": "#9CCC65", + "ButtonBackgroundMouseoverColor": "#FF5733", + "ButtonBackgroundSelectedColor": "#FF5733", + "ButtonForegroundColor": "#9CCC65", + "ButtonBorderThickness": "1", + "ButtonMargin": "1", + "ButtonCornerRadius": "2", + "ToggleButtonHeight": "25", + "BorderColor": "#FFAC1C", + "BorderOpacity": "0.2", + "ShadowPulse": "Forever" } -} +} \ No newline at end of file diff --git a/functions/private/Invoke-WinUtilGPU.ps1 b/functions/private/Invoke-WinUtilGPU.ps1 new file mode 100644 index 00000000..23493922 --- /dev/null +++ b/functions/private/Invoke-WinUtilGPU.ps1 @@ -0,0 +1,29 @@ +function Invoke-GPUCheck { + $gpuInfo = Get-WmiObject Win32_VideoController + + foreach ($gpu in $gpuInfo) { + $gpuName = $gpu.Name + if ($gpuName -like "*NVIDIA*") { + return $true # NVIDIA GPU found + } + } + + foreach ($gpu in $gpuInfo) { + $gpuName = $gpu.Name + if ($gpuName -like "*AMD Radeon RX*") { + return $true # AMD GPU Found + } + } + foreach ($gpu in $gpuInfo) { + $gpuName = $gpu.Name + if ($gpuName -like "*UHD*") { + return $false # Intel Intergrated GPU Found + } + } + foreach ($gpu in $gpuInfo) { + $gpuName = $gpu.Name + if ($gpuName -like "*AMD Radeon(TM)*") { + return $false # AMD Intergrated GPU Found + } + } +} \ No newline at end of file diff --git a/scripts/main.ps1 b/scripts/main.ps1 index adaab233..4e776ad1 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -53,7 +53,12 @@ $sync.runspace.Open() $inputXML = $inputXML -replace 'mc:Ignorable="d"', '' -replace "x:N", 'N' -replace '^