From 4a32ba64b371e48a8d21e86c36418f39ad3ff5d5 Mon Sep 17 00:00:00 2001 From: ThioJoe <12518330+ThioJoe@users.noreply.github.com> Date: Wed, 6 Aug 2025 20:11:56 -0700 Subject: [PATCH] Update light theme script to change wallpaper Make the light theme script set the light wallpaper like the dark theme script does. --- General Scripts/Set Theme Light Mode.ps1 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/General Scripts/Set Theme Light Mode.ps1 b/General Scripts/Set Theme Light Mode.ps1 index 9dc546e..781dcb2 100644 --- a/General Scripts/Set Theme Light Mode.ps1 +++ b/General Scripts/Set Theme Light Mode.ps1 @@ -1,8 +1,26 @@ # Enable Light Mode for Apps Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "AppsUseLightTheme" -Value 1 + # Enable Light Mode for System Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "SystemUsesLightTheme" -Value 1 +# Set the Wallpaper +$wallpaperPath = "C:\Windows\Web\Wallpaper\Windows\img0.jpg" +$code = @' +using System.Runtime.InteropServices; +public class Wallpaper { + [DllImport("user32.dll", CharSet=CharSet.Auto)] + public static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni); +} +'@ + +Add-Type $code +$SPI_SETDESKWALLPAPER = 0x0014 +$UPDATE_INI_FILE = 0x01 +$SEND_CHANGE = 0x02 + +[Wallpaper]::SystemParametersInfo($SPI_SETDESKWALLPAPER, 0, $wallpaperPath, ($UPDATE_INI_FILE -bor $SEND_CHANGE)) + # Restart Explorer to apply changes Write-Host "Restarting Explorer..." Stop-Process -Name explorer -Force