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
parent
9c29c4f0e8
commit
4a32ba64b3
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue