Update light theme script to change wallpaper

Make the light theme script set the light wallpaper like the dark theme script does.
pull/2/head
ThioJoe 2025-08-06 20:11:56 -07:00
parent 9c29c4f0e8
commit 4a32ba64b3
No known key found for this signature in database
GPG Key ID: 2E328FE64CC3898C
1 changed files with 18 additions and 0 deletions

View File

@ -1,8 +1,26 @@
# Enable Light Mode for Apps # Enable Light Mode for Apps
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "AppsUseLightTheme" -Value 1 Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "AppsUseLightTheme" -Value 1
# Enable Light Mode for System # Enable Light Mode for System
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "SystemUsesLightTheme" -Value 1 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 # Restart Explorer to apply changes
Write-Host "Restarting Explorer..." Write-Host "Restarting Explorer..."
Stop-Process -Name explorer -Force Stop-Process -Name explorer -Force