1- # ============= User variables =============
21
3- # Name of theme files
2+ # ============= Theme variables =============
3+
4+ <# If `$true`, the script will use `.theme` files to select light and dark themes, as well as
5+ wallpaper slideshows and other personalizations. If `$false`, it will use its native system
6+ to switch between dark and light modes, and implement a wallpaper slideshow accordingly. #>
7+ $useThemeFiles = $true
8+
9+ <# Name of theme files
10+ * Only relevant when `$useThemeFiles = $true` #>
411 $themeLight = " Name-of-Light.theme"
512 $themeDark = " Name-of-Dark.theme"
613
7- <# Complete path to the `.theme` files. You can use the default path to Windows themes
14+ <# COMPLETE PATH to the `.theme` files. You can use the default path to Windows themes
815 (as proposed in the example below) or a custom path of your choice.
9- Consider that Windows will always copy your `.theme` files to LocalAppData.
10- You can use something like `$lightPath = Join-Path $PSScriptRoot $themeLight`
11- if your `.theme` files are located within the script folder. #>
16+ You can use `$lightPath = Join-Path $PSScriptRoot $themeLight`
17+ if your `.theme` files are located within the script folder.
18+ * Only relevant when `$useThemeFiles = $true` #>
1219 $lightPath = Join-Path (Join-Path $Env: LOCALAPPDATA " Microsoft\Windows\Themes" ) $themeLight
1320 $darkPath = Join-Path (Join-Path $Env: LOCALAPPDATA " Microsoft\Windows\Themes" ) $themeDark
1421
22+ # ============= Wallpaper variables =============
23+
24+ <# If `$true`, the script will only switch between Dark and Light modes, ignoring wallpapers.
25+ * Only relevant when `$useThemeFiles = $false` #>
26+ $noWallpaperChange = $false
27+
28+ <# Randomize first wallpaper.
29+ Even if `shuffle=1` is set in a `.theme` file, Windows will always use
30+ the first wallpaper in alphabetic order as the first shown.
31+ Setting this to $true offers more variety as soon as the theme is applied.
32+ Be aware that, to this end, a randomly-picked wallpaper file
33+ will be temporarily renamed with a "0_AutoTheme" string prepended to it.
34+ * Only relevant when `$useThemeFiles = $true` #>
35+ $randomFirst = $true
36+
37+ <# Paths to the folders for light and dark wallpapers.
38+ If `$useThemeFiles = $true`, indicate here the same paths indicated in the `.theme` files.
39+ If `$useThemeFiles = $false`, indicate paths to images or folders to be selected for Light and Dark modes. #>
40+ $wallLightPath = " C:\Path\to\Light\wallpapers"
41+ $wallDarkPath = " C:\Path\to\Dark\wallpapers"
42+
43+ # Show the wallpaper name in notification
44+ $showWallName = $true
45+
46+ # ============= Time variables =============
47+
1548 # Use fixed hours to switch Themes (keeps the script completely offline)
1649 $useFixedHours = $false
1750
2053 $lightThemeTime = " 07:00 AM"
2154 $darkThemeTime = " 07:00 PM"
2255
23- <# Set to $true to always use a user-defined location.
24- Alernatively , the script will attempt to retrieve location from the system
56+ <# Set to ` $true` to always use a user-defined location.
57+ If `$false` , the script will attempt to retrieve location from the system
2558 or, failing that, from your ISP, which may not give accurate results. #>
2659 $useUserLoc = $false
2760
2861 <# User-defined coordinates and timezone. You can obtain your coordinates from Google or similar services.
2962 You can find a list of timezone identifiers at this url:
30- https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
31- (These values are only retrieved if $UseUserLoc = $true and $useFixedHours = $false.
32- Yet, better set them, as the script will fall back to them, if all else fails.) #>
63+ https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
64+ * Only relevant if `$useUserLoc = $true`#>
3365 $userLat = " 40.7128"
3466 $userLng = " -74.0060"
3567 $UserTzid = " America/New_York"
3668
3769 <# Add or remove minutes to Sunrise and Sunset times. This can help
38- to account for local peculiarities
39- . Values can be negative,
70+ to account for local peculiarities. Values can be negative,
4071 for example, -30 means the event triggers 30 minutes earlier. #>
4172 $sunriseOffset = 0
4273 $sunsetOffset = 0
4374
44- <# Randomize first wallpaper.
45- Even if 'shuffle=1' is set in a `.theme` file, Windows will always use
46- the first wallpaper in alphabetic order as the first shown.
47- Setting this to $true offers more variety as soon as the theme is applied.
48- Be aware that, to this end, a randomly-picked wallpaper file
49- will be temporarily renamed with a "0_AutoTheme" string prepended to it. #>
50- $randomFirst = $true
51-
52- <# Paths to the folders for light and dark wallpapers.
53- (only needed if $randomFirst = true)
54- Use the same ones indicated in your .theme files. #>
55- $wallLightPath = " C:\Path\to\Light\wallpapers"
56- $wallDarkPath = " C:\Path\to\Dark\wallpapers"
57-
58- # Show the wallpaper name in notification
59- $showWallName = $true
60-
6175# ============= Extra apps variables =============
6276
6377 <# Sysinternals Process Explorer doesn't automatically change theme when
6478 the system theme is changed. Use this variable if you want it to be restarted.
6579 If you run Process Explorer as Admin, the script should also run as Admin for this to work.
6680 You can use the $forceAsAdmin variable below for the purpose. #>
6781 $restartProcexp = $false
68- # If true, Process Explorer will keep Admin rights (inheriting from this script).
69- # If false, it will be restarted as a standard user. All other apps are restarted as standard user.
82+ # If `$ true` , Process Explorer will keep Admin rights (inheriting from this script).
83+ # If `$ false` , it will be restarted as a standard user. All other apps are restarted as standard user.
7084 $restartProcexpElevated = $true
7185
7286 <# Change TrueLaunchBar colors (will cause Explorer to be restarted)
7892 $restartMusicBee = $false
7993
8094 <# Changes color in the T-Clock font, so that it adapts to the current theme.
81- Regarding this app, be aware that when T-Clock redraws the clock background based on accent color,
82- it may cause the taskbar to crash or flicker. Better avoid it. #>
95+ When T-Clock redraws the clock background based on accent color,
96+ it may cause the taskbar to crash or flicker. #>
8397 $tClockPath = " C:\Path\to\T-Clock\Clock64.exe"
8498 $updateTClockColor = $false
85- $restartTClockColor = $false
99+ $restartTClockColor = $false # usually not needed
86100
87101# ============= Developer variables ==============
88102
93107 $lastRunInterval = " 5"
94108 $waitExplorer = " 30"
95109 $checkLastRun = $true
96- $maxLogEntries = " 20 "
110+ $maxLogEntries = " 5 "
97111
98- # Turn this off if you have surge issues when switching theme or wallpaper
112+ # Try turning accent color off if you have surge issues when switching theme or wallpaper
99113 $turnOffAccentColor = $false
100114
101115 $restartThemeService = $false
102116 $forceAsAdmin = $false
103117
104- $appLogo = Join-Path $PSScriptRoot " AutoTheme .png"
105- $logFile = Join-Path $PSScriptRoot " AutoTheme .log"
106- $lastRunFile = Join-Path $PSScriptRoot " ATLastRun .txt"
107-
108- # Console Visibility Settings when run from Task Scheduler
109- # "ch" - Completely hidden (no flash) using conhost --headless
110- # "ps" - Standard PowerShell window (may flash briefly)
111- # "wt" - Opens in Windows Terminal (using existing window if open)
112- $terminalVisibility = " ch"
118+ $appLogo = Join-Path $PSScriptRoot " at .png"
119+ $logFile = Join-Path $PSScriptRoot " at .log"
120+ $lastRunFile = Join-Path $PSScriptRoot " at-lastRun .txt"
121+
122+ < # Console Visibility Settings when run from Task Scheduler:
123+ * "ch"- Completely hidden (no flash) using ` conhost --headless`
124+ * "ps"- Standard PowerShell window (may flash briefly)
125+ * "wt"- Opens in Windows Terminal (using existing window if open) #>
126+ $terminalVisibility = " ch"
0 commit comments