Repository navigation
Expand file tree
/
Copy pathat-config.ps1
More file actions
158 lines (120 loc) · 8.96 KB
/
Copy pathat-config.ps1
File metadata and controls
158 lines (120 loc) · 8.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# ============= Theme variables =============
<# If `$true`, the script will use `.theme` files to select light and dark themes, as well as wallpaper slideshows and other personalizations. If `$false`, it will use its own native system to switch between dark and light modes, and implement a wallpaper slideshow accordingly. #>
$useThemeFiles = $false
<# Name of theme files
* Only relevant when `$useThemeFiles = $true` #>
$themeLight = "Name-of-Light.theme"
$themeDark = "Name-of-Dark.theme"
<# COMPLETE PATH to the `.theme` files. You can use the default path to Windows themes
(as proposed in the example below) or a custom path of your choice. You can use `$lightPath = Join-Path $PSScriptRoot $themeLight` if your `.theme` files are located within the script folder.
* Only relevant when `$useThemeFiles = $true` #>
$lightPath = Join-Path (Join-Path $Env:LOCALAPPDATA "Microsoft\Windows\Themes") $themeLight
$darkPath = Join-Path (Join-Path $Env:LOCALAPPDATA "Microsoft\Windows\Themes") $themeDark
# ============= Wallpaper variables =============
<# If `$true`, the script will only switch between Dark and Light modes, ignoring wallpapers.
* Only relevant when `$useThemeFiles = $false` #>
$noWallpaperChange = $false
<# Randomize wallpaper - when NOT using `.theme` files. If `$true`, picks a random wallpaper from the wallpaper paths. If `$false`, walks the folder in alphabetical order, advancing one picture per slideshow tick or 'Next wallpaper' command, and wrapping around at the end. Light and Dark keep their own place, so each mode resumes where it left off.
* Only relevant when `$useThemeFiles = $false` #>
$randomizeWallpaper = $false
<# Interval at which to randomize wallpapers. This effectively replaces Windows' own slideshow feature. This will create a specific Scheduled task to handle wallpaper changes at the defined interval. Set to "0" to disable this feature.
* Only relevant when `$useThemeFiles = $false` #>
$slideShowInterval = "20" # minutes
<# Display the wallpaper name when it changes.
"rainmeter" - Displays the name as on overlay, via Rainmeter (a 'skin' is provided as example.)
"notification" - Shows a Windows BurntToast notification.
"none" - Changes the wallpaper with no UI feedback.
* Only relevant when `$useThemeFiles = $false`
Note: To achieve the same effect when using `.theme` files or the Windows standard slideshow, check my Wallpaper Name Notification script on Github. #>
$howToDisplayName = "none"
<# Path to Rainmeter executable
* Only relevant when `$useThemeFiles = $false` #>
$rainmeterPath = "C:\Program Files\Rainmeter\Rainmeter.exe"
<# The Config Name of your Rainmeter skin.
This is the relative path from your 'Skins' folder to the folder containing the `.ini` file.
Example: If the skin is in 'Skns\AutoTheme\Wallpaper\at.ini', use "AutoTheme\Wallpaper" You can find in the repository a functional example of a skin that shows the wallpaper name at the bottom of the screen. #>
$rainmeterSkinName = "auto-theme"
$rainmeterSkinFile = "auto-theme.ini"
<# Randomize FIRST wallpaper - when using `.theme` files AND shuffling wallpapers.
Even if `shuffle=1` is set in a `.theme` file, Windows will always use the first wallpaper in alphabetic order as the first shown. Setting this to `$true` offers more variety as soon as the theme is applied. Be aware that, to this end, a randomly-picked wallpaper file will be temporarily renamed with a `0_at` string prepended to it.
* Only relevant when `$useThemeFiles = $true` #>
$randomFirst = $true
<# Paths to the folders for light and dark wallpapers.
If `$useThemeFiles = $true`, indicate here the same FOLDER PATHS indicated in the `.theme` files. Otherwise indicate PATHS to IMAGES OR FOLDERS to be selected for Light and Dark modes. #>
$wallLightPath = "C:\Path\to\Light\wallpapers"
$wallDarkPath = "C:\Path\to\Dark\wallpapers"
# Show the wallpaper name in notification
$showWallName = $false
# ============= Lock screen variables =============
<# If `$true`, the lock screen picture is changed to match the desktop wallpaper. Requires the default Windows PowerShell up to 5.1, as it relies on a WinRT API not available in PowerShell 7.
* Only relevant when `$useThemeFiles = $false` #>
$changeLockScreen = $false
<# If `$true`, the lock screen picture only changes when the theme changes (sunrise, sunset, or manual toggle),
and is left alone by the wallpaper slideshow and by the 'Next background picture' command. If `$false`, the lock screen follows every single wallpaper change.
* Only relevant when `$changeLockScreen = $true` #>
$lockScreenOnThemeSwitchOnly = $false
<# Windows Spotlight silently overwrites any lock screen picture set by this script. If `$true`, Spotlight is turned off so that the chosen pictures actually stick. Set to `$false` only if you would rather keep Spotlight and manage this yourself.
* Only relevant when `$changeLockScreen = $true` #>
$disableSpotlight = $true
# ============= Time variables =============
# Use fixed hours to switch Themes (keeps the script completely offline)
$useFixedHours = $false
<# Fixed hours for theme change (only needed if $useFixedHours = $true). You are free to use 12 or 24 hours formats here. #>
$lightThemeTime = "07:00 AM"
$darkThemeTime = "07:00 PM"
<# Set to `$true` to always use a user-defined location. If `$false`, the script will attempt to retrieve location from the system or, failing that, from your ISP, which may not give accurate results. #>
$useUserLoc = $false
<# User-defined coordinates and timezone. You can obtain your coordinates from Google or similar services.
You can find a list of timezone identifiers at this url:
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
* Only relevant if `$useUserLoc = $true`#>
$userLat = "40.7128"
$userLng = "-74.0060"
$UserTzid = "America/New_York"
<# Add or remove minutes to Sunrise and Sunset times. This can help to account for local peculiarities. Values can be negative, for example, -30 means the event triggers 30 minutes earlier. #>
$sunriseOffset = 0
$sunsetOffset = 0
# ============= Context menu =============
<# If `$true`, adds an 'Auto Theme' context menu on desktop.
This allows you to show the next wallpaper in the slideshow, quickly switch between Light and Dark modes on demand, or refresh the Scheduled Tasks. It may requires a restart of Explorer to take effect. #>
$addContextMenu = $true
# ============= Extra apps variables =============
<# Sysinternals Process Explorer doesn't automatically change theme when the system theme is changed. Use this variable if you want it to be restarted. If you run Process Explorer as Admin, the script should also run as Admin for this to work. You can use the $forceAsAdmin variable below for the purpose. #>
$restartProcexp = $false
# If `$true`, Process Explorer will keep Admin rights (inheriting from this script).
# If `$false`, it will be restarted as a standard user. All other apps are restarted as standard user.
$restartProcexpElevated = $true
<# Change TrueLaunchBar colors (will cause Explorer to be restarted.) Look into the 'Update-TrueLaunchBar-colors' function for more details #>
$customizeTrueLaunch = $false
$trueLaunchIniFilePath = Join-Path $Env:APPDATA "Tordex\True Launch Bar\settings\setup.ini"
<# Changes color in the T-Clock font, so that it adapts to the current theme. When T-Clock redraws the clock background based on accent color, it may cause the taskbar to crash or flicker. #>
$tClockPath = "C:\Path\to\T-Clock\Clock64.exe"
$updateTClockColor = $false
$restartTClockColor = $false # usually not needed
# ============= Developer variables ==============
$log = $true
$logFromTerminal = $false
$trimLog = $true
$verbose = $false
$lastRunInterval = "5"
$waitExplorer = "30"
<# Refuses a theme switch that comes less than `$lastRunInterval` minutes after the last one.
Themes only: 'Next wallpaper' and the slideshow change the wallpaper without touching the
theme, so they are never held back by this. #>
$checkLastRun = $true
$maxLogEntries = "5"
# Try turning accent color off for Taskbar if you have surge issues when switching theme or wallpaper
$turnOffAccentColor = $false
$restartThemeService = $false
$forceAsAdmin = $false
# required files
$appLogo = Join-Path $PSScriptRoot "at.png"
$logFile = Join-Path $PSScriptRoot "at.log"
$workerPath = Join-Path $PSScriptRoot "at-wallpaper.ps1"
<# Console Visibility Settings when run from Task Scheduler:
* "ch"- Completely hidden (no flash) using `conhost --headless`
* "ps"- Standard PowerShell window (may flash briefly)
* "wt"- Opens in Windows Terminal (using existing window if open) #>
$terminalVisibility = "ch"
<# Where to save wallpaper name and path, the last seen wall in the slideshow, and the time of the last run. If `$true`it saves to the Registry, otherwise goes to `at-state.ini`, next to this script. Note that `$howToDisplayName = "rainmeter"` overrides this and forces the Registry, because Rainmeter cannot read a file. #>
$writeRegistry = $false