mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 01:58:12 +09:00
windows
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$wallpaperDir = Join-Path $HOME ".wallpaper"
|
||||
|
||||
if (Test-Path (Join-Path $wallpaperDir ".git")) {
|
||||
git -C $wallpaperDir pull --ff-only
|
||||
}
|
||||
elseif (-not (Test-Path $wallpaperDir)) {
|
||||
git clone https://github.com/moons-14/wallpapers.git $wallpaperDir
|
||||
}
|
||||
else {
|
||||
throw "$wallpaperDir exists but is not a Git repository."
|
||||
}
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Failed to synchronize the wallpaper repository."
|
||||
}
|
||||
|
||||
$themeDir = Join-Path $env:LOCALAPPDATA "Microsoft\Windows\Themes"
|
||||
$themeTarget = Join-Path $themeDir "moons-wallpaper.theme"
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $themeDir | Out-Null
|
||||
Copy-Item (Join-Path $PSScriptRoot "wallpaper.theme") $themeTarget -Force
|
||||
|
||||
$currentTheme = (Get-ItemProperty `
|
||||
"HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes" `
|
||||
-Name CurrentTheme `
|
||||
-ErrorAction SilentlyContinue).CurrentTheme
|
||||
|
||||
if ($currentTheme -ne $themeTarget) {
|
||||
Start-Process $themeTarget
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
[Theme]
|
||||
DisplayName=Moons Wallpapers
|
||||
|
||||
[Slideshow]
|
||||
Interval=60000
|
||||
Shuffle=1
|
||||
ImagesRootPath=%USERPROFILE%\.wallpaper
|
||||
|
||||
[Control Panel\Desktop]
|
||||
TileWallpaper=0
|
||||
WallpaperStyle=10
|
||||
Pattern=
|
||||
|
||||
[VisualStyles]
|
||||
Path=%SystemRoot%\resources\themes\Aero\Aero.msstyles
|
||||
ColorStyle=NormalColor
|
||||
Size=NormalSize
|
||||
Transparency=1
|
||||
|
||||
[MasterThemeSelector]
|
||||
MTSM=DABJDKT
|
||||
Reference in New Issue
Block a user